ui: first pass on redesign (#228)

This commit is contained in:
Jean-Philippe Sirois
2020-05-11 02:00:57 -04:00
committed by GitHub
parent 12d1346d4b
commit ab8e8edd5a
40 changed files with 779 additions and 362 deletions
+3 -1
View File
@@ -4,6 +4,7 @@ import { Header } from "../components/Header"
import { Markdown } from "../components/Markdown"
import { SEO } from "../components/SEO"
import { humanize } from "../utils"
import { PageContent } from "../components/PageContent"
// @todo maybe find alternative type for data
const Archive: FC<any> = ({ data }) => {
@@ -21,8 +22,9 @@ const Archive: FC<any> = ({ data }) => {
title={title}
createdAt={ctime}
timeToRead={timeToRead}
shifted={false}
/>
<Markdown content={html} />
<PageContent content={<Markdown content={html} />} />
</Fragment>
)
}
+16 -2
View File
@@ -4,12 +4,18 @@ import { Header } from "../components/Header"
import { Markdown } from "../components/Markdown"
import { ResourcesList } from "../components/ResourcesList"
import { SEO } from "../components/SEO"
import { PageContent } from "../components/PageContent"
import { Footer } from "../components/Footer"
// @todo maybe find alternative type for data
const LanguageHome: FC<any> = ({ data, pageContext }) => {
const { relativePath } = data.file
const { html, excerpt, fields, frontmatter, timeToRead } = data.file.post
const shiftLayout = Boolean(
frontmatter.recommended_reading || frontmatter.external_resources
)
return (
<Fragment>
<SEO title={frontmatter.title} description={excerpt} />
@@ -20,11 +26,19 @@ const LanguageHome: FC<any> = ({ data, pageContext }) => {
authors={fields.authors}
createdAt={frontmatter.created_at}
timeToRead={timeToRead}
shifted={shiftLayout}
/>
<PageContent
content={
<>
<Markdown content={html} />
<ResourcesList relativeDirectory={pageContext.language} />
<Footer />
</>
}
recommendedReading={frontmatter.recommended_reading}
externalResources={frontmatter.external_resources}
/>
<Markdown content={html} />
<ResourcesList relativeDirectory={pageContext.language} />
</Fragment>
)
}
+15 -1
View File
@@ -5,12 +5,18 @@ import { Markdown } from "../components/Markdown"
import { SEO } from "../components/SEO"
import "katex/dist/katex.min.css"
import { PageContent } from "../components/PageContent"
import { Footer } from "../components/Footer"
// @todo maybe find alternative type for data
const LanguagePost: FC<any> = ({ data }) => {
const { relativePath } = data.file
const { html, excerpt, fields, frontmatter, timeToRead } = data.file.post
const shiftLayout = Boolean(
frontmatter.recommended_reading || frontmatter.external_resources
)
return (
<Fragment>
<SEO title={frontmatter.title} description={excerpt} />
@@ -21,10 +27,18 @@ const LanguagePost: FC<any> = ({ data }) => {
authors={fields.authors}
createdAt={frontmatter.created_at}
timeToRead={timeToRead}
shifted={shiftLayout}
/>
<PageContent
content={
<>
<Markdown content={html} />
<Footer />
</>
}
recommendedReading={frontmatter.recommended_reading}
externalResources={frontmatter.external_resources}
/>
<Markdown content={html} />
</Fragment>
)
}