Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions content/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ export const stakingTheme: Partial<ChakraTheme> = {
body: {
bg: 'navy.900',
color: 'white',
backgroundImage: `repeating-linear-gradient(135deg, ${chakraTheme.colors.gray['900']} 0, ${chakraTheme.colors.navy['900']} 1px, transparent 0, transparent 50%)`,
backgroundSize: '12px 12px',
},
'::-webkit-scrollbar': {
width: '8px',
Expand Down
16 changes: 11 additions & 5 deletions sections/shared/Layout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,25 @@ const AppLayout: FC<AppLayoutProps> = ({ children }) => {
<Header />
</>
)}
<Content>{children}</Content>
<Content stakingV2Enabled={STAKING_V2_ENABLED}>{children}</Content>
<NotificationContainer />
</>
);
};

const Content = styled.div`
interface ContentProps {
readonly stakingV2Enabled: boolean;
}

const Content = styled.div<ContentProps>`
max-width: 1200px;
margin: 0 auto;

${media.greaterThan('mdUp')`
padding-left: calc(${DESKTOP_SIDE_NAV_WIDTH + DESKTOP_BODY_PADDING}px);
`}
${({ stakingV2Enabled }) => media.greaterThan('mdUp')`
padding-left: ${
stakingV2Enabled ? '0px' : `calc(${DESKTOP_SIDE_NAV_WIDTH + DESKTOP_BODY_PADDING}px)`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use const STAKING_V2_ENABLED directly here?
If we only use const as is everywhere it will be easy to find and remove it later, comparing to cleaning up extra custom props.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the perspective of searching for it? Makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant if this env var is globally available we don't need custom props at all.
this is def a nice improvement for easy search for sure!

};
`};
`;

export default AppLayout;