Skip to content

Commit

Permalink
change delete wallet button to red, add confirm alert
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-zwets committed May 24, 2024
1 parent 29572dc commit b90cf1a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Wallets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ const WalletInfo: React.FC<Props> = ({network, setShowWallets, wallets, setWall
}

function removeWallet(index:number) {
const confirmDelete = confirm("Sure you want to permanently remove this wallet?")
if(!confirmDelete) return
const walletsCopy = [...wallets]
walletsCopy.splice(index, 1)
setWallets(walletsCopy)
Expand Down Expand Up @@ -121,7 +123,7 @@ const WalletInfo: React.FC<Props> = ({network, setShowWallets, wallets, setWall

const walletList = wallets.map((wallet, index) => (
<Card style={{ marginBottom: '10px' }} key={wallet.privKeyHex}>
<Card.Header>
<Card.Header style={{ display:"flex", justifyContent:"space-between"}}>
<input
type="text"
id="inputName"
Expand All @@ -131,11 +133,11 @@ const WalletInfo: React.FC<Props> = ({network, setShowWallets, wallets, setWall
placeholder="name"
/>
<Button
style={{float:"right", marginTop:"2px"}}
style={{padding: "0px 6px"}}
onClick={() => removeWallet(index)}
variant="outline-secondary"
variant="danger"
size="sm">
-
x
</Button>
</Card.Header>
<Card.Body>
Expand Down

0 comments on commit b90cf1a

Please sign in to comment.