From 732d0943f8041d76262222a092b014f2557085ef Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 2 May 2022 18:57:29 +0200 Subject: chore: add homepage --- src/components/atoms/lists/list.module.scss | 16 + src/components/atoms/lists/list.stories.tsx | 13 +- src/components/atoms/lists/list.tsx | 4 +- src/components/molecules/layout/card.module.scss | 3 +- src/components/molecules/layout/card.tsx | 2 +- src/components/molecules/layout/page-header.tsx | 2 +- src/components/molecules/nav/nav.stories.tsx | 26 ++ src/components/molecules/nav/nav.tsx | 7 +- .../organisms/layout/cards-list.module.scss | 4 +- .../organisms/layout/cards-list.stories.tsx | 13 + src/components/organisms/layout/cards-list.tsx | 8 +- src/components/templates/layout/layout.module.scss | 9 - src/components/templates/layout/layout.stories.tsx | 10 +- src/components/templates/layout/layout.tsx | 107 ++++-- src/pages/index.tsx | 365 +++++++++++++++++++++ src/services/graphql/articles.ts | 52 ++- src/styles/pages/Home.module.scss | 49 --- src/styles/pages/home.module.scss | 36 ++ src/utils/hooks/use-settings.tsx | 112 +++++++ 19 files changed, 745 insertions(+), 93 deletions(-) create mode 100644 src/pages/index.tsx delete mode 100644 src/styles/pages/Home.module.scss create mode 100644 src/styles/pages/home.module.scss create mode 100644 src/utils/hooks/use-settings.tsx diff --git a/src/components/atoms/lists/list.module.scss b/src/components/atoms/lists/list.module.scss index df3b49c..f647072 100644 --- a/src/components/atoms/lists/list.module.scss +++ b/src/components/atoms/lists/list.module.scss @@ -1,3 +1,5 @@ +@use "@styles/abstracts/placeholders"; + .list { margin: 0; @@ -36,4 +38,18 @@ margin-bottom: var(--spacing-2xs); } } + + &--flex { + @extend %reset-list; + + display: flex; + flex-flow: row wrap; + gap: var(--spacing-sm); + } + + &--flex &--flex { + display: initial; + position: relative; + top: var(--spacing-2xs); + } } diff --git a/src/components/atoms/lists/list.stories.tsx b/src/components/atoms/lists/list.stories.tsx index 3a80962..54fdd3a 100644 --- a/src/components/atoms/lists/list.stories.tsx +++ b/src/components/atoms/lists/list.stories.tsx @@ -39,8 +39,8 @@ export default { control: { type: 'select', }, - description: 'The list kind: ordered or unordered.', - options: ['ordered', 'unordered'], + description: 'The list kind: flex, ordered or unordered.', + options: ['flex', 'ordered', 'unordered'], table: { category: 'Options', defaultValue: { summary: 'unordered' }, @@ -71,6 +71,15 @@ const items: ListItem[] = [ { id: 'item-4', value: 'Item 4' }, ]; +/** + * List Stories - Flex list + */ +export const Flex = Template.bind({}); +Flex.args = { + items, + kind: 'flex', +}; + /** * List Stories - Ordered list */ diff --git a/src/components/atoms/lists/list.tsx b/src/components/atoms/lists/list.tsx index 6726802..711ade1 100644 --- a/src/components/atoms/lists/list.tsx +++ b/src/components/atoms/lists/list.tsx @@ -30,9 +30,9 @@ export type ListProps = { */ itemsClassName?: string; /** - * The list kind (ordered or unordered). + * The list kind. */ - kind?: 'ordered' | 'unordered'; + kind?: 'ordered' | 'unordered' | 'flex'; /** * Set margin between list items. Default: true. */ diff --git a/src/components/molecules/layout/card.module.scss b/src/components/molecules/layout/card.module.scss index 85c319a..d5b9836 100644 --- a/src/components/molecules/layout/card.module.scss +++ b/src/components/molecules/layout/card.module.scss @@ -19,7 +19,8 @@ .cover { align-self: flex-start; - max-height: fun.convert-px(150); + place-content: center; + height: fun.convert-px(150); margin: auto; border-bottom: fun.convert-px(1) solid var(--color-border); } diff --git a/src/components/molecules/layout/card.tsx b/src/components/molecules/layout/card.tsx index 15927e9..89f100e 100644 --- a/src/components/molecules/layout/card.tsx +++ b/src/components/molecules/layout/card.tsx @@ -93,7 +93,7 @@ const Card: FC = ({ {title} - {tagline &&
{tagline}
} +
{tagline}
{meta && (