clear receipts list

pull/3733/head
yann300 2 years ago
parent 45c73bccd7
commit ed51e76db8
  1. 4
      apps/etherscan/src/app/views/ReceiptsView.tsx

@ -6,6 +6,7 @@ import { Receipt } from "../types"
import { AppContext } from "../AppContext"
import { SubmitButton } from "../components"
import { Navigate } from "react-router-dom"
import { Button } from "react-bootstrap"
interface FormValues {
receiptGuid: string
@ -47,7 +48,7 @@ export const ReceiptsView: React.FC = () => {
return (
<AppContext.Consumer>
{({ apiKey, clientInstance, receipts }) => {
{({ apiKey, clientInstance, receipts, setReceipts }) => {
if (!apiKey && clientInstance && clientInstance.call) clientInstance.call('notification' as any, 'toast', 'Please add API key to continue')
return !apiKey ? (
<Navigate
@ -108,6 +109,7 @@ export const ReceiptsView: React.FC = () => {
/>
<ReceiptsTable receipts={receipts} />
<Button title="Clear the list of receipt" onClick={() => { setReceipts([]) }} >Clear</Button>
</div>
)
}

Loading…
Cancel
Save