diff options
Diffstat (limited to 'src/components/PostMeta')
| -rw-r--r-- | src/components/PostMeta/PostMeta.module.scss | 31 | ||||
| -rw-r--r-- | src/components/PostMeta/PostMeta.tsx | 67 |
2 files changed, 0 insertions, 98 deletions
diff --git a/src/components/PostMeta/PostMeta.module.scss b/src/components/PostMeta/PostMeta.module.scss deleted file mode 100644 index d438635..0000000 --- a/src/components/PostMeta/PostMeta.module.scss +++ /dev/null @@ -1,31 +0,0 @@ -@use "@styles/abstracts/functions" as fun; -@use "@styles/abstracts/mixins" as mix; - -.wrapper { - &--list { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - margin-top: var(--spacing-md); - font-size: var(--font-size-sm); - - @include mix.media("screen") { - @include mix.dimensions("sm") { - display: flex; - flex-flow: column nowrap; - margin: 0; - composes: meta from "@components/PostPreview/PostPreview.module.scss"; - } - } - } - - &--article { - flex-flow: column wrap; - margin: var(--spacing-sm) 0 0; - - @include mix.media("screen") { - @include mix.dimensions("xs") { - font-size: var(--font-size-sm); - } - } - } -} diff --git a/src/components/PostMeta/PostMeta.tsx b/src/components/PostMeta/PostMeta.tsx deleted file mode 100644 index 7fba0be..0000000 --- a/src/components/PostMeta/PostMeta.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { - Author, - CommentsCount, - Dates, - PostsCount, - ReadingTime, - Thematics, - Topics, - Website, -} from '@components/MetaItems'; -import { MetaKind } from '@ts/types/app'; -import { ArticleMeta } from '@ts/types/articles'; -import { useRouter } from 'next/router'; -import styles from './PostMeta.module.scss'; - -const PostMeta = ({ - meta, - kind = 'list', -}: { - meta: ArticleMeta; - kind?: MetaKind; -}) => { - const { - author, - commentCount, - dates, - readingTime, - results, - thematics, - topics, - website, - wordsCount, - } = meta; - const { asPath } = useRouter(); - const isThematic = () => asPath.includes('/thematique/'); - - const wrapperClass = styles[`wrapper--${kind}`]; - - return ( - <dl className={wrapperClass}> - {author && <Author name={author.name} kind={kind} />} - {dates && ( - <Dates - publication={dates.publication} - update={dates.update} - kind={kind} - /> - )} - {readingTime !== undefined && wordsCount !== undefined && ( - <ReadingTime time={readingTime} words={wordsCount} kind={kind} /> - )} - {results !== undefined && <PostsCount total={results} kind={kind} />} - {!isThematic() && thematics && thematics.length > 0 && ( - <Thematics list={thematics} kind={kind} /> - )} - {isThematic() && topics && topics.length > 0 && ( - <Topics list={topics} kind={kind} /> - )} - {website && <Website url={website} kind={kind} />} - {commentCount !== undefined && ( - <CommentsCount total={commentCount} kind={kind} /> - )} - </dl> - ); -}; - -export default PostMeta; |
