From 0dcd7e8e62789e84384f8375332295577f95760e Mon Sep 17 00:00:00 2001 From: Nnachevvv Date: Sun, 29 Oct 2023 08:54:02 +0200 Subject: [PATCH] Add refundStore --- .../admin/donations/store/RefundStore.ts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/components/admin/donations/store/RefundStore.ts diff --git a/src/components/admin/donations/store/RefundStore.ts b/src/components/admin/donations/store/RefundStore.ts new file mode 100644 index 000000000..463cefec6 --- /dev/null +++ b/src/components/admin/donations/store/RefundStore.ts @@ -0,0 +1,38 @@ +import { action, makeObservable, observable } from 'mobx' +import { enableStaticRendering } from 'mobx-react' + +enableStaticRendering(typeof window === 'undefined') + +type Record = { + id: string +} +export class RefundStoreImpl { + isRefundOpen = false + selectedRecord: Record = { + id: '', + } + + constructor() { + makeObservable(this, { + isRefundOpen: observable, + selectedRecord: observable, + showRefund: action, + hideRefund: action, + }) + } + + showRefund = () => { + console.log('refund open') + this.isRefundOpen = true + } + + hideRefund = () => { + this.isRefundOpen = false + } + + setSelectedRecord = (record: Record) => { + this.selectedRecord = record + } +} + +export const RefundStore = new RefundStoreImpl()