Skip to content

Commit

Permalink
fix: Add loading icons to buttons (#2828)
Browse files Browse the repository at this point in the history
* fix:Add loading icons to buttons

* commit with siganture

* commit with siganture 2nd attempt
  • Loading branch information
francovenica authored Nov 21, 2023
1 parent edc627a commit 985ccd7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 38 deletions.
12 changes: 9 additions & 3 deletions src/components/tx-flow/flows/ExecuteBatch/ReviewBatch.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Typography, Button, CardActions, Divider, Alert } from '@mui/material'
import { CircularProgress, Typography, Button, CardActions, Divider, Alert } from '@mui/material'
import useAsync from '@/hooks/useAsync'
import { FEATURES } from '@safe-global/safe-gateway-typescript-sdk'
import type { TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk'
Expand Down Expand Up @@ -194,8 +194,14 @@ export const ReviewBatch = ({ params }: { params: ExecuteBatchFlowProps }) => {
<CardActions>
<CheckWallet allowNonOwner={true}>
{(isOk) => (
<Button variant="contained" type="submit" disabled={!isOk || submitDisabled} onClick={handleSubmit}>
Submit
<Button
variant="contained"
type="submit"
disabled={!isOk || submitDisabled}
onClick={handleSubmit}
sx={{ minWidth: '114px' }}
>
{!isSubmittable ? <CircularProgress size={20} /> : 'Submit'}
</Button>
)}
</CheckWallet>
Expand Down
6 changes: 3 additions & 3 deletions src/components/tx/SignOrExecuteForm/ExecuteForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ReactElement, type SyntheticEvent, useContext, useState } from 'react'
import { Box, Button, CardActions, Divider } from '@mui/material'
import { CircularProgress, Box, Button, CardActions, Divider } from '@mui/material'
import classNames from 'classnames'

import ErrorMessage from '@/components/tx/ErrorMessage'
Expand Down Expand Up @@ -156,8 +156,8 @@ const ExecuteForm = ({
{/* Submit button */}
<CheckWallet allowNonOwner={onlyExecute}>
{(isOk) => (
<Button variant="contained" type="submit" disabled={!isOk || submitDisabled}>
Execute
<Button variant="contained" type="submit" disabled={!isOk || submitDisabled} sx={{ minWidth: '112px' }}>
{!isSubmittable ? <CircularProgress size={20} /> : 'Execute'}
</Button>
)}
</CheckWallet>
Expand Down
12 changes: 9 additions & 3 deletions src/components/tx/SignOrExecuteForm/SignForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type ReactElement, type SyntheticEvent, useContext, useState } from 'react'
import { Box, Button, CardActions, Divider } from '@mui/material'
import { CircularProgress, Box, Button, CardActions, Divider } from '@mui/material'

import ErrorMessage from '@/components/tx/ErrorMessage'
import { trackError, Errors } from '@/services/exceptions'
Expand Down Expand Up @@ -103,8 +103,14 @@ const SignForm = ({
{/* Submit button */}
<CheckWallet>
{(isOk) => (
<Button data-testid="sign-btn" variant="contained" type="submit" disabled={!isOk || submitDisabled}>
Sign
<Button
data-testid="sign-btn"
variant="contained"
type="submit"
disabled={!isOk || submitDisabled}
sx={{ minWidth: '82px' }}
>
{!isSubmittable ? <CircularProgress size={20} /> : 'Sign'}
</Button>
)}
</CheckWallet>
Expand Down
29 changes: 0 additions & 29 deletions src/components/tx/SignOrExecuteForm/SubmitButton.tsx

This file was deleted.

0 comments on commit 985ccd7

Please sign in to comment.