Skip to content

Commit

Permalink
Reduce duplication by using a shared wrapper for all page layouts #3325
Browse files Browse the repository at this point in the history
  • Loading branch information
erkannt committed Jun 17, 2024
1 parent 96c828f commit 2be50bc
Showing 1 changed file with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
import { pipe } from 'fp-ts/function';
import { toHtmlFragment } from '../../../types/html-fragment';
import { toContentWrappedInLayout } from '../content-wrapped-in-layout';
import { mobileMenu } from '../mobile-menu/mobile-menu';
import { PageLayout } from '../page-layout';
import { siteFooter } from '../shared-components/site-footer';
import { siteHeader } from '../shared-components/site-header';
import { wrapWithHeaderAndFooter } from '../shared-components/wrap-with-header-and-footer';

export const createUserAccountFormPageLayout: PageLayout = (user) => (page) => pipe(
`
<div class="create-user-account-form-page__container">
${siteHeader(user)}
<main id="mainContent" class="create-user-account-form-page__main">
<div class="page-content">
${page.content}
</div>
</main>
${siteFooter}
</div>
${mobileMenu(user)}
<main id="mainContent" class="create-user-account-form-page__main">
<div class="page-content">
${page.content}
</div>
</main>
`,
toHtmlFragment,
wrapWithHeaderAndFooter('create-user-account-form-page__container', user),
toContentWrappedInLayout,
);

0 comments on commit 2be50bc

Please sign in to comment.