-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Extract common layout component for pages (#1323)
- Loading branch information
1 parent
cdff513
commit 209d1ef
Showing
8 changed files
with
124 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,14 @@ | ||
import { Footer, Overlap, Screen, SkipLink } from '@amsterdam/design-system-react' | ||
import type { FooterProps } from '@amsterdam/design-system-react' | ||
import { ReactElement } from 'react' | ||
import { Overlap } from '@amsterdam/design-system-react' | ||
import { HomeNews } from './HomeNews' | ||
import { HomeSpotlight } from './HomeSpotlight' | ||
import { HomeTopTasks } from './HomeTopTasks' | ||
import { Default as OverlapStory } from '../../../components/Overlap/Overlap.stories' | ||
import SkipLinkStoryMeta from '../../../components/SkipLink/SkipLink.stories' | ||
import { AppHeader } from '../common/AppHeader' | ||
|
||
type HomePageProps = { | ||
footer: ReactElement<FooterProps> | ||
} | ||
|
||
export const HomePage = ({ footer }: HomePageProps) => ( | ||
<> | ||
<SkipLink href="#main">{SkipLinkStoryMeta.args.children}</SkipLink> | ||
<Screen maxWidth="wide"> | ||
<AppHeader /> | ||
<main id="main"> | ||
<Overlap>{OverlapStory.args?.children}</Overlap> | ||
<HomeTopTasks /> | ||
<HomeSpotlight /> | ||
<HomeNews /> | ||
</main> | ||
<Footer>{footer}</Footer> | ||
</Screen> | ||
</> | ||
export const HomePage = () => ( | ||
<main id="main"> | ||
<Overlap>{OverlapStory.args?.children}</Overlap> | ||
<HomeTopTasks /> | ||
<HomeSpotlight /> | ||
<HomeNews /> | ||
</main> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Footer, Screen, SkipLink } from '@amsterdam/design-system-react' | ||
import type { HTMLAttributes, PropsWithChildren } from 'react' | ||
import { AppHeader } from './AppHeader' | ||
import { Default as FooterStory } from '../../../components/Footer/Footer.stories' | ||
|
||
type LayoutProps = PropsWithChildren<HTMLAttributes<HTMLElement>> | ||
|
||
export const Layout = ({ children }: LayoutProps) => ( | ||
<> | ||
<SkipLink href="#main">Direct naar inhoud</SkipLink> | ||
<Screen maxWidth="wide"> | ||
<AppHeader /> | ||
{children} | ||
<Footer>{FooterStory.args?.children}</Footer> | ||
</Screen> | ||
</> | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Meta } from '@storybook/react' | ||
import { Layout } from './Layout' | ||
|
||
export const commonMeta = { | ||
decorators: [ | ||
(Story) => ( | ||
<Layout> | ||
<Story /> | ||
</Layout> | ||
), | ||
], | ||
parameters: { | ||
layout: 'fullscreen', | ||
themes: { themeOverride: 'Spacious' }, | ||
}, | ||
} satisfies Meta |