diff --git a/pages/article/[slug].tsx b/pages/article/[slug].tsx index b713f1c6..81bc1e11 100644 --- a/pages/article/[slug].tsx +++ b/pages/article/[slug].tsx @@ -1,7 +1,7 @@ import Head from 'next/head' import { get } from 'lodash' import { App } from 'src/components/App' -import Article from 'src/components/Article' +import { Article } from 'src/components/Article' import { Html } from 'src/components/Html' import menuModel from 'src/models/menu' import { buildMenu } from 'src/lib/menu' @@ -9,11 +9,12 @@ import { Meta } from 'src/components/Meta' import { meta } from 'src/lib/meta' import { createApiUrl, requestGet, IResponseItems } from 'src/next-lib' import { NextPage } from 'next' +import { IArticle } from 'src/types' type Props = { pageUrl: string meta: any - data: any //(article) + data: IArticle } const Page: NextPage = props => { diff --git a/src/components/Article/index.tsx b/src/components/Article/index.tsx index 0be499cc..92259602 100644 --- a/src/components/Article/index.tsx +++ b/src/components/Article/index.tsx @@ -1,21 +1,21 @@ import { dateFormat } from 'src/lib/date' import { Share } from '../Share' +import { TagList } from '../TagList' +import { ITag } from 'src/types' -const Tag = ({ children }) => ( -
  • - {children} -
  • -) +export type ArticleProps = { + date: string + title: string + tags: ITag[] + shareable: boolean +} -const TagList = ({ tags }) => ( - -) +type HeadProps = { + date: string + tags: ITag[] +} -const Head = ({ date, tags = [], children }) => ( +const Head: React.FC = ({ date, tags = [], children }) => (