diff --git a/components/TopBar.tsx b/components/TopBar.tsx index e5b2ecd..409698d 100644 --- a/components/TopBar.tsx +++ b/components/TopBar.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useState } from 'react' +import { useEffect, useState } from 'react' import { ArrowLeftIcon, ExclamationTriangleIcon, @@ -11,8 +11,6 @@ import { useRouter } from 'next/router' import useOnlineStatus from 'hooks/useOnlineStatus' import mangoStore from '@store/mangoStore' -const set = mangoStore.getState().set - const TopBar = () => { const { connected } = useWallet() const themeData = mangoStore((s) => s.themeData) @@ -23,21 +21,12 @@ const TopBar = () => { const router = useRouter() const { query } = router - const handleShowSetup = useCallback(() => { - set((s) => { - s.showUserSetup = true - }) - }, []) - useEffect(() => { setTimeout(() => setCopied(''), 2000) }, [copied]) return ( -
+
{query.token || query.market ? ( @@ -48,7 +37,7 @@ const TopBar = () => { ) : null} -
+
{
) : null}
- {connected ? ( -
- -
- ) : ( - - )} + {connected ? : }
diff --git a/components/wallet/ConnectWalletButton.tsx b/components/wallet/ConnectWalletButton.tsx index 32f365f..b88ee1c 100644 --- a/components/wallet/ConnectWalletButton.tsx +++ b/components/wallet/ConnectWalletButton.tsx @@ -1,23 +1,16 @@ import React, { Fragment, useMemo } from 'react' import { useWallet } from '@solana/wallet-adapter-react' import { useTranslation } from 'next-i18next' -import WalletIcon from '@components/icons/WalletIcon' import useLocalStorageState from 'hooks/useLocalStorageState' import { LAST_WALLET_NAME } from 'utils/constants' import { ChevronDownIcon } from '@heroicons/react/20/solid' import { Popover, Transition } from '@headlessui/react' -// import Loading from '@components/shared/Loading' import mangoStore from '@store/mangoStore' import { WalletName, WalletReadyState } from '@solana/wallet-adapter-base' -export default function ConnectWalletButton({ - handleShowSetup, -}: { - handleShowSetup: () => void -}) { +export default function ConnectWalletButton() { const { t } = useTranslation('common') const { wallet, wallets, select, connected, connect } = useWallet() - const isOnboarded = true const mangoAccountLoading = mangoStore((s) => s.mangoAccount.initialLoad) const [lastWalletName] = useLocalStorageState( LAST_WALLET_NAME, @@ -38,108 +31,94 @@ export default function ConnectWalletButton({ }, [wallets, lastWalletName]) return ( - <> - {isOnboarded && walletIcon ? ( -
- - - {({ open }) => ( - <> - - - - - - {detectedWallets.map((wallet, index) => ( - - ))} - - - - )} - -
- ) : ( - - )} - +
+ + + {({ open }) => ( + <> + + + + + + {detectedWallets.map((wallet, index) => ( + + ))} + + + + )} + +
) } diff --git a/components/wallet/ConnectedMenu.tsx b/components/wallet/ConnectedMenu.tsx index 517f92b..dc2f1c4 100644 --- a/components/wallet/ConnectedMenu.tsx +++ b/components/wallet/ConnectedMenu.tsx @@ -8,8 +8,6 @@ import { notify } from '../../utils/notifications' import ProfileImage from '../profile/ProfileImage' import { abbreviateAddress } from '../../utils/formatting' import { useViewport } from 'hooks/useViewport' -import { TV_USER_ID_KEY } from 'utils/constants' -import useLocalStorageState from 'hooks/useLocalStorageState' import Loading from '@components/shared/Loading' const set = mangoStore.getState().set @@ -19,9 +17,6 @@ const ConnectedMenu = () => { const { t } = useTranslation('common') const { publicKey, disconnect, wallet } = useWallet() const { isDesktop } = useViewport() - const [tvUserId, setTvUserId] = useLocalStorageState(TV_USER_ID_KEY, '') - - // const profileDetails = mangoStore((s) => s.profile.details) const loadProfileDetails = mangoStore((s) => s.profile.loadDetails) const groupLoaded = mangoStore((s) => s.groupLoaded) const mangoAccountLoading = mangoStore((s) => s.mangoAccount.initialLoad) @@ -32,8 +27,6 @@ const ConnectedMenu = () => { state.mangoAccount.current = undefined state.mangoAccounts = [] state.mangoAccount.initialLoad = true - state.mangoAccount.openOrders = {} - state.mangoAccount.interestTotals = { data: [], loading: false } }) disconnect() notify({ @@ -46,22 +39,18 @@ const ConnectedMenu = () => { if (publicKey && wallet && groupLoaded) { actions.connectMangoClientWithWallet(wallet) actions.fetchMangoAccounts(publicKey) - // actions.fetchTourSettings(publicKey?.toString() as string) actions.fetchProfileDetails(publicKey.toString()) actions.fetchWalletTokens(publicKey) - if (!tvUserId) { - setTvUserId(publicKey.toString()) - } } - }, [publicKey, wallet, groupLoaded, tvUserId, setTvUserId]) + }, [publicKey, wallet, groupLoaded]) return ( <>
{ isOwnerProfile /> ) : ( - +
+ +
)} {!loadProfileDetails && isDesktop ? (
@@ -103,9 +94,9 @@ const ConnectedMenu = () => { leaveFrom="opacity-100" leaveTo="opacity-0" > - +