Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Meta, StoryObj } from '@storybook/react';
import React from 'react';
import { WYSIWYG } from '../../03-components/Wysiwyg/Wysiwyg.stories';
import LandingPageTemplate from './LandingPage';

const meta: Meta<typeof LandingPageTemplate> = {
title: 'Templates/Landing Page',
component: LandingPageTemplate,
};

const LandingPage: StoryObj<typeof LandingPageTemplate> = {
render: args => (
<LandingPageTemplate {...args}>
{WYSIWYG.render && <WYSIWYG.render {...WYSIWYG.args} />}
</LandingPageTemplate>
),
args: {
title: 'Landing Page Title',
},
};

export default meta;
export { LandingPage };
8 changes: 7 additions & 1 deletion services/app/source/04-templates/LandingPage/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ import Head from 'next/head';
import { ReactNode } from 'react';
import { MAIN_ID } from '../../00-config/constants';
import Main from '../../02-layouts/Main/Main';
import PageTitle from '../../03-components/PageTitle/PageTitle';

interface PageProps {
mainId?: string;
title: string;
hidePageTitle?: boolean;
description?: string;
children?: ReactNode;
}

function LandingPage({
mainId = MAIN_ID,
title,
hidePageTitle,
description,
children,
}: PageProps): JSX.Element {
Expand All @@ -22,7 +25,10 @@ function LandingPage({
<title>{title}</title>
{description && <meta name="description" content={description} />}
</Head>
<Main id={mainId}>{children}</Main>
<Main id={mainId}>
{!hidePageTitle && title && <PageTitle pageTitle={title} />}
{children}
</Main>
</>
);
}
Expand Down
2 changes: 1 addition & 1 deletion services/app/source/05-pages/Homepage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const settings: Meta<HomepageStoryArgs> = {
const Homepage: StoryObj<HomepageStoryArgs> = {
render: args => (
<PageWrapper>
<LandingPage title="Homepage">
<LandingPage title="Homepage" hidePageTitle={true}>
<Section>
<HeroBgImage {...args.hero} />
</Section>
Expand Down