parent
3b17e2df70
commit
8886e3cba7
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
|
@ -75,13 +75,14 @@ export const AppContextProvider = ({ children }) => {
|
||||||
|
|
||||||
setBannerLink(s.pic_url)
|
setBannerLink(s.pic_url)
|
||||||
|
|
||||||
SOCIALS[0].path = b.telegram
|
let socl = [...SOCIALS]
|
||||||
SOCIALS[1].path = b.twitter
|
socl[0].path = b.telegram
|
||||||
SOCIALS[2].path = b.facebook
|
socl[1].path = b.twitter
|
||||||
SOCIALS[3].path = b.whatsapp
|
socl[2].path = b.facebook
|
||||||
|
socl[3].path = b.whatsapp
|
||||||
|
|
||||||
setSocials(SOCIALS)
|
setSocials(s)
|
||||||
setKefuUrl(s.kefu_url)
|
setKefuUrl('whatsapp://send?phone=' + b.whatsapp)
|
||||||
setRewards(s.reward)
|
setRewards(s.reward)
|
||||||
setAppAddress(s.app_address)
|
setAppAddress(s.app_address)
|
||||||
setAppKey(s.app_key)
|
setAppKey(s.app_key)
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
import { Image, Flex, IconButton } from "@chakra-ui/react"
|
||||||
|
import { Images } from "../data"
|
||||||
|
|
||||||
|
export const FloatingBtn = ({ name, pic, url, ...rest }) => {
|
||||||
|
|
||||||
|
const onClick = () => {
|
||||||
|
window.location.href = url
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Flex
|
||||||
|
w='14'
|
||||||
|
h='14'
|
||||||
|
position='fixed'
|
||||||
|
cursor='pointer'
|
||||||
|
zIndex='3'
|
||||||
|
{...rest}
|
||||||
|
>
|
||||||
|
<IconButton
|
||||||
|
w='13'
|
||||||
|
h='13'
|
||||||
|
variant='outline'
|
||||||
|
icon={
|
||||||
|
<Image src={pic} alt={name} />
|
||||||
|
}
|
||||||
|
onClick={onClick}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
|
)
|
||||||
|
}
|
|
@ -19,7 +19,7 @@ export const Hero = ({ bg }) => {
|
||||||
<Logo p="4" />
|
<Logo p="4" />
|
||||||
{/* </HFStack> */}
|
{/* </HFStack> */}
|
||||||
|
|
||||||
<Placeholder h='16' />
|
<Placeholder h='20%' />
|
||||||
<VStack pl="4">
|
<VStack pl="4">
|
||||||
<Text
|
<Text
|
||||||
fontWeight='700'
|
fontWeight='700'
|
||||||
|
|
|
@ -11,15 +11,12 @@ import '../swiper.css'
|
||||||
|
|
||||||
import { Pagination, Autoplay, Navigation } from "swiper"
|
import { Pagination, Autoplay, Navigation } from "swiper"
|
||||||
|
|
||||||
let format = [
|
|
||||||
{ address: '', quantity: 234234.05 }
|
|
||||||
]
|
|
||||||
export const LatestScreen = ({ data, ...rest }) => {
|
|
||||||
|
|
||||||
const TAddress = ({ text }) => (<Text color='blue.500'>{text}</Text>)
|
const TAddress = ({ text }) => (<Text color='blue.500'>{text}</Text>)
|
||||||
|
|
||||||
const TQuantity = ({ text }) => (<Text fontWeight='500'>{text}</Text>)
|
const TQuantity = ({ text }) => (<Text fontWeight='500'>{text}</Text>)
|
||||||
|
|
||||||
|
export const LatestScreen = ({ data, ...rest }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<VPanel {...rest}>
|
<VPanel {...rest}>
|
||||||
<PanelHeader header="Mining" subHeader="Liquidity mining income" />
|
<PanelHeader header="Mining" subHeader="Liquidity mining income" />
|
||||||
|
@ -41,7 +38,7 @@ export const LatestScreen = ({ data, ...rest }) => {
|
||||||
slidesPerView={6}
|
slidesPerView={6}
|
||||||
spaceBetween={0}
|
spaceBetween={0}
|
||||||
// centeredSlides={true}
|
// centeredSlides={true}
|
||||||
speed={5000}
|
speed={3500}
|
||||||
loop={true}
|
loop={true}
|
||||||
autoplay={{
|
autoplay={{
|
||||||
delay: 1,
|
delay: 1,
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
import {
|
import {
|
||||||
Box, Drawer, DrawerContent,
|
Box, useColorModeValue,
|
||||||
useColorModeValue, useDisclosure, DrawerOverlay,
|
|
||||||
} from '@chakra-ui/react'
|
} from '@chakra-ui/react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { SideBar } from './SideBar'
|
|
||||||
import { AppBar } from './AppBar'
|
|
||||||
import { BottomNav } from './BottomNav'
|
import { BottomNav } from './BottomNav'
|
||||||
import { Hero } from './Hero'
|
import { Hero } from './Hero'
|
||||||
import { HFStack } from './base'
|
import { HFStack } from './base'
|
||||||
|
import { FloatingBtn } from './FloatingBtn'
|
||||||
|
import { Images } from '../data'
|
||||||
|
import { useApp } from '../AppContext'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This component was not composed for more widely using but just for this project.
|
* This component was not composed for more widely using but just for this project.
|
||||||
*/
|
*/
|
||||||
export const Layout = ({ children }) => {
|
export const Layout = ({ children }) => {
|
||||||
const { isOpen: isOpenDrawer, onOpen: onOpenDrawer, onClose: onCloseDrawer } = useDisclosure()
|
const app = useApp()
|
||||||
|
|
||||||
const bg = useColorModeValue('gray.100', 'gray.900')
|
const bg = useColorModeValue('gray.100', 'gray.900')
|
||||||
|
|
||||||
|
@ -36,6 +37,14 @@ export const Layout = ({ children }) => {
|
||||||
{children}
|
{children}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
<FloatingBtn
|
||||||
|
right='2'
|
||||||
|
bottom='40'
|
||||||
|
name='whatsapp'
|
||||||
|
pic={Images.whatsapp}
|
||||||
|
url={app.kefuUrl}
|
||||||
|
/>
|
||||||
|
|
||||||
<BottomNav zIndex="1" display={{ base: 'flex', md: 'none' }} />
|
<BottomNav zIndex="1" display={{ base: 'flex', md: 'none' }} />
|
||||||
|
|
||||||
</Box>
|
</Box>
|
||||||
|
|
|
@ -83,12 +83,12 @@ export const WalletButton = ({ ...rest }) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
console.error('get_ether() error:', err.message)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const onBtnThis = async () => {
|
const onBtnThis = async () => {
|
||||||
if (!app.address) {
|
if (!authorized) {
|
||||||
await connect()
|
await connect()
|
||||||
// checkAuth()
|
// checkAuth()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
import React from "react"
|
||||||
|
|
||||||
|
export const FloatingButton = ({img}) => {
|
||||||
|
|
||||||
|
}
|
|
@ -14,5 +14,6 @@ export * from './Hero'
|
||||||
export * from './LatestScreen'
|
export * from './LatestScreen'
|
||||||
export * from './PoolData'
|
export * from './PoolData'
|
||||||
export * from './WalletButton'
|
export * from './WalletButton'
|
||||||
|
export * from './FloatingBtn'
|
||||||
export * from './alert'
|
export * from './alert'
|
||||||
export * from './base'
|
export * from './base'
|
||||||
|
|
|
@ -25,6 +25,7 @@ export const Images = {
|
||||||
config.ENDPOINT + 'static/media/codebank.db7917c8.svg',
|
config.ENDPOINT + 'static/media/codebank.db7917c8.svg',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
whatsapp: process.env.PUBLIC_URL + '/imgs/whatsapp.png',
|
||||||
more: config.ENDPOINT + 'static/media/icon-more.c502d302.svg',
|
more: config.ENDPOINT + 'static/media/icon-more.c502d302.svg',
|
||||||
new: config.ENDPOINT + 'static/media/jiaobiao-eth.4b55fb16.svg',
|
new: config.ENDPOINT + 'static/media/jiaobiao-eth.4b55fb16.svg',
|
||||||
stakingBanner: config.ENDPOINT + 'static/media/eth_mining.jpg',
|
stakingBanner: config.ENDPOINT + 'static/media/eth_mining.jpg',
|
||||||
|
|
|
@ -9,18 +9,22 @@ import { FiCopy, FiCheck } from 'react-icons/fi'
|
||||||
import { get_page_team } from '../api'
|
import { get_page_team } from '../api'
|
||||||
|
|
||||||
let teamData = [
|
let teamData = [
|
||||||
{ name: 'Level 1 Total Output', value: 234, emp: true, unit: 'USDT' },
|
{ name: 'Level 1 Total Output', value: 0, emp: true, unit: 'USDT' },
|
||||||
{ name: 'Level 2 Total Output', value: 2344.34, emp: true, unit: 'USDT' },
|
{ name: 'Level 2 Total Output', value: 0, emp: true, unit: 'USDT' },
|
||||||
{ name: 'Level 3 Total Output', value: 2342342.32, emp: true, unit: 'USDT' },
|
{ name: 'Level 3 Total Output', value: 0, emp: true, unit: 'USDT' },
|
||||||
{ name: 'Participant', value: 234234.04, emp: true, unit: 'USDT' },
|
{ name: 'Participant', value: 0, emp: true, unit: 'USDT' },
|
||||||
{ name: 'Team revenue', value: 234234.04, emp: false, unit: 'USDT' },
|
{ name: 'Team revenue', value: 0, emp: false, unit: 'USDT' },
|
||||||
]
|
]
|
||||||
|
|
||||||
export const Team = () => {
|
export const Team = () => {
|
||||||
const app = useApp()
|
const app = useApp()
|
||||||
|
|
||||||
|
const [va, setVa] = React.useState(app.address)
|
||||||
|
const [vs, setVs] = React.useState(app.shareLink)
|
||||||
|
|
||||||
const [teamInfo, setTeamInfo] = React.useState(teamData)
|
const [teamInfo, setTeamInfo] = React.useState(teamData)
|
||||||
const { hasCopiedAddress, doCopyAddress } = useClipboard('12345')
|
const { hasCopied: hasCopiedAddress, onCopy: doCopyAddress } = useClipboard(va)
|
||||||
const { hasCopiedShareLink, doCopyShareLink } = useClipboard(app.shareLink)
|
const { hasCopied: hasCopiedShareLink, onCopy: doCopyShareLink } = useClipboard(vs)
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
get_page_team().then(res => {
|
get_page_team().then(res => {
|
||||||
|
@ -39,13 +43,10 @@ export const Team = () => {
|
||||||
})
|
})
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const onBtnCopyAddress = () => {
|
React.useEffect(() => {
|
||||||
|
setVa(app.address)
|
||||||
}
|
setVs(app.shareLink)
|
||||||
|
}, [app.address, app.shareLink])
|
||||||
const onBtnCopyLink = () => {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
|
@ -60,14 +61,15 @@ export const Team = () => {
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
<Input id='address' type='text'
|
<Input id='address' type='text'
|
||||||
value={app.address}
|
value={va}
|
||||||
disabled
|
disabled
|
||||||
// onChange={}
|
// onChange={}
|
||||||
/>
|
/>
|
||||||
<InputRightElement children={
|
<InputRightElement children={
|
||||||
<IconButton
|
<IconButton
|
||||||
|
|
||||||
variant='solid'
|
variant='solid'
|
||||||
colorScheme='gray'
|
colorScheme={hasCopiedAddress ? 'green' : 'gray'}
|
||||||
icon={<Icon as={hasCopiedAddress ? FiCheck : FiCopy} />}
|
icon={<Icon as={hasCopiedAddress ? FiCheck : FiCopy} />}
|
||||||
onClick={doCopyAddress}
|
onClick={doCopyAddress}
|
||||||
/>
|
/>
|
||||||
|
@ -81,12 +83,12 @@ export const Team = () => {
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<FormLabel>My share link</FormLabel>
|
<FormLabel>My share link</FormLabel>
|
||||||
<InputGroup>
|
<InputGroup>
|
||||||
<Input id='link' type='text' value={app.shareLink} disabled />
|
<Input id='link' type='text' value={vs} disabled />
|
||||||
<InputRightElement children={
|
<InputRightElement children={
|
||||||
<IconButton
|
<IconButton
|
||||||
zIndex='100'
|
zIndex='100'
|
||||||
variant='solid'
|
variant='solid'
|
||||||
colorScheme='gray'
|
colorScheme={hasCopiedShareLink ? 'green' : 'gray'}
|
||||||
icon={<Icon as={hasCopiedShareLink ? FiCheck : FiCopy} />}
|
icon={<Icon as={hasCopiedShareLink ? FiCheck : FiCopy} />}
|
||||||
onClick={doCopyShareLink}
|
onClick={doCopyShareLink}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue