Skip to content

Commit

Permalink
Add option to display full-width content on automated pages (#49636)
Browse files Browse the repository at this point in the history
  • Loading branch information
rachmari authored Mar 11, 2024
1 parent b594690 commit 86769f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/automated-pipelines/components/AutomatedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import { Breadcrumbs } from 'src/frame/components/page-header/Breadcrumbs'

type Props = {
children: React.ReactNode
fullWidth?: boolean
}

export const AutomatedPage = ({ children }: Props) => {
export const AutomatedPage = ({ children, fullWidth }: Props) => {
const { title, intro, renderedPage, miniTocItems, product, permissions } =
useAutomatedPageContext()

Expand All @@ -23,6 +24,7 @@ export const AutomatedPage = ({ children }: Props) => {

<div className="container-xl px-3 px-md-6 my-4">
<ArticleGridLayout
fullWidth={fullWidth}
topper={
<>
<div className="d-none d-xl-block my-3 mr-auto width-full">
Expand Down
5 changes: 4 additions & 1 deletion src/frame/components/article/ArticleGridLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type Props = {
children?: React.ReactNode
className?: string
supportPortalVaIframeProps?: SupportPortalVaIframeProps
fullWidth?: boolean
}
export const ArticleGridLayout = ({
intro,
Expand All @@ -20,9 +21,11 @@ export const ArticleGridLayout = ({
children,
className,
supportPortalVaIframeProps,
fullWidth,
}: Props) => {
const containerBoxStyles = fullWidth ? '' : styles.containerBox
return (
<Box className={cx(styles.containerBox, className)}>
<Box className={cx(containerBoxStyles, className)}>
{topper && <Box gridArea="topper">{topper}</Box>}
{intro && (
<Box id="article-intro" gridArea="intro" className="f4 pb-4">
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/pages/explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function GQLExplorer({
return (
<MainContext.Provider value={mainContext}>
<AutomatedPageContext.Provider value={automatedPageContext}>
<AutomatedPage>
<AutomatedPage fullWidth={true}>
<div>
{/* eslint-disable-next-line jsx-a11y/iframe-has-title */}
<iframe
Expand Down

0 comments on commit 86769f6

Please sign in to comment.