Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix issues with alignment of page headers #5801

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all 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: 1 addition & 1 deletion src/app/components/layout/headers/header-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function HeaderGrid({ leftCol, centerCol, rightCol, ...props }: HeaderGri
return (
<Grid
alignItems="center"
gridTemplateColumns={centerCol ? '2fr 4fr 2fr' : 'auto 4fr auto'}
gridTemplateColumns={centerCol ? '2fr 4fr 2fr' : 'auto auto'}
gridAutoFlow="column"
width="100%"
{...props}
Expand Down
8 changes: 7 additions & 1 deletion src/app/components/layout/layouts/content.layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import type { HasChildren } from '@app/common/has-children';

export function Content({ children }: HasChildren) {
return (
<Flex className="main-content" flexGrow={1} position="relative" width="100%">
<Flex
className="main-content"
flexGrow={1}
position="relative"
width="100%"
maxWidth="fullPageMaxWidth"
>
{children}
</Flex>
);
Expand Down
1 change: 0 additions & 1 deletion src/app/components/layout/layouts/two-column.layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export function TwoColumnLayout({
mx={{ base: 'auto', md: 'space.03', lg: 'space.06' }}
gap="space.05"
width={{ base: '100vw', md: 'unset' }}
maxWidth="fullPageMaxWidth"
>
<Flex flexDirection="column" gap="space.04">
<Stack gap="space.04">
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/container/headers/home.header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function HomeHeader() {
useOutletContext<SwitchAccountOutletContext>();

return (
<Header paddingLeft={{ base: undefined, sm: 0 }}>
<Header>
<HeaderGrid
leftCol={<LogoBox hideBelow={undefined} />}
rightCol={
Expand Down
72 changes: 34 additions & 38 deletions src/app/features/container/headers/page.header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,44 +38,40 @@ export function PageHeader({
const canGoBack = !isSummaryPage;

return (
<>
<Header>
<HeaderGrid
leftCol={
<>
{canGoBack && (
<HeaderActionButton
icon={<ArrowLeftIcon />}
onAction={onGoBack}
dataTestId={SharedComponentsSelectors.HeaderBackBtn}
<Header>
<HeaderGrid
leftCol={
<>
{canGoBack && (
<HeaderActionButton
icon={<ArrowLeftIcon />}
onAction={onGoBack}
dataTestId={SharedComponentsSelectors.HeaderBackBtn}
/>
)}
<LogoBox onClick={() => navigate(RouteUrls.Home)} />
</>
}
centerCol={title && <styled.span textStyle="heading.05">{title}</styled.span>}
rightCol={
<HeaderGridRightCol>
{isSummaryPage ? (
<HeaderActionButton
icon={<CloseIcon />}
dataTestId={SharedComponentsSelectors.HeaderCloseBtn}
onAction={() => navigate(RouteUrls.Home)}
/>
) : (
<styled.div hideBelow={isSettingsVisibleOnSm ? undefined : 'sm'}>
<Settings
triggerButton={<HamburgerIcon data-testid={SettingsSelectors.SettingsMenuBtn} />}
toggleSwitchAccount={() => setIsShowingSwitchAccount(!isShowingSwitchAccount)}
/>
)}
<LogoBox onClick={() => navigate(RouteUrls.Home)} />
</>
}
centerCol={title && <styled.span textStyle="heading.05">{title}</styled.span>}
rightCol={
<HeaderGridRightCol>
{isSummaryPage ? (
<HeaderActionButton
icon={<CloseIcon />}
dataTestId={SharedComponentsSelectors.HeaderCloseBtn}
onAction={() => navigate(RouteUrls.Home)}
/>
) : (
<styled.div hideBelow={isSettingsVisibleOnSm ? undefined : 'sm'}>
<Settings
triggerButton={
<HamburgerIcon data-testid={SettingsSelectors.SettingsMenuBtn} />
}
toggleSwitchAccount={() => setIsShowingSwitchAccount(!isShowingSwitchAccount)}
/>
</styled.div>
)}
</HeaderGridRightCol>
}
/>
</Header>
</>
</styled.div>
)}
</HeaderGridRightCol>
}
/>
</Header>
);
}
2 changes: 1 addition & 1 deletion src/app/features/container/headers/unlock.header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function UnlockHeader() {
const navigate = useNavigate();

return (
<Header paddingLeft={{ base: undefined, sm: 0 }}>
<Header>
<HeaderGrid
leftCol={
<LogoBox onClick={() => navigate(RouteUrls.Home)} hideBelow={undefined} hideFrom="sm" />
Expand Down
1 change: 0 additions & 1 deletion src/app/pages/fund/components/fund.layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export function FundLayout({ blockchain, symbol, children }: FundLayoutProps) {
alignItems={{ base: 'left', md: 'center' }}
p={{ base: 'space.05', md: 'unset' }}
gap={{ base: 'space.04', md: 'space.05' }}
maxWidth="fullPageMaxWidth"
>
<styled.h1
textAlign={{ base: 'left', md: 'center' }}
Expand Down
1 change: 0 additions & 1 deletion src/app/pages/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export function Home() {
return (
<Stack
data-testid={HomePageSelectors.HomePageContainer}
maxWidth={{ base: 'unset', md: 'fullPageMaxWidth' }}
px={{ base: 0, md: 'space.05' }}
py={{ base: 0, md: 'space.07' }}
gap={{ base: 0, md: 'space.06' }}
Expand Down
Loading