Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add loading icons to buttons #2828

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading