Skip to content

Commit

Permalink
fix for argoproj#12068
Browse files Browse the repository at this point in the history
  • Loading branch information
n9 committed Aug 17, 2023
1 parent c2e564d commit edb9943
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ui/src/app/shared/components/layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ export interface LayoutProps {

const getBGColor = (theme: string): string => (theme === 'light' ? '#dee6eb' : '#100f0f');

export const Layout = (props: LayoutProps) => (
<div className={props.pref.theme ? 'theme-' + props.pref.theme : 'theme-light'}>
export const Layout = (props: LayoutProps) => {
if (props.pref.theme) {
document.body.style.background = getBGColor(props.pref.theme)
}
return <div className={props.pref.theme ? 'theme-' + props.pref.theme : 'theme-light'}>
<div className={`cd-layout ${props.isExtension ? 'cd-layout--extension' : ''}`}>
<Sidebar onVersionClick={props.onVersionClick} navItems={props.navItems} pref={props.pref} />
{props.pref.theme ? (document.body.style.background = getBGColor(props.pref.theme)) : null}
<div className={`cd-layout__content ${props.pref.hideSidebar ? 'cd-layout__content--sb-collapsed' : 'cd-layout__content--sb-expanded'} custom-styles`}>
{props.children}
</div>
</div>
</div>
);
}

0 comments on commit edb9943

Please sign in to comment.