Skip to content

Commit

Permalink
style: fix header indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Feb 7, 2022
1 parent 0cb42c1 commit 5c4b833
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
12 changes: 7 additions & 5 deletions packages/widget/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ const HeaderAppBar = styled(AppBar)(({ theme }) => ({
backgroundColor: theme.palette.common.black,
}));

const HeaderToolbar = styled(Toolbar)({
const HeaderToolbar = styled(Toolbar, {
shouldForwardProp: (prop) => prop !== 'height',
})<{ height?: number }>(({ height }) => ({
'@media all': {
minHeight: 48,
minHeight: height ?? 52,
},
});
}));

export const Header: React.FC = ({ children }) => (
export const Header: React.FC<{ height?: number }> = ({ children, height }) => (
<HeaderAppBar position="relative" elevation={0}>
<HeaderToolbar>{children}</HeaderToolbar>
<HeaderToolbar height={height}>{children}</HeaderToolbar>
</HeaderAppBar>
);
2 changes: 1 addition & 1 deletion packages/widget/src/components/NavigationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const NavigationHeader: React.FC = () => {
<ArrowBackIcon />
</IconButton>
</Collapse>
<Typography variant="h6" noWrap sx={{ flexGrow: 1 }}>
<Typography variant="h5" noWrap sx={{ flexGrow: 1, fontWeight: 'bold' }}>
{handleHeaderTitle()}
</Typography>
{location.pathname === '/' && (
Expand Down
3 changes: 2 additions & 1 deletion packages/widget/src/components/WalletHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import { Header } from './Header';
export const WalletHeader: React.FC = () => {
const { t } = useTranslation();
return (
<Header>
<Header height={40}>
<Typography
variant="body2"
noWrap
align="right"
sx={{ flexGrow: 1 }}
color="grey.500"
mt={2}
>
{t(`swap.header.walletConnected`, { walletAddress: '0000000000' })}
</Typography>
Expand Down

0 comments on commit 5c4b833

Please sign in to comment.