Skip to content

Commit

Permalink
🚸 modals: allow close while waiting
Browse files Browse the repository at this point in the history
  • Loading branch information
cruzdanilo committed Oct 26, 2023
1 parent 215023a commit 346b12a
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 88 deletions.
28 changes: 13 additions & 15 deletions components/DebtManager/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,19 @@ function DebtManagerModal({ isOpen, close }: Props) {
disableEscapeKeyDown={loadingTx}
data-testid="rollover-modal"
>
{!loadingTx && (
<IconButton
data-testid="rollover-modal-close"
aria-label="close"
onClick={close}
sx={{
position: 'absolute',
right: 4,
top: 8,
color: 'grey.500',
}}
>
<CloseIcon sx={{ fontSize: 19 }} />
</IconButton>
)}
<IconButton
data-testid="rollover-modal-close"
aria-label="close"
onClick={close}
sx={{
position: 'absolute',
right: 4,
top: 8,
color: 'grey.500',
}}
>
<CloseIcon sx={{ fontSize: 19 }} />
</IconButton>
<Box
sx={{
padding: { xs: spacing(3, 2, 2), sm: spacing(5, 4, 4) },
Expand Down
28 changes: 13 additions & 15 deletions components/Leverager/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,19 @@ function LeveragerModal({ isOpen, close }: Props) {
sx={isMobile ? { top: 'auto' } : { backdropFilter: tx ? 'blur(1.5px)' : '' }}
disableEscapeKeyDown={loadingTx}
>
{!loadingTx && (
<IconButton
aria-label="close"
onClick={close}
sx={{
position: 'absolute',
right: 4,
top: 8,
color: 'grey.500',
}}
data-testid="leverage-modal-close"
>
<CloseIcon sx={{ fontSize: 19 }} />
</IconButton>
)}
<IconButton
aria-label="close"
onClick={close}
sx={{
position: 'absolute',
right: 4,
top: 8,
color: 'grey.500',
}}
data-testid="leverage-modal-close"
>
<CloseIcon sx={{ fontSize: 19 }} />
</IconButton>
<Box
sx={{
padding: { xs: spacing(3, 2, 2), sm: spacing(5, 4, 4) },
Expand Down
28 changes: 13 additions & 15 deletions components/OperationsModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,19 @@ function OperationsModal({ isOpen, close }: Props) {
disableEscapeKeyDown={loadingTx}
data-testid="modal"
>
{!loadingTx && (
<IconButton
aria-label="close"
onClick={close}
sx={{
position: 'absolute',
right: 4,
top: 8,
color: 'grey.500',
}}
data-testid="modal-close"
>
<CloseIcon sx={{ fontSize: 19 }} />
</IconButton>
)}
<IconButton
aria-label="close"
onClick={close}
sx={{
position: 'absolute',
right: 4,
top: 8,
color: 'grey.500',
}}
data-testid="modal-close"
>
<CloseIcon sx={{ fontSize: 19 }} />
</IconButton>
<Box
sx={{
padding: { xs: spacing(3, 2, 2), sm: spacing(5, 4, 4) },
Expand Down
26 changes: 12 additions & 14 deletions components/RewardsModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,18 @@ const RewardsModal: FC<RewardsModalProps> = ({ isOpen, close }) => {
sx={isMobile ? { top: 'auto' } : { backdropFilter: tx ? 'blur(1.5px)' : '' }}
disableEscapeKeyDown={loadingTx}
>
{!loadingTx && (
<IconButton
aria-label="close"
onClick={closeAndReset}
sx={{
position: 'absolute',
right: 16,
top: 16,
color: 'grey.400',
}}
>
<CloseIcon sx={{ fontSize: 24 }} />
</IconButton>
)}
<IconButton
aria-label="close"
onClick={closeAndReset}
sx={{
position: 'absolute',
right: 16,
top: 16,
color: 'grey.400',
}}
>
<CloseIcon sx={{ fontSize: 24 }} />
</IconButton>
<Box p={4}>
{!tx && (
<DialogTitle
Expand Down
28 changes: 13 additions & 15 deletions components/VestingInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,19 @@ function LoadingModal({ tx, onClose }: { tx: Transaction; onClose: () => void })
sx={isMobile ? { top: 'auto' } : { backdropFilter: tx ? 'blur(1.5px)' : '' }}
disableEscapeKeyDown={loadingTx}
>
{!loadingTx && (
<IconButton
aria-label="close"
onClick={onClose}
sx={{
position: 'absolute',
right: 4,
top: 8,
color: 'grey.500',
}}
data-testid="vesting-vest-modal-close"
>
<CloseIcon sx={{ fontSize: 19 }} />
</IconButton>
)}
<IconButton
aria-label="close"
onClick={onClose}
sx={{
position: 'absolute',
right: 4,
top: 8,
color: 'grey.500',
}}
data-testid="vesting-vest-modal-close"
>
<CloseIcon sx={{ fontSize: 19 }} />
</IconButton>
<Box
sx={{
padding: { xs: spacing(3, 2, 2), sm: spacing(5, 4, 4) },
Expand Down
26 changes: 12 additions & 14 deletions components/markets/MarketsBasic/Loading/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,18 @@ export default function Loading({ isOpen, tx, close }: Props) {
BackdropProps={{ style: { backgroundColor: tx ? 'rgb(100, 100, 100 , 0.1)' : '' } }}
disableEscapeKeyDown={loadingTx}
>
{!loadingTx && (
<IconButton
aria-label="close"
onClick={close}
sx={{
position: 'absolute',
right: 4,
top: 8,
color: 'grey.500',
}}
>
<CloseIcon sx={{ fontSize: 19 }} />
</IconButton>
)}
<IconButton
aria-label="close"
onClick={close}
sx={{
position: 'absolute',
right: 4,
top: 8,
color: 'grey.500',
}}
>
<CloseIcon sx={{ fontSize: 19 }} />
</IconButton>
<Box
sx={{
padding: { xs: spacing(3, 2, 2), sm: spacing(5, 4, 4) },
Expand Down

1 comment on commit 346b12a

@vercel
Copy link

@vercel vercel bot commented on 346b12a Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

app – ./

exactly.app
exactly-development.vercel.app
app-git-main.exactly.app
app.exact.ly
app.exactly.app

Please sign in to comment.