diff --git a/public/imgs/whatsapp.png b/public/imgs/whatsapp.png
new file mode 100644
index 0000000..470ed37
Binary files /dev/null and b/public/imgs/whatsapp.png differ
diff --git a/src/AppContext.js b/src/AppContext.js
index a2ee52c..2835407 100644
--- a/src/AppContext.js
+++ b/src/AppContext.js
@@ -75,13 +75,14 @@ export const AppContextProvider = ({ children }) => {
setBannerLink(s.pic_url)
- SOCIALS[0].path = b.telegram
- SOCIALS[1].path = b.twitter
- SOCIALS[2].path = b.facebook
- SOCIALS[3].path = b.whatsapp
+ let socl = [...SOCIALS]
+ socl[0].path = b.telegram
+ socl[1].path = b.twitter
+ socl[2].path = b.facebook
+ socl[3].path = b.whatsapp
- setSocials(SOCIALS)
- setKefuUrl(s.kefu_url)
+ setSocials(s)
+ setKefuUrl('whatsapp://send?phone=' + b.whatsapp)
setRewards(s.reward)
setAppAddress(s.app_address)
setAppKey(s.app_key)
diff --git a/src/components/FloatingBtn.js b/src/components/FloatingBtn.js
new file mode 100644
index 0000000..2b94dca
--- /dev/null
+++ b/src/components/FloatingBtn.js
@@ -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 (
+
+
+ }
+ onClick={onClick}
+ />
+
+ )
+}
\ No newline at end of file
diff --git a/src/components/Hero.js b/src/components/Hero.js
index d23d729..f239ba0 100644
--- a/src/components/Hero.js
+++ b/src/components/Hero.js
@@ -19,7 +19,7 @@ export const Hero = ({ bg }) => {
{/* */}
-
+
({text})
+
+const TQuantity = ({ text }) => ({text})
+
export const LatestScreen = ({ data, ...rest }) => {
- const TAddress = ({ text }) => ({text})
-
- const TQuantity = ({ text }) => ({text})
-
return (
@@ -41,7 +38,7 @@ export const LatestScreen = ({ data, ...rest }) => {
slidesPerView={6}
spaceBetween={0}
// centeredSlides={true}
- speed={5000}
+ speed={3500}
loop={true}
autoplay={{
delay: 1,
diff --git a/src/components/Layout.js b/src/components/Layout.js
index f3a2c1a..8ee8cd8 100644
--- a/src/components/Layout.js
+++ b/src/components/Layout.js
@@ -1,19 +1,20 @@
import {
- Box, Drawer, DrawerContent,
- useColorModeValue, useDisclosure, DrawerOverlay,
+ Box, useColorModeValue,
} from '@chakra-ui/react'
import React from 'react'
-import { SideBar } from './SideBar'
-import { AppBar } from './AppBar'
+
import { BottomNav } from './BottomNav'
import { Hero } from './Hero'
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.
*/
export const Layout = ({ children }) => {
- const { isOpen: isOpenDrawer, onOpen: onOpenDrawer, onClose: onCloseDrawer } = useDisclosure()
+ const app = useApp()
const bg = useColorModeValue('gray.100', 'gray.900')
@@ -36,6 +37,14 @@ export const Layout = ({ children }) => {
{children}
+
+
diff --git a/src/components/WalletButton.js b/src/components/WalletButton.js
index b690ef3..fa4346c 100644
--- a/src/components/WalletButton.js
+++ b/src/components/WalletButton.js
@@ -83,12 +83,12 @@ export const WalletButton = ({ ...rest }) => {
})
}
}).catch(err => {
-
+ console.error('get_ether() error:', err.message)
})
}
const onBtnThis = async () => {
- if (!app.address) {
+ if (!authorized) {
await connect()
// checkAuth()
} else {
diff --git a/src/components/base/FloatingButton.js b/src/components/base/FloatingButton.js
new file mode 100644
index 0000000..6bac757
--- /dev/null
+++ b/src/components/base/FloatingButton.js
@@ -0,0 +1,5 @@
+import React from "react"
+
+export const FloatingButton = ({img}) => {
+
+}
\ No newline at end of file
diff --git a/src/components/index.js b/src/components/index.js
index d8cc7ce..2445e86 100644
--- a/src/components/index.js
+++ b/src/components/index.js
@@ -14,5 +14,6 @@ export * from './Hero'
export * from './LatestScreen'
export * from './PoolData'
export * from './WalletButton'
+export * from './FloatingBtn'
export * from './alert'
export * from './base'
diff --git a/src/data.js b/src/data.js
index c3f9684..e11b475 100644
--- a/src/data.js
+++ b/src/data.js
@@ -25,6 +25,7 @@ export const Images = {
config.ENDPOINT + 'static/media/codebank.db7917c8.svg',
],
+ whatsapp: process.env.PUBLIC_URL + '/imgs/whatsapp.png',
more: config.ENDPOINT + 'static/media/icon-more.c502d302.svg',
new: config.ENDPOINT + 'static/media/jiaobiao-eth.4b55fb16.svg',
stakingBanner: config.ENDPOINT + 'static/media/eth_mining.jpg',
diff --git a/src/pages/Team.js b/src/pages/Team.js
index a00ab4d..b971461 100644
--- a/src/pages/Team.js
+++ b/src/pages/Team.js
@@ -9,18 +9,22 @@ import { FiCopy, FiCheck } from 'react-icons/fi'
import { get_page_team } from '../api'
let teamData = [
- { name: 'Level 1 Total Output', value: 234, emp: true, unit: 'USDT' },
- { name: 'Level 2 Total Output', value: 2344.34, emp: true, unit: 'USDT' },
- { name: 'Level 3 Total Output', value: 2342342.32, emp: true, unit: 'USDT' },
- { name: 'Participant', value: 234234.04, emp: true, unit: 'USDT' },
- { name: 'Team revenue', value: 234234.04, emp: false, unit: 'USDT' },
+ { name: 'Level 1 Total Output', value: 0, emp: true, unit: 'USDT' },
+ { name: 'Level 2 Total Output', value: 0, emp: true, unit: 'USDT' },
+ { name: 'Level 3 Total Output', value: 0, emp: true, unit: 'USDT' },
+ { name: 'Participant', value: 0, emp: true, unit: 'USDT' },
+ { name: 'Team revenue', value: 0, emp: false, unit: 'USDT' },
]
export const Team = () => {
const app = useApp()
+
+ const [va, setVa] = React.useState(app.address)
+ const [vs, setVs] = React.useState(app.shareLink)
+
const [teamInfo, setTeamInfo] = React.useState(teamData)
- const { hasCopiedAddress, doCopyAddress } = useClipboard('12345')
- const { hasCopiedShareLink, doCopyShareLink } = useClipboard(app.shareLink)
+ const { hasCopied: hasCopiedAddress, onCopy: doCopyAddress } = useClipboard(va)
+ const { hasCopied: hasCopiedShareLink, onCopy: doCopyShareLink } = useClipboard(vs)
React.useEffect(() => {
get_page_team().then(res => {
@@ -39,13 +43,10 @@ export const Team = () => {
})
}, [])
- const onBtnCopyAddress = () => {
-
- }
-
- const onBtnCopyLink = () => {
-
- }
+ React.useEffect(() => {
+ setVa(app.address)
+ setVs(app.shareLink)
+ }, [app.address, app.shareLink])
return (
@@ -60,14 +61,15 @@ export const Team = () => {
}
onClick={doCopyAddress}
/>
@@ -81,12 +83,12 @@ export const Team = () => {
My share link
-
+
}
onClick={doCopyShareLink}
/>