Skip to content

Commit

Permalink
fix: centralise flow + reduce success screen width (#2309)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook authored Jul 26, 2023
1 parent bc8a9ba commit 841230d
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 35 deletions.
5 changes: 5 additions & 0 deletions src/components/common/TxModalDialog/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
.close {
color: var(--color-border-main);
padding: var(--space-1);
background-color: var(--color-border-light);
}

.paper {
Expand Down Expand Up @@ -76,6 +77,10 @@
background-color: var(--color-background-paper);
}

.close {
background-color: unset;
}

.close svg {
font-size: 1.5rem;
}
Expand Down
48 changes: 25 additions & 23 deletions src/components/tx-flow/common/TxLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,29 @@ const TxLayout = ({
<SafeTxProvider>
<TxInfoProvider>
<TxSecurityProvider>
<Container className={css.container}>
<Grid container alignItems="center" justifyContent="center">
<Grid item container xs={12}>
<Grid item xs={12} md={7} className={css.titleWrapper}>
<Typography variant="h3" component="div" fontWeight="700" className={css.title}>
{title}
</Typography>

<ChainIndicator inline />
</Grid>
<IconButton
className={css.statusButton}
aria-label="Transaction status"
size="large"
onClick={toggleStatus}
>
<SafeLogo width={16} height={16} />
</IconButton>
</Grid>

<Grid item container xs={12} gap={3}>
<>
{/* Header status button */}
<IconButton
className={css.statusButton}
aria-label="Transaction status"
size="large"
onClick={toggleStatus}
>
<SafeLogo width={16} height={16} />
</IconButton>

<Container className={css.container}>
<Grid container gap={3} justifyContent="center">
{/* Main content */}
<Grid item xs={12} md={7}>
<div className={css.titleWrapper}>
<Typography variant="h3" component="div" fontWeight="700" className={css.title}>
{title}
</Typography>

<ChainIndicator inline />
</div>

<Paper className={css.header}>
<Box className={css.progressBar}>
<ProgressBar value={progress} />
Expand All @@ -133,6 +134,7 @@ const TxLayout = ({
</div>
</Grid>

{/* Sidebar */}
<Grid item xs={12} md={4} className={classnames(css.widget, { [css.active]: statusVisible })}>
{statusVisible && (
<TxStatusWidget
Expand All @@ -151,8 +153,8 @@ const TxLayout = ({
</Box>
</Grid>
</Grid>
</Grid>
</Container>
</Container>
</>
</TxSecurityProvider>
</TxInfoProvider>
</SafeTxProvider>
Expand Down
9 changes: 8 additions & 1 deletion src/components/tx-flow/common/TxLayout/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: var(--space-3);
/* Remove height of progress bar */
padding: calc(var(--space-3) - 6px) var(--space-3) var(--space-3);
border-bottom: 1px solid var(--color-border-light);
}

Expand Down Expand Up @@ -103,6 +104,11 @@
margin-bottom: var(--space-2);
}

.widget {
/* Height of transaction type title */
margin-top: 46px;
}

@media (max-width: 899.95px) {
.widget {
position: absolute;
Expand All @@ -111,6 +117,7 @@
width: 100%;
height: 100%;
z-index: -1;
margin-top: unset;
}

.widget.active {
Expand Down
4 changes: 2 additions & 2 deletions src/components/tx-flow/common/TxStatusWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ const TxStatusWidget = ({
return (
<Paper>
<div className={css.header}>
<SafeLogo width={32} height={32} className={css.logo} />
<Typography variant="h6" fontWeight="700" className={css.title}>
<Typography fontWeight="700" display="flex" alignItems="center" gap={1}>
<SafeLogo width={16} height={16} className={css.logo} />
Transaction status
</Typography>
<IconButton className={css.close} aria-label="close" onClick={handleClose} size="small">
Expand Down
13 changes: 6 additions & 7 deletions src/components/tx-flow/common/TxStatusWidget/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
.header {
padding: var(--space-3);
padding: var(--space-4) var(--space-3);
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1);
}

.content {
padding: var(--space-3);
padding: var(--space-2);
}

.status {
Expand Down Expand Up @@ -83,11 +82,11 @@
margin-left: 16px;
}

.title {
font-size: 16px;
}

.close {
display: flex;
}

.content {
padding: var(--space-3);
}
}
2 changes: 1 addition & 1 deletion src/components/tx-flow/flows/NewTx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const NewTxMenu = () => {

return (
<Container className={css.container}>
<Grid container>
<Grid container justifyContent="center">
{/* Alignment of `TxLayout` */}
<Grid item xs={12} md={11} display="flex" flexDirection="column">
<ChainIndicator inline className={css.chain} />
Expand Down
3 changes: 2 additions & 1 deletion src/components/tx-flow/flows/SuccessScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ export const SuccessScreen = ({ txId }: { txId: string }) => {
disableGutters
sx={{
textAlign: 'center',
maxWidth: `${900 - 75}px`, // md={11}
}}
maxWidth="md"
maxWidth={false}
>
<div className={css.row}>
<StatusMessage status={status} error={error} />
Expand Down

0 comments on commit 841230d

Please sign in to comment.