-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPageContentLayout.tsx
More file actions
77 lines (74 loc) · 2.1 KB
/
Copy pathPageContentLayout.tsx
File metadata and controls
77 lines (74 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import React from 'react';
import classNames from 'classnames';
import styles from './pageContentLayout.module.scss';
import Hero from '../hero/Hero';
import { ContentContainer } from '../contentContainer/ContentContainer';
import { PageSection } from '../pageSection/PageSection';
import type { HeroProps } from './types';
export type PageContentLayoutProps = {
id: string;
breadcrumbs?: React.ReactNode;
heroContainer?: React.JSX.Element;
content: React.ReactNode;
shareLinks?: React.ReactNode;
collections?: React.ReactNode;
sidebarContent: React.ReactNode;
imageSrc?: string | null;
imageAlt?: string;
imageLabel?: string;
backUrl?: string;
} & HeroProps;
export function PageContentLayout({
id,
breadcrumbs,
heroContainer,
content,
shareLinks,
collections,
sidebarContent,
imageSrc,
imageAlt,
imageLabel,
backUrl,
...heroProps
}: PageContentLayoutProps) {
return (
<div className={styles.contentLayout}>
{breadcrumbs && <div className={styles.breadcrumbs}>{breadcrumbs}</div>}
<div className={styles.mainLayout}>
<Hero
id={id}
container={heroContainer}
imageAlt={imageAlt}
imageUrl={imageSrc ?? undefined}
imageLabel={imageLabel}
backUrl={backUrl}
{...heroProps}
/>
<PageSection
className={classNames(
styles.contentWrapper,
!heroProps.title && !imageSrc ? styles.withBorder : '',
)}
>
<ContentContainer>
<div className={styles.content}>
<div className={styles.mainContent}>{content}</div>
<aside>{sidebarContent}</aside>
<div className={styles.shareLinks}>{shareLinks}</div>
</div>
</ContentContainer>
</PageSection>
{collections && (
<PageSection
className={styles.collectionsWrapper}
korosTop
korosTopClassName={styles.collectionKorosTop}
>
<ContentContainer>{collections}</ContentContainer>
</PageSection>
)}
</div>
</div>
);
}