-
Notifications
You must be signed in to change notification settings - Fork 66.8k
Expand file tree
/
Copy pathArticleGridLayout.tsx
More file actions
55 lines (51 loc) · 1.56 KB
/
ArticleGridLayout.tsx
File metadata and controls
55 lines (51 loc) · 1.56 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
import React from 'react'
import cx from 'classnames'
import { SupportPortalVaIframe, SupportPortalVaIframeProps } from './SupportPortalVaIframe'
import styles from './ArticleGridLayout.module.scss'
type Props = {
intro?: React.ReactNode
topper?: React.ReactNode
toc?: React.ReactNode
children?: React.ReactNode
className?: string
supportPortalVaIframeProps?: SupportPortalVaIframeProps
fullWidth?: boolean
}
export const ArticleGridLayout = ({
intro,
topper,
toc,
children,
className,
supportPortalVaIframeProps,
fullWidth,
}: Props) => {
const containerBoxStyles = fullWidth ? '' : styles.containerBox
return (
<div className={cx(containerBoxStyles, className)}>
{topper && <div style={{ gridArea: 'topper' }}>{topper}</div>}
{intro && (
<div id="article-intro" style={{ gridArea: 'intro' }} className="f4 pb-4">
{intro}
</div>
)}
{toc && (
<div
data-container="toc"
style={{ gridArea: 'sidebar', alignSelf: 'flex-start' }}
className={cx(styles.sidebarBox, 'border-bottom border-lg-0 pb-4 mb-5 pb-xl-0 mb-xl-0')}
>
{toc}
</div>
)}
<div data-container="article" style={{ gridArea: 'content' }} data-search="article-body">
{supportPortalVaIframeProps &&
supportPortalVaIframeProps.supportPortalUrl &&
supportPortalVaIframeProps.vaFlowUrlParameter && (
<SupportPortalVaIframe supportPortalVaIframeProps={supportPortalVaIframeProps} />
)}
{children}
</div>
</div>
)
}