diff --git a/components/Layout.tsx b/components/Layout.tsx
index 06040d19..67b30e12 100644
--- a/components/Layout.tsx
+++ b/components/Layout.tsx
@@ -75,12 +75,7 @@ const Layout = ({ children }: { children: ReactNode }) => {
isCollapsed ? 'md:pl-[64px]' : 'md:pl-44 lg:pl-48 xl:pl-52'
}`}
>
-
-
+
{children}
diff --git a/components/TokenList.tsx b/components/TokenList.tsx
index e0456a1f..9205549c 100644
--- a/components/TokenList.tsx
+++ b/components/TokenList.tsx
@@ -2,6 +2,7 @@ import { Bank, MangoAccount } from '@blockworks-foundation/mango-v4'
import { Transition } from '@headlessui/react'
import {
ChevronDownIcon,
+ ChevronRightIcon,
EllipsisHorizontalIcon,
QuestionMarkCircleIcon,
} from '@heroicons/react/20/solid'
@@ -11,7 +12,6 @@ import Image from "next/legacy/image";
import { useRouter } from 'next/router'
import { Fragment, useCallback, useEffect, useMemo, useState } from 'react'
import { useViewport } from '../hooks/useViewport'
-
import mangoStore from '@store/mangoStore'
import { formatDecimal, formatFixedDecimals } from '../utils/numbers'
import { breakpoints } from '../utils/theme'
@@ -38,6 +38,7 @@ const TokenList = () => {
)
const { width } = useViewport()
const showTableView = width ? width > breakpoints.md : false
+ const router = useRouter()
const banks = useMemo(() => {
if (group) {
@@ -74,6 +75,10 @@ const TokenList = () => {
}
}, [connected])
+ const goToTokenPage = (bank: Bank) => {
+ router.push(`/token/${bank.name}`, undefined, { shallow: true })
+ }
+
return (
@@ -226,6 +231,9 @@ const TokenList = () => {
id={i === 0 ? 'account-step-ten' : ''}
>
+
goToTokenPage(bank)}>
+
+
@@ -247,7 +255,7 @@ const TokenList = () => {
export default TokenList
const MobileTokenListItem = ({ bank }: { bank: Bank }) => {
- const { t } = useTranslation('common')
+ const { t } = useTranslation(['common', 'token'])
const [showTokenDetails, setShowTokenDetails] = useState(false)
const jupiterTokens = mangoStore((s) => s.jupiterTokens)
const spotBalances = mangoStore((s) => s.mangoAccount.spotBalances)
@@ -257,6 +265,7 @@ const MobileTokenListItem = ({ bank }: { bank: Bank }) => {
)
const symbol = bank.name
const oraclePrice = bank.uiPrice
+ const router = useRouter()
let logoURI
if (jupiterTokens.length) {
@@ -282,6 +291,10 @@ const MobileTokenListItem = ({ bank }: { bank: Bank }) => {
const unsettled = spotBalances[bank.mint.toString()]?.unsettled || 0.0
+ const goToTokenPage = (bank: Bank) => {
+ router.push(`/token/${bank.name}`, undefined, { shallow: true })
+ }
+
return (
@@ -367,6 +380,15 @@ const MobileTokenListItem = ({ bank }: { bank: Bank }) => {
+
+ goToTokenPage(bank)}
+ >
+ {t('token:token-details')}
+
+
+
@@ -386,7 +408,7 @@ const ActionsMenu = ({
const [showBorrowModal, setShowBorrowModal] = useState(false)
const [selectedToken, setSelectedToken] = useState('')
// const set = mangoStore.getState().set
- const router = useRouter()
+ // const router = useRouter()
// const { asPath } = router
const jupiterTokens = mangoStore((s) => s.jupiterTokens)
diff --git a/components/TopBar.tsx b/components/TopBar.tsx
index 1d4369b3..a45f3f84 100644
--- a/components/TopBar.tsx
+++ b/components/TopBar.tsx
@@ -1,11 +1,10 @@
import { useCallback, useState } from 'react'
-import { ArrowRightIcon } from '@heroicons/react/20/solid'
+import { ArrowLeftIcon, ArrowRightIcon } from '@heroicons/react/20/solid'
import { useTranslation } from 'next-i18next'
import mangoStore from '@store/mangoStore'
import WalletIcon from './icons/WalletIcon'
-import MangoAccountsList from './MangoAccountsList'
-import { LinkButton } from './shared/Button'
+import { IconButton, LinkButton } from './shared/Button'
import ConnectedMenu from './wallet/ConnectedMenu'
import { ConnectWalletButton } from './wallet/ConnectWalletButton'
import { IS_ONBOARDED_KEY } from '../utils/constants'
@@ -13,6 +12,7 @@ import useLocalStorageState from '../hooks/useLocalStorageState'
import UserSetupModal from './modals/UserSetupModal'
import CreateAccountModal from './modals/CreateAccountModal'
import MangoAccountsListModal from './modals/MangoAccountsListModal'
+import { useRouter } from 'next/router'
const TopBar = () => {
const { t } = useTranslation('common')
@@ -22,6 +22,8 @@ const TopBar = () => {
const [showUserSetupModal, setShowUserSetupModal] = useState(false)
const [showCreateAccountModal, setShowCreateAccountModal] = useState(false)
const [showMangoAccountsModal, setShowMangoAccountsModal] = useState(false)
+ const router = useRouter()
+ const { query } = router
const handleCloseModal = useCallback(() => {
setShowUserSetupModal(false)
@@ -34,7 +36,23 @@ const TopBar = () => {
return (
<>