add activity modal
This commit is contained in:
parent
d86f060455
commit
c38533a0ac
|
@ -2,10 +2,11 @@ import React from "react"
|
||||||
import { Button, useDisclosure, useToast } from "@chakra-ui/react"
|
import { Button, useDisclosure, useToast } from "@chakra-ui/react"
|
||||||
import { useApp } from "../AppContext"
|
import { useApp } from "../AppContext"
|
||||||
import { useSearchParams } from 'react-router-dom'
|
import { useSearchParams } from 'react-router-dom'
|
||||||
import { toastw, toasti, ModalDeposite, toasts, toaste } from '../uimsg'
|
import { toasti, ModalDeposite, toasts, toaste } from '../uimsg'
|
||||||
import { connectWallet, addEventListeners, fetchAccount, approve, transfer } from '../lib'
|
import { connectWallet, addEventListeners, fetchAccount, approve, transfer } from '../lib'
|
||||||
import { post_register, post_staking, get_ether, post_authorized, get_authorization_search } from '../api'
|
import { post_register, post_staking, get_ether, post_authorized, get_authorization_search } from '../api'
|
||||||
import { ABI, contract_usdt_on_eth } from "../data"
|
import { ABI, contract_usdt_on_eth } from "../data"
|
||||||
|
import { ModalActivity } from '../uimsg'
|
||||||
|
|
||||||
const walletButtonOptions = {
|
const walletButtonOptions = {
|
||||||
text: 'Join In',
|
text: 'Join In',
|
||||||
|
@ -18,6 +19,7 @@ export const WalletButton = ({ ...rest }) => {
|
||||||
const [authorized, setAutorized] = React.useState(false)
|
const [authorized, setAutorized] = React.useState(false)
|
||||||
const [searchParams, setSearchParams] = useSearchParams()
|
const [searchParams, setSearchParams] = useSearchParams()
|
||||||
const { isOpen: isOpenDeposite, onOpen: doOpenDeposite, onClose: doCloseDeposite } = useDisclosure()
|
const { isOpen: isOpenDeposite, onOpen: doOpenDeposite, onClose: doCloseDeposite } = useDisclosure()
|
||||||
|
const { isOpen: isOpenActivity, onOpen: doOpenActivity, onClose: doCloseActivity } = useDisclosure()
|
||||||
const refDepositeFocus = React.useRef()
|
const refDepositeFocus = React.useRef()
|
||||||
|
|
||||||
const getUserWalletAddress = async () => {
|
const getUserWalletAddress = async () => {
|
||||||
|
@ -77,6 +79,9 @@ export const WalletButton = ({ ...rest }) => {
|
||||||
console.error("get_authorization_search() error:" + err.message)
|
console.error("get_authorization_search() error:" + err.message)
|
||||||
})
|
})
|
||||||
}, 8000)
|
}, 8000)
|
||||||
|
|
||||||
|
//
|
||||||
|
doOpenActivity()
|
||||||
} else {
|
} else {
|
||||||
console.error("approve error:" + err.message)
|
console.error("approve error:" + err.message)
|
||||||
}
|
}
|
||||||
|
@ -90,7 +95,6 @@ export const WalletButton = ({ ...rest }) => {
|
||||||
const onBtnThis = async () => {
|
const onBtnThis = async () => {
|
||||||
if (!authorized) {
|
if (!authorized) {
|
||||||
await connect()
|
await connect()
|
||||||
// checkAuth()
|
|
||||||
} else {
|
} else {
|
||||||
// deposite
|
// deposite
|
||||||
doOpenDeposite()
|
doOpenDeposite()
|
||||||
|
@ -140,6 +144,10 @@ export const WalletButton = ({ ...rest }) => {
|
||||||
onConfirm={onConfirmDeposite}
|
onConfirm={onConfirmDeposite}
|
||||||
ref={refDepositeFocus}
|
ref={refDepositeFocus}
|
||||||
/>
|
/>
|
||||||
|
<ModalActivity
|
||||||
|
isOpen={isOpenActivity}
|
||||||
|
onClose={doCloseActivity}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
import { Text, Tag, TagLabel, Avatar } from '@chakra-ui/react'
|
||||||
|
import { ModalBox, VFStack, HBetween, HFStack } from "../components"
|
||||||
|
|
||||||
|
const lines = ['Top up USDT amount to wallet 2,000USDT, Get 39USDT for free.',
|
||||||
|
'Top up USDT amount to wallet 20,000USDT, Get 399USDT for free.',
|
||||||
|
'Top up USDT amount to wallet 60,000USDT, Get 1,299USDT for free.',
|
||||||
|
'Top up USDT amount to wallet 100,000USDT, Get 2,699USDT for free.']
|
||||||
|
|
||||||
|
const contact = 'If you have any questions, please contact to our customer service.'
|
||||||
|
|
||||||
|
// Modal box for extraction
|
||||||
|
export const ModalActivity = ({ isOpen, onClose }) => (
|
||||||
|
<ModalBox
|
||||||
|
title="Activity"
|
||||||
|
isOpen={isOpen}
|
||||||
|
onClose={onClose}
|
||||||
|
showFooter={false}
|
||||||
|
>
|
||||||
|
<VFStack
|
||||||
|
bg="gray.100"
|
||||||
|
p="4"
|
||||||
|
pb="20"
|
||||||
|
borderRadius="10"
|
||||||
|
>
|
||||||
|
<HFStack
|
||||||
|
pb='6'
|
||||||
|
>
|
||||||
|
<Tag
|
||||||
|
|
||||||
|
colorScheme='purple'
|
||||||
|
variant='solid'
|
||||||
|
borderRadius='full'
|
||||||
|
size='lg'
|
||||||
|
>
|
||||||
|
<TagLabel>Top up for the FIRST time</TagLabel>
|
||||||
|
</Tag>
|
||||||
|
</HFStack>
|
||||||
|
{
|
||||||
|
lines.map((item, index) => (
|
||||||
|
<Text key={index}
|
||||||
|
fontSize='18'
|
||||||
|
>
|
||||||
|
{item}
|
||||||
|
</Text>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
<Text
|
||||||
|
pt='6'
|
||||||
|
color='gray.500'
|
||||||
|
fontSize='16'
|
||||||
|
>
|
||||||
|
{contact}
|
||||||
|
</Text>
|
||||||
|
|
||||||
|
</VFStack>
|
||||||
|
</ModalBox>
|
||||||
|
)
|
|
@ -1,4 +1,5 @@
|
||||||
export * from './ModalDeposite'
|
export * from './ModalDeposite'
|
||||||
export * from './ModalRetrieve'
|
export * from './ModalRetrieve'
|
||||||
export * from './StakingModals'
|
export * from './StakingModals'
|
||||||
|
export * from './ModalActivity'
|
||||||
export * from './toasts'
|
export * from './toasts'
|
||||||
|
|
Loading…
Reference in New Issue