Skip to content

Commit

Permalink
frontend: Add full screen option to app configuration (#3196)
Browse files Browse the repository at this point in the history
This pull request includes changes to the `AppLayout` component in the
`frontend/packages/core/src/AppLayout/index.tsx` file and the
`AppConfiguration` interface in the
`frontend/packages/core/src/Types/app.tsx` file. The primary goal of
these changes is to introduce the option for a full-screen layout.

Enhancements to layout configuration:

*
[`frontend/packages/core/src/AppLayout/index.tsx`](diffhunk://#diff-1465c1bdd75a440d3a5592c719280d01afe84948428c566711068196e9a02decL36-R45):
Modified the `AppLayout` component to conditionally render the header
and drawer based on the new `useFullScreenLayout` configuration option.
*
[`frontend/packages/core/src/Types/app.tsx`](diffhunk://#diff-cf066233a855942622a45960706a4b5e3bb99869f102c3e33c040d7983fa6862R10):
Added a new `useFullScreenLayout` boolean property to the
`AppConfiguration` interface to support the new layout option.
  • Loading branch information
lucechal14 authored Jan 10, 2025
1 parent d96e350 commit 2dec293
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/packages/core/src/AppLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ const AppLayout: React.FC<AppLayoutProps> = ({
}) => {
return (
<AppGrid container direction="column" data-testid="app-layout-component">
{header && React.cloneElement(header, { ...configuration, ...header.props })}
{!header && <Header {...configuration} />}
{!configuration?.useFullScreenLayout &&
header &&
React.cloneElement(header, { ...configuration, ...header.props })}
{!configuration?.useFullScreenLayout && !header && <Header {...configuration} />}
<ContentGrid container wrap="nowrap">
{isLoading ? (
<Loadable isLoading={isLoading} variant="overlay" />
) : (
<>
<Drawer />
{!configuration?.useFullScreenLayout && <Drawer />}
<MainContent>
<Outlet />
</MainContent>
Expand Down
1 change: 1 addition & 0 deletions frontend/packages/core/src/Types/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export interface AppConfiguration {
logo?: React.ReactNode | string;
banners?: AppBanners;
useWorkflowLayout?: boolean;
useFullScreenLayout?: boolean;
}

0 comments on commit 2dec293

Please sign in to comment.