-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
769b458
commit 92de8a5
Showing
6 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 27 additions & 2 deletions
29
src/app/features/container/containers/page/page.layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,39 @@ | ||
import { SettingsSelectors } from '@tests/selectors/settings.selectors'; | ||
|
||
import { HamburgerIcon } from '@leather.io/ui'; | ||
|
||
import { Settings } from '../../../settings/settings'; | ||
import { ContainerLayout } from '../container.layout'; | ||
import { PageProvider } from './page.context'; | ||
import { PageHeader } from './page.header'; | ||
|
||
interface PageLayoutProps { | ||
children?: React.JSX.Element | React.JSX.Element[]; | ||
isShowingSwitchAccount?: boolean; | ||
setIsShowingSwitchAccount?(isShowingSwitchAccount: boolean): void; | ||
} | ||
export function PageLayout({ children }: PageLayoutProps) { | ||
export function PageLayout({ | ||
children, | ||
isShowingSwitchAccount, | ||
setIsShowingSwitchAccount, | ||
}: PageLayoutProps) { | ||
return ( | ||
<PageProvider> | ||
<ContainerLayout header={<PageHeader />} content={children} /> | ||
<ContainerLayout | ||
header={ | ||
<PageHeader | ||
settingsMenu={ | ||
setIsShowingSwitchAccount && ( | ||
<Settings | ||
triggerButton={<HamburgerIcon data-testid={SettingsSelectors.SettingsMenuBtn} />} | ||
toggleSwitchAccount={() => setIsShowingSwitchAccount(!isShowingSwitchAccount)} | ||
/> | ||
) | ||
} | ||
/> | ||
} | ||
content={children} | ||
/> | ||
</PageProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters