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

Change network confirmation #212

Merged
merged 4 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
34 changes: 24 additions & 10 deletions src/view/components/ConfirmationDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ import {
DialogTitle,
DialogContent,
DialogActions,
Button
Button,
Typography,
Box
} from '@mui/material'

const style = {
backgroundColor: 'background.paper'
}

interface ConfirmationDialogProps {
open: boolean
onClose: () => void
onConfirm: () => void
message?: string
}

const TEXT_CONFIRM = 'Be sure you want to perform this action?'
const TEXT_CONFIRM = 'Are you sure you want to change the network?'
alongoni marked this conversation as resolved.
Show resolved Hide resolved

function ConfirmationDialog({
open,
Expand All @@ -24,14 +30,22 @@ function ConfirmationDialog({
}: ConfirmationDialogProps) {
return (
<Dialog open={open} onClose={onClose}>
<DialogTitle>Confirm Action</DialogTitle>
<DialogContent>
<p>{message}</p>
</DialogContent>
<DialogActions>
<Button onClick={onClose}>Cancel</Button>
<Button onClick={onConfirm}>Confirm</Button>
</DialogActions>
<Box sx={style}>
<DialogTitle>
<Typography variant="h5" color="white">
Change Network confirmation
</Typography>
</DialogTitle>
<DialogContent>
<Typography variant="body1" color="white">
{message}
</Typography>
</DialogContent>
<DialogActions>
<Button onClick={onClose}>Cancel</Button>
<Button onClick={onConfirm}>Confirm</Button>
</DialogActions>
</Box>
</Dialog>
)
}
Expand Down
1 change: 0 additions & 1 deletion src/view/components/WalletConnectButton/NetworkSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ export function NetworkSelect({
onClose={closeModal}
onConfirm={() => {
closeModal()
router.replace(ROUTES.HOME)
onChange(newChainId)
}}
/>
Expand Down
Loading