Skip to content

Commit d7e7e8c

Browse files
committed
frontend: fix inconsistent paddings in accounts page
1 parent 18c6cac commit d7e7e8c

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

frontends/web/src/components/layout/header.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ type Props = {
1111
title?: string | JSX.Element | JSX.Element[];
1212
hideSidebarToggler?: boolean;
1313
children?: ReactNode;
14+
width?: string;
1415
};
1516

1617
export const Header = ({
1718
title,
1819
hideSidebarToggler,
1920
children,
21+
width,
2022
}: Props) => {
2123
const { t } = useTranslation();
2224

@@ -30,9 +32,13 @@ export const Header = ({
3032
return false;
3133
};
3234

35+
const inlineStyles = {
36+
...(width && { width, maxWidth: '100%' }),
37+
};
38+
3339
return (
3440
<div className={style.container}>
35-
<div className={style.header}>
41+
<div className={style.header} style={inlineStyles}>
3642
<div
3743
className={`
3844
hide-on-small

frontends/web/src/routes/accounts/all-accounts.module.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
max-width: 60%;
6262
overflow: hidden;
6363
overflow: clip;
64-
padding-right: var(--space-quarter);
6564
text-align: right;
6665
}
6766

@@ -72,9 +71,7 @@
7271
.chevron {
7372
color: var(--color-mediumgray);
7473
flex-shrink: 0;
75-
margin-right: 0;
76-
position: absolute;
77-
right: var(--space-eight);
74+
margin-right: -4px;
7875
}
7976

8077
.chevron img {

frontends/web/src/routes/accounts/all-accounts.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,17 @@ const AccountItem = ({ account }: TAccountItemProp) => {
7373
* This component will only be shown on mobile.
7474
**/
7575
export const AllAccounts = ({ accounts = [] }: AllAccountsProps) => {
76+
const containerWidth = '700px';
7677
const { t } = useTranslation();
7778
const accountsByKeystore = getAccountsByKeystore(accounts);
7879
useOnlyVisitableOnMobile('/settings/manage-accounts');
7980

8081
return (
8182
<Main>
82-
<Header title={<h2>{t('account.accounts')}</h2>}>
83+
<Header width={containerWidth} title={<h2>{t('account.accounts')}</h2>}>
8384
<HideAmountsButton />
8485
</Header>
85-
<View width="700px" fullscreen={false}>
86+
<View width={containerWidth} fullscreen={false}>
8687
<ViewContent>
8788
<div className={styles.container}>
8889
{accountsByKeystore.map(keystore => (

0 commit comments

Comments
 (0)