wallet-connect-web-examples/wallets/react-wallet-v2/src/components/Modal.tsx

21 lines
917 B
TypeScript
Raw Normal View History

2022-02-07 13:34:36 +00:00
import ModalStore from '@/store/ModalStore'
2022-02-10 14:13:01 +00:00
import SessionProposalModal from '@/views/SessionProposalModal'
2022-02-16 12:02:39 +00:00
import SessionSendTransactionModal from '@/views/SessionSendTransactionModal'
import SessionRequestModal from '@/views/SessionSignModal'
2022-02-15 12:41:46 +00:00
import SessionSignTypedDataModal from '@/views/SessionSignTypedDataModal'
2022-02-07 13:34:36 +00:00
import { Modal as NextModal } from '@nextui-org/react'
import { useSnapshot } from 'valtio'
export default function Modal() {
2022-02-10 14:13:01 +00:00
const { open, view } = useSnapshot(ModalStore.state)
2022-02-07 13:34:36 +00:00
return (
2022-02-10 14:13:01 +00:00
<NextModal blur open={open} style={{ border: '1px solid rgba(139, 139, 139, 0.4)' }}>
{view === 'SessionProposalModal' && <SessionProposalModal />}
{view === 'SessionSignModal' && <SessionRequestModal />}
2022-02-15 12:41:46 +00:00
{view === 'SessionSignTypedDataModal' && <SessionSignTypedDataModal />}
2022-02-16 12:02:39 +00:00
{view === 'SessionSendTransactionModal' && <SessionSendTransactionModal />}
2022-02-07 13:34:36 +00:00
</NextModal>
)
}