Implement Base Minter Contract dashboard
This commit is contained in:
+19
-7
@@ -1,9 +1,13 @@
|
||||
import type { UseMinterContractProps } from 'contracts/minter'
|
||||
import { useMinterContract } from 'contracts/minter'
|
||||
import type { UseBaseFactoryContractProps } from 'contracts/baseFactory'
|
||||
import { useBaseFactoryContract } from 'contracts/baseFactory'
|
||||
import type { UseBaseMinterContractProps } from 'contracts/baseMinter'
|
||||
import { useBaseMinterContract } from 'contracts/baseMinter'
|
||||
import type { UseSG721ContractProps } from 'contracts/sg721'
|
||||
import { useSG721Contract } from 'contracts/sg721'
|
||||
import type { UseVendingFactoryContractProps } from 'contracts/vendingFactory'
|
||||
import { useVendingFactoryContract } from 'contracts/vendingFactory'
|
||||
import type { UseVendingMinterContractProps } from 'contracts/vendingMinter'
|
||||
import { useVendingMinterContract } from 'contracts/vendingMinter'
|
||||
import type { UseWhiteListContractProps } from 'contracts/whitelist'
|
||||
import { useWhiteListContract } from 'contracts/whitelist'
|
||||
import type { ReactNode, VFC } from 'react'
|
||||
@@ -16,9 +20,11 @@ import create from 'zustand'
|
||||
*/
|
||||
export interface ContractsStore extends State {
|
||||
sg721: UseSG721ContractProps | null
|
||||
minter: UseMinterContractProps | null
|
||||
vendingMinter: UseVendingMinterContractProps | null
|
||||
baseMinter: UseBaseMinterContractProps | null
|
||||
whitelist: UseWhiteListContractProps | null
|
||||
vendingFactory: UseVendingFactoryContractProps | null
|
||||
baseFactory: UseBaseFactoryContractProps | null
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -26,9 +32,11 @@ export interface ContractsStore extends State {
|
||||
*/
|
||||
export const defaultValues: ContractsStore = {
|
||||
sg721: null,
|
||||
minter: null,
|
||||
vendingMinter: null,
|
||||
baseMinter: null,
|
||||
whitelist: null,
|
||||
vendingFactory: null,
|
||||
baseFactory: null,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,18 +61,22 @@ export const ContractsProvider = ({ children }: { children: ReactNode }) => {
|
||||
|
||||
const ContractsSubscription: VFC = () => {
|
||||
const sg721 = useSG721Contract()
|
||||
const minter = useMinterContract()
|
||||
const vendingMinter = useVendingMinterContract()
|
||||
const baseMinter = useBaseMinterContract()
|
||||
const whitelist = useWhiteListContract()
|
||||
const vendingFactory = useVendingFactoryContract()
|
||||
const baseFactory = useBaseFactoryContract()
|
||||
|
||||
useEffect(() => {
|
||||
useContracts.setState({
|
||||
sg721,
|
||||
minter,
|
||||
vendingMinter,
|
||||
baseMinter,
|
||||
whitelist,
|
||||
vendingFactory,
|
||||
baseFactory,
|
||||
})
|
||||
}, [sg721, minter, whitelist, vendingFactory])
|
||||
}, [sg721, vendingMinter, baseMinter, whitelist, vendingFactory, baseFactory])
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user