-
Notifications
You must be signed in to change notification settings - Fork 25
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
082ac6c
commit f962865
Showing
10 changed files
with
230 additions
and
83 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
26 changes: 18 additions & 8 deletions
26
packages/libs/kode-ui/src/patterns/SideBarLayout/InnerLayout.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,23 +1,33 @@ | ||
import classNames from 'classnames'; | ||
import type { FC, PropsWithChildren } from 'react'; | ||
import type { FC, PropsWithChildren, ReactElement } from 'react'; | ||
import React from 'react'; | ||
import { Stack } from './../../components'; | ||
import { SideBarHeader } from './components/SideBarHeader'; | ||
import { useSideBar } from './components/SideBarProvider'; | ||
import { layoutExpandedWrapperClass, layoutWrapperClass } from './styles.css'; | ||
|
||
export interface ISideBarLayout extends PropsWithChildren {} | ||
export const Innerlayout: FC<ISideBarLayout> = ({ children }) => { | ||
export interface ISideBarLayout extends PropsWithChildren { | ||
topBanner?: ReactElement; | ||
} | ||
export const Innerlayout: FC<ISideBarLayout> = ({ children, topBanner }) => { | ||
const { isExpanded } = useSideBar(); | ||
|
||
return ( | ||
<Stack | ||
className={classNames(layoutWrapperClass, { | ||
[layoutExpandedWrapperClass]: isExpanded, | ||
})} | ||
width="100%" | ||
flexDirection="column" | ||
position="relative" | ||
style={{ minHeight: '100dvh' }} | ||
> | ||
<SideBarHeader /> | ||
{children} | ||
{topBanner} | ||
<Stack | ||
className={classNames(layoutWrapperClass, { | ||
[layoutExpandedWrapperClass]: isExpanded, | ||
})} | ||
> | ||
<SideBarHeader /> | ||
{children} | ||
</Stack> | ||
</Stack> | ||
); | ||
}; |
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
17 changes: 11 additions & 6 deletions
17
packages/libs/kode-ui/src/patterns/SideBarLayout/SideBarLayout.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,13 +1,18 @@ | ||
import type { FC, PropsWithChildren } from 'react'; | ||
import type { FC, PropsWithChildren, ReactElement } from 'react'; | ||
import React from 'react'; | ||
import { MediaContextProvider } from './../../components'; | ||
import { Innerlayout } from './InnerLayout'; | ||
import { SideBarProvider } from './components/SideBarProvider'; | ||
|
||
export interface ISideBarLayout extends PropsWithChildren {} | ||
export const SideBarLayout: FC<ISideBarLayout> = ({ children }) => { | ||
export interface ISideBarLayout extends PropsWithChildren { | ||
topBanner?: ReactElement; | ||
} | ||
export const SideBarLayout: FC<ISideBarLayout> = ({ children, topBanner }) => { | ||
return ( | ||
<SideBarProvider> | ||
<Innerlayout>{children}</Innerlayout> | ||
</SideBarProvider> | ||
<MediaContextProvider> | ||
<SideBarProvider> | ||
<Innerlayout topBanner={topBanner}>{children}</Innerlayout> | ||
</SideBarProvider> | ||
</MediaContextProvider> | ||
); | ||
}; |
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
Oops, something went wrong.