Skip to content

Commit

Permalink
Add refundStore
Browse files Browse the repository at this point in the history
  • Loading branch information
Nnachevvv committed Oct 29, 2023
1 parent 5b5edd2 commit 0dcd7e8
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/components/admin/donations/store/RefundStore.ts
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 0dcd7e8

Please sign in to comment.