Skip to content

Commit

Permalink
fix: scroll area
Browse files Browse the repository at this point in the history
- scrollable element 100% viewport width
- main content should have minimal 100% height of parent
  • Loading branch information
Hornebom committed Jul 28, 2023
1 parent 1eb1bf8 commit 0b9da6d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
36 changes: 19 additions & 17 deletions centrifuge-app/src/components/LayoutBase/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { SidePanelProps } from '../SidePanel'
import {
FooterContainer,
HeaderBackground,
Inner,
LogoContainer,
MainContainer,
Root,
Expand All @@ -25,28 +26,29 @@ const PADDING_MAIN = [2, 2, 3, 5, 10]
export function LayoutBase({ children, sidePanel }: LayoutBaseProps) {
return (
<Root>
<HeaderBackground />
<Inner>
<HeaderBackground />

<LogoContainer>
<LogoLink />
</LogoContainer>
<LogoContainer>
<LogoLink />
</LogoContainer>

<WalletContainer pr={PADDING_MAIN}>
<WalletMenu menuItems={[<OnboardingStatus />]} />
</WalletContainer>
<WalletContainer pr={PADDING_MAIN}>
<WalletMenu menuItems={[<OnboardingStatus />]} />
</WalletContainer>

<ToolbarContainer as="aside">
<Menu />
</ToolbarContainer>
<ToolbarContainer as="aside">
<Menu />
</ToolbarContainer>

<MainContainer as="main" px={PADDING_MAIN} pt={[2, 3, 7, 10]} pb={4}>
{children}
</MainContainer>

<FooterContainer>
<Footer />
</FooterContainer>
<MainContainer as="main" px={PADDING_MAIN} pt={[2, 3, 7, 10]} pb={4}>
{children}
</MainContainer>

<FooterContainer>
<Footer />
</FooterContainer>
</Inner>
{sidePanel}
</Root>
)
Expand Down
8 changes: 6 additions & 2 deletions centrifuge-app/src/components/LayoutBase/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ const BREAK_POINT_COLUMNS = 'M'
// breakpoint from minimal to extended left sidebar width
const BREAK_POINT_SIDEBAR_EXTENDED = 'L'

export const Root = styled(Grid)`
export const Root = styled(Box)`
position: relative;
min-height: 100vh;
max-width: ${LAYOUT_MAX_WIDTH}px;
@supports (min-height: 100dvh) {
min-height: 100dvh;
Expand All @@ -29,6 +28,11 @@ export const Root = styled(Grid)`
height: 100dvh;
}
}
`

export const Inner = styled(Grid)`
max-width: ${LAYOUT_MAX_WIDTH}px;
min-height: 100%;
align-items: start;
grid-template-rows: 0px ${HEADER_HEIGHT}px 1fr auto ${TOOLBAR_HEIGHT}px;
Expand Down

0 comments on commit 0b9da6d

Please sign in to comment.