2022-08-15 17:09:26 +03:00
|
|
|
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
|
2020-05-20 22:00:33 +03:00
|
|
|
import React from 'react'
|
2021-05-13 16:15:13 +03:00
|
|
|
import styled from 'styled-components/macro'
|
2021-10-11 21:00:31 +03:00
|
|
|
import { Z_INDEX } from 'theme'
|
2020-05-20 22:00:33 +03:00
|
|
|
|
2022-08-15 17:09:26 +03:00
|
|
|
export const BodyWrapper = styled.main<{ margin?: string; maxWidth?: string; redesignFlag?: boolean }>`
|
2020-05-27 18:42:25 +03:00
|
|
|
position: relative;
|
2021-04-14 17:12:35 +03:00
|
|
|
margin-top: ${({ margin }) => margin ?? '0px'};
|
2022-08-15 17:09:26 +03:00
|
|
|
max-width: ${({ maxWidth, redesignFlag }) => maxWidth ?? (redesignFlag ? '420px' : '480px')};
|
2020-05-20 22:00:33 +03:00
|
|
|
width: 100%;
|
2022-08-15 17:09:26 +03:00
|
|
|
background: ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundSurface : theme.deprecated_bg0)};
|
|
|
|
border-radius: ${({ redesignFlag }) => (redesignFlag ? '16px' : '24px')};
|
2022-08-16 19:05:43 +03:00
|
|
|
border: 1px solid ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundOutline : 'transparent')};
|
2021-04-27 04:59:56 +03:00
|
|
|
margin-top: 1rem;
|
2021-11-05 17:29:55 +03:00
|
|
|
margin-left: auto;
|
|
|
|
margin-right: auto;
|
2021-10-11 21:00:31 +03:00
|
|
|
z-index: ${Z_INDEX.deprecated_content};
|
2022-08-15 17:09:26 +03:00
|
|
|
font-feature-settings: ${({ redesignFlag }) => redesignFlag && "'ss02' off"};
|
|
|
|
box-shadow: ${({ redesignFlag }) =>
|
|
|
|
!redesignFlag &&
|
2022-08-10 22:03:30 +03:00
|
|
|
'0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 24px 32px rgba(0, 0, 0, 0.01)'};
|
2020-05-20 22:00:33 +03:00
|
|
|
`
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The styled container element that wraps the content of most pages and the tabs.
|
|
|
|
*/
|
2021-04-14 17:12:35 +03:00
|
|
|
export default function AppBody({ children, ...rest }: { children: React.ReactNode }) {
|
2022-08-15 17:09:26 +03:00
|
|
|
const redesignFlag = useRedesignFlag()
|
|
|
|
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
|
2022-08-10 22:03:30 +03:00
|
|
|
return (
|
2022-08-15 17:09:26 +03:00
|
|
|
<BodyWrapper {...rest} redesignFlag={redesignFlagEnabled}>
|
2022-08-10 22:03:30 +03:00
|
|
|
{children}
|
|
|
|
</BodyWrapper>
|
|
|
|
)
|
2020-05-20 22:00:33 +03:00
|
|
|
}
|