move to ts
This commit is contained in:
1 parent
150404ca0b
commit
e7f3b0d7ce
2 files changed
+11
-14
No files matched your search
@@ -1,6 +1,5 @@
|
|||||||
import React from 'react'
|
import { dateFormat } from 'src/lib/date'
|
||||||
import { dateFormat } from '../lib/date'
|
import { Share } from '../Share'
|
||||||
import { Share } from './Share'
|
|
||||||
|
|
||||||
const Tag = ({ children }) => (
|
const Tag = ({ children }) => (
|
||||||
<li className="ArticleTags-Item">
|
<li className="ArticleTags-Item">
|
||||||
@@ -18,10 +17,16 @@ const TagList = ({ tags }) => (
|
|||||||
|
|
||||||
const Head = ({ date, tags = [], children }) => (
|
const Head = ({ date, tags = [], children }) => (
|
||||||
<header className="Article-Head">
|
<header className="Article-Head">
|
||||||
|
<style jsx>{`
|
||||||
|
.date {
|
||||||
|
color: var(--color-text-second);
|
||||||
|
}
|
||||||
|
`}</style>
|
||||||
|
|
||||||
<h1>{children}</h1>
|
<h1>{children}</h1>
|
||||||
|
|
||||||
{!date ? null : (
|
{!date ? null : (
|
||||||
<p className="date">{dateFormat(date)}</p>
|
<p className={'date'}>{dateFormat(date)}</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!(tags.length) ? null : (
|
{!(tags.length) ? null : (
|
||||||
@@ -30,7 +35,7 @@ const Head = ({ date, tags = [], children }) => (
|
|||||||
</header>
|
</header>
|
||||||
)
|
)
|
||||||
|
|
||||||
const Article = ({ children, date, tags, title, shareable }) => (
|
export const Article = ({ children, date, tags, title, shareable }) => (
|
||||||
<article className="Article">
|
<article className="Article">
|
||||||
<Head
|
<Head
|
||||||
date={date}
|
date={date}
|
||||||
@@ -48,5 +53,3 @@ const Article = ({ children, date, tags, title, shareable }) => (
|
|||||||
)}
|
)}
|
||||||
</article>
|
</article>
|
||||||
)
|
)
|
||||||
|
|
||||||
export default Article
|
|
||||||
@@ -15,13 +15,7 @@
|
|||||||
margin-bottom: var(--article-head-margin-bottom);
|
margin-bottom: var(--article-head-margin-bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
.date {
|
}
|
||||||
text-align: center;
|
|
||||||
color: #aaa;
|
|
||||||
|
|
||||||
margin-bottom: 1.25em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-Body {
|
&-Body {
|
||||||
--text-margin: 10px;
|
--text-margin: 10px;
|
||||||
|
|||||||
Reference in new issue
Block a user