Skip to content

Commit

Permalink
feat: add chain indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Jul 6, 2023
1 parent 58291de commit 4005c67
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
13 changes: 9 additions & 4 deletions src/components/tx-flow/common/TxLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { TxSimulationMessage } from '@/components/tx/security/tenderly'
import SafeLogo from '@/public/images/logo-no-text.svg'
import { RedefineMessage } from '@/components/tx/security/redefine'
import { TxSecurityProvider } from '@/components/tx/security/shared/TxSecurityContext'
import ChainIndicator from '@/components/common/ChainIndicator'

type TxLayoutProps = {
title: ReactNode
Expand Down Expand Up @@ -59,10 +60,14 @@ const TxLayout = ({
<TxSecurityProvider>
<Container className={css.container}>
<Grid container alignItems="center" justifyContent="center">
<Grid item xs={12}>
<Typography variant="h3" component="div" fontWeight="700" mb={2} className={css.title}>
{title}
</Typography>
<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"
Expand Down
16 changes: 14 additions & 2 deletions src/components/tx-flow/common/TxLayout/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@
margin-top: var(--space-2);
}

.titleWrapper {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: var(--space-2);
}

@media (max-width: 899.95px) {
.widget {
position: absolute;
Expand All @@ -109,11 +116,16 @@
height: 100%;
}

.title {
font-size: 16px;
.titleWrapper {
position: absolute;
top: 12px;
left: var(--space-3);
margin-bottom: 0;
width: calc(100% - 154px);
}

.title {
font-size: 16px;
}

.container {
Expand Down
5 changes: 4 additions & 1 deletion src/components/tx-flow/flows/NewTx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import AssetsIcon from '@/public/images/sidebar/assets.svg'
import LoadingSpinner, { SpinnerStatus } from '@/components/new-safe/create/steps/StatusStep/LoadingSpinner'
import { useTxBuilderApp } from '@/hooks/safe-apps/useTxBuilderApp'
import { ProgressBar } from '@/components/common/ProgressBar'
import ChainIndicator from '@/components/common/ChainIndicator'

import css from './styles.module.css'

Expand All @@ -26,7 +27,9 @@ const NewTxMenu = () => {
<Container className={css.container}>
<Grid container>
{/* Alignment of `TxLayout` */}
<Grid item xs={12} md={11}>
<Grid item xs={12} md={11} display="flex" flexDirection="column">
<ChainIndicator inline className={css.chain} />

<Grid container component={Paper}>
<Grid item xs={12} className={css.progressBar}>
<ProgressBar value={progress} />
Expand Down
14 changes: 13 additions & 1 deletion src/components/tx-flow/flows/NewTx/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.container {
margin-top: 110px;
margin-top: 72px;
}

.chain {
align-self: flex-end;
margin-bottom: var(--space-2);
}

.pane {
Expand Down Expand Up @@ -37,6 +42,13 @@
border-radius: unset;
}

.chain {
position: absolute;
top: 0;
right: 57px;
margin: var(--space-2);
}

.progressBar {
display: none;
}
Expand Down

0 comments on commit 4005c67

Please sign in to comment.