Skip to content

Commit 46a207a

Browse files
committed
clear receipts list
1 parent 66ac8bb commit 46a207a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/etherscan/src/app/views/ReceiptsView.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Receipt } from "../types"
66
import { AppContext } from "../AppContext"
77
import { SubmitButton } from "../components"
88
import { Navigate } from "react-router-dom"
9+
import { Button } from "react-bootstrap"
910

1011
interface FormValues {
1112
receiptGuid: string
@@ -47,7 +48,7 @@ export const ReceiptsView: React.FC = () => {
4748

4849
return (
4950
<AppContext.Consumer>
50-
{({ apiKey, clientInstance, receipts }) => {
51+
{({ apiKey, clientInstance, receipts, setReceipts }) => {
5152
if (!apiKey && clientInstance && clientInstance.call) clientInstance.call('notification' as any, 'toast', 'Please add API key to continue')
5253
return !apiKey ? (
5354
<Navigate
@@ -108,6 +109,7 @@ export const ReceiptsView: React.FC = () => {
108109
/>
109110

110111
<ReceiptsTable receipts={receipts} />
112+
<Button title="Clear the list of receipt" onClick={() => { setReceipts([]) }} >Clear</Button>
111113
</div>
112114
)
113115
}

0 commit comments

Comments
 (0)