Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #567 from hermeznetwork/fix-page-header
Browse files Browse the repository at this point in the history
Fix page header
  • Loading branch information
elias-garcia authored Jun 30, 2021
2 parents 34de8fb + 6f423b1 commit 4867ca9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/styles/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const theme = {
upSm: '@media (min-width: 576px)'
},
spacing: (value) => value * 8,
headerHeight: 80,
headerHeight: 84,
sidenavWidth: 295
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/my-account/my-account.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useMyAccountStyles = createUseStyles(theme => ({
fontSize: theme.spacing(2.5),
fontWeight: theme.fontWeights.medium,
textAlign: 'center',
marginTop: theme.spacing(2),
marginTop: theme.spacing(3.5),
marginBottom: theme.spacing(2.5)
},
topSection: {
Expand Down
18 changes: 10 additions & 8 deletions src/views/shared/page-header/page-header.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ const usePageHeaderStyles = createUseStyles(theme => ({
position: 'absolute',
height: theme.headerHeight,
display: 'flex',
alignItems: 'center',
alignItems: 'flex-end',
zIndex: 998,
background: 'transparent'
},
headerContent: {
headerWrapper: {
width: '100%',
display: 'flex',
flexDirection: 'column',
alignItems: 'center'
},
titleWrapper: {
width: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
position: 'relative',
marginTop: theme.spacing(3)
position: 'relative'
},
buttonBase: {
position: 'absolute',
Expand All @@ -37,9 +42,6 @@ const usePageHeaderStyles = createUseStyles(theme => ({
right: 0,
marginRight: -(theme.spacing(2))
},
titleWrapper: {
textAlign: 'center'
},
title: {
fontSize: theme.spacing(3),
fontWeight: theme.fontWeights.extraBold
Expand All @@ -48,7 +50,7 @@ const usePageHeaderStyles = createUseStyles(theme => ({
fontSize: theme.spacing(2),
fontWeight: theme.fontWeights.medium,
color: theme.palette.grey.dark,
paddingTop: theme.spacing(1.5),
paddingTop: theme.spacing(1.25),
margin: 0
}
}))
Expand Down
48 changes: 24 additions & 24 deletions src/views/shared/page-header/page-header.view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,33 @@ function PageHeader ({
return (
<header className={classes.root}>
<Container disableVerticalGutters>
<div className={classes.headerContent}>
{goBackAction && (
<button
className={clsx({
[classes.buttonBase]: true,
[classes.goBackButton]: true
})}
onClick={() => onGoBack(goBackAction)}
>
<ArrowBackIcon />
</button>
)}
<div className={classes.headerWrapper}>
<div className={classes.titleWrapper}>
{goBackAction && (
<button
className={clsx({
[classes.buttonBase]: true,
[classes.goBackButton]: true
})}
onClick={() => onGoBack(goBackAction)}
>
<ArrowBackIcon />
</button>
)}
<h1 className={classes.title}>{title || ''}</h1>
{subtitle && <h4 className={classes.subtitle}>{subtitle}</h4>}
{closeAction && (
<button
className={clsx({
[classes.buttonBase]: true,
[classes.closeButton]: true
})}
onClick={() => onClose(closeAction)}
>
<CloseIcon />
</button>
)}
</div>
{closeAction && (
<button
className={clsx({
[classes.buttonBase]: true,
[classes.closeButton]: true
})}
onClick={() => onClose(closeAction)}
>
<CloseIcon />
</button>
)}
{subtitle && <h4 className={classes.subtitle}>{subtitle}</h4>}
</div>
</Container>
</header>
Expand Down

0 comments on commit 4867ca9

Please sign in to comment.