Skip to content

Commit

Permalink
Allow removal of outputs in send menu
Browse files Browse the repository at this point in the history
  • Loading branch information
KaffinPX committed Jul 22, 2024
1 parent 4f6cf1d commit 3214ce3
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions src/pages/Wallet/Send.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useState } from "react"
import { i18n } from "webextension-polyfill"
import { SendToBack, PlusIcon } from "lucide-react"
import { SendToBack, PlusIcon, MinusIcon } from "lucide-react"
import Sign from "./Send/Sign"
import Submit from "./Send/Submit"
import { Button } from "@/components/ui/button"
Expand Down Expand Up @@ -119,14 +119,30 @@ export default function SendDrawer () {
</CarouselContent>
</Carousel>
</div>
<Button className={"ml-0.5"} size={'icon'} variant={"ghost"} onClick={() => {
setOutputs((prevOutputs) => {
prevOutputs.push([ "", "" ])
return [ ...prevOutputs ]
})
}}>
<PlusIcon />
</Button>
<div className={"flex flex-col"}>
<Button className={"ml-0.5"} size={'icon'} variant={"ghost"} onClick={() => {
setOutputs((prevOutputs) => {
prevOutputs.push([ "", "" ])
return [ ...prevOutputs ]
})
}}>
<PlusIcon />
</Button>
<Button
className={"ml-0.5"}
size={'icon'}
variant={"ghost"}
disabled={outputs.length === 1}
onClick={() => {
setOutputs((prevOutputs) => {
prevOutputs.splice(prevOutputs.length - 1, 1)
return [ ...prevOutputs ]
})
}
}>
<MinusIcon />
</Button>
</div>
</div>

<Button className={"gap-2"} disabled={!!transactions} onClick={initiateSend}>
Expand Down

0 comments on commit 3214ce3

Please sign in to comment.