diff --git a/components/BurgerStation/index.tsx b/components/BurgerStation/index.tsx index 9b76a2f..44de9fb 100644 --- a/components/BurgerStation/index.tsx +++ b/components/BurgerStation/index.tsx @@ -21,6 +21,7 @@ import { isMobile } from 'react-device-detect' interface Props { className: string + setShowDrawer: (show: boolean) => void } interface ModalInfo { @@ -29,7 +30,7 @@ interface ModalInfo { jumpUrl?: string } -const BurgerStation: FC = ({ className: _className }) => { +const BurgerStation: FC = ({ className: _className, setShowDrawer }) => { const { t: _t } = i18next const t = useCallback((s: any) => _t(s, { ns: 'burgerStation' }), [_t]) const router = useRouter() @@ -119,10 +120,10 @@ const BurgerStation: FC = ({ className: _className }) => { } // 移动端连接钱包 - const connectWalletInMobile = useCallback(() => { - dispatch(batchUpdate({ walletName: 'OneGate' })) - walletApi['OneGate']?.getAccount() - }, [dispatch]) + // const connectWalletInMobile = useCallback(() => { + // dispatch(batchUpdate({ walletName: 'OneGate' })) + // walletApi['OneGate']?.getAccount() + // }, [dispatch]) // swap按钮是否禁用 const swapBtnDisabled = useMemo(() => { @@ -291,7 +292,7 @@ const BurgerStation: FC = ({ className: _className }) => { diff --git a/components/Drawer/index.tsx b/components/Drawer/index.tsx index 0cc9c43..c90f201 100644 --- a/components/Drawer/index.tsx +++ b/components/Drawer/index.tsx @@ -10,6 +10,7 @@ import { batchUpdate } from '@/store/features/burger' import { walletApi } from '@/resources/utils/api/walletApi' import closeDrawer from '@/resources/images/close-drawer.svg' import oneGate from '@/resources/images/onegate.svg' +import neoLine from '@/resources/images/neo-line.svg' import copy from '@/resources/images/copy.svg' import style from './Drawer.module.css' @@ -41,9 +42,9 @@ const Drawer: FC = ({ visible, hide, language }) => { ) // 连接钱包 - const connectWallet = () => { - dispatch(batchUpdate({ walletName: 'OneGate' })) - walletApi['OneGate']?.getAccount() + const connectWallet = (walletName: string) => { + dispatch(batchUpdate({ walletName })) + walletApi[walletName]?.getAccount() } const changeLanguage = (locale: string) => { @@ -56,11 +57,11 @@ const Drawer: FC = ({ visible, hide, language }) => {
hide()}> close
- {address && walletName === 'OneGate' ? ( + {address ? (
- onegate - OneGate + {walletName} + {walletName}
@@ -70,17 +71,25 @@ const Drawer: FC = ({ visible, hide, language }) => {
-
) : ( - +
+ + +
)} diff --git a/components/JazzUp/index.tsx b/components/JazzUp/index.tsx index 400eac4..dc5ea9b 100644 --- a/components/JazzUp/index.tsx +++ b/components/JazzUp/index.tsx @@ -21,6 +21,7 @@ import { isMobile } from 'react-device-detect' interface Props { className: string + setShowDrawer: (show: boolean) => void } interface ModalInfo { @@ -29,7 +30,7 @@ interface ModalInfo { jumpUrl?: string } -const JazzUp: FC = ({ className: _className }) => { +const JazzUp: FC = ({ className: _className, setShowDrawer }) => { const { t: _t } = i18next const t = useCallback((s: any) => _t(s, { ns: 'jazzUp' }), [_t]) const router = useRouter() @@ -120,10 +121,10 @@ const JazzUp: FC = ({ className: _className }) => { } // 移动端连接钱包 - const connectWalletInMobile = useCallback(() => { - dispatch(batchUpdate({ walletName: 'OneGate' })) - walletApi['OneGate']?.getAccount() - }, [dispatch]) + // const connectWalletInMobile = useCallback(() => { + // dispatch(batchUpdate({ walletName: 'OneGate' })) + // walletApi['OneGate']?.getAccount() + // }, [dispatch]) // claim按钮是否禁用 const claimBtnDisabled = useMemo(() => { @@ -217,7 +218,7 @@ const JazzUp: FC = ({ className: _className }) => { diff --git a/pages/[lang]/home.tsx b/pages/[lang]/home.tsx index df53029..b2dafb3 100644 --- a/pages/[lang]/home.tsx +++ b/pages/[lang]/home.tsx @@ -28,7 +28,11 @@ import style_pc from "./Home.pc.module.css"; import style_mobile from "./Home.mobile.module.css"; import { isMobile } from "react-device-detect"; -const Home: NextPage = () => { +interface Props { + setShowDrawer: (show: boolean) => void +} + +const Home: NextPage = ({ setShowDrawer }) => { const { t } = i18next; const router = useRouter(); @@ -158,17 +162,15 @@ const Home: NextPage = () => {
setOperateType("burgerStation")} > {t("burgerStation")}
setOperateType("jazzUp")} > {t("jazzUp")} @@ -178,9 +180,11 @@ const Home: NextPage = () => { className={ operateType !== "burgerStation" ? style.hideInMobile : "" } + setShowDrawer={setShowDrawer} />
diff --git a/pages/_app.tsx b/pages/_app.tsx index e717a98..9bb4391 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -36,7 +36,7 @@ function App({ Component, pageProps }: any) { {/* */}
- +