Add option to display full-width content on automated pages (#49636)
This commit is contained in:
@@ -11,9 +11,10 @@ import { Breadcrumbs } from 'src/frame/components/page-header/Breadcrumbs'
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
|
fullWidth?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AutomatedPage = ({ children }: Props) => {
|
export const AutomatedPage = ({ children, fullWidth }: Props) => {
|
||||||
const { title, intro, renderedPage, miniTocItems, product, permissions } =
|
const { title, intro, renderedPage, miniTocItems, product, permissions } =
|
||||||
useAutomatedPageContext()
|
useAutomatedPageContext()
|
||||||
|
|
||||||
@@ -23,6 +24,7 @@ export const AutomatedPage = ({ children }: Props) => {
|
|||||||
|
|
||||||
<div className="container-xl px-3 px-md-6 my-4">
|
<div className="container-xl px-3 px-md-6 my-4">
|
||||||
<ArticleGridLayout
|
<ArticleGridLayout
|
||||||
|
fullWidth={fullWidth}
|
||||||
topper={
|
topper={
|
||||||
<>
|
<>
|
||||||
<div className="d-none d-xl-block my-3 mr-auto width-full">
|
<div className="d-none d-xl-block my-3 mr-auto width-full">
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ type Props = {
|
|||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
className?: string
|
className?: string
|
||||||
supportPortalVaIframeProps?: SupportPortalVaIframeProps
|
supportPortalVaIframeProps?: SupportPortalVaIframeProps
|
||||||
|
fullWidth?: boolean
|
||||||
}
|
}
|
||||||
export const ArticleGridLayout = ({
|
export const ArticleGridLayout = ({
|
||||||
intro,
|
intro,
|
||||||
@@ -20,9 +21,11 @@ export const ArticleGridLayout = ({
|
|||||||
children,
|
children,
|
||||||
className,
|
className,
|
||||||
supportPortalVaIframeProps,
|
supportPortalVaIframeProps,
|
||||||
|
fullWidth,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
|
const containerBoxStyles = fullWidth ? '' : styles.containerBox
|
||||||
return (
|
return (
|
||||||
<Box className={cx(styles.containerBox, className)}>
|
<Box className={cx(containerBoxStyles, className)}>
|
||||||
{topper && <Box gridArea="topper">{topper}</Box>}
|
{topper && <Box gridArea="topper">{topper}</Box>}
|
||||||
{intro && (
|
{intro && (
|
||||||
<Box id="article-intro" gridArea="intro" className="f4 pb-4">
|
<Box id="article-intro" gridArea="intro" className="f4 pb-4">
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ export default function GQLExplorer({
|
|||||||
return (
|
return (
|
||||||
<MainContext.Provider value={mainContext}>
|
<MainContext.Provider value={mainContext}>
|
||||||
<AutomatedPageContext.Provider value={automatedPageContext}>
|
<AutomatedPageContext.Provider value={automatedPageContext}>
|
||||||
<AutomatedPage>
|
<AutomatedPage fullWidth={true}>
|
||||||
<div>
|
<div>
|
||||||
{/* eslint-disable-next-line jsx-a11y/iframe-has-title */}
|
{/* eslint-disable-next-line jsx-a11y/iframe-has-title */}
|
||||||
<iframe
|
<iframe
|
||||||
|
|||||||
Reference in New Issue
Block a user