fix: fix interactions
This commit is contained in:
parent
65ff38f117
commit
1c3e4de4dd
@ -13,7 +13,7 @@ export default function Wallet() {
|
||||
const address = useStore((s) => s.address)
|
||||
|
||||
useEffect(() => {
|
||||
if (address) return
|
||||
if (address && address === currentWallet?.account.address) return
|
||||
useStore.setState({
|
||||
address: undefined,
|
||||
userDomain: undefined,
|
||||
|
@ -47,7 +47,7 @@ export default function AccountBalancesTable(props: Props) {
|
||||
|
||||
const columns = useAccountBalancesColumns(account, showLiquidationPrice)
|
||||
|
||||
if (accountBalanceData.length === 0)
|
||||
if (accountBalanceData.length === 0 && account.id !== address)
|
||||
return (
|
||||
<ConditionalWrapper
|
||||
condition={!hideCard}
|
||||
|
@ -50,7 +50,7 @@ export default function AccountDetailsController() {
|
||||
|
||||
const account = isV1 && page !== 'trade' ? v1Account : currentAccount
|
||||
const focusComponent = useStore((s) => s.focusComponent)
|
||||
const isOwnAccount = accountId && accountIds?.includes(accountId)
|
||||
const isOwnAccount = (accountId && accountIds?.includes(accountId)) || account?.id === address
|
||||
const hideAccountDetails =
|
||||
!address || focusComponent || !isOwnAccount || isHLS || page.includes('portfolio')
|
||||
const isLoadingAccountDetails = (isLoading && accountId && !focusComponent) || !account
|
||||
|
@ -1,47 +0,0 @@
|
||||
import Card from 'components/common/Card'
|
||||
import { Cross, ExclamationMarkCircled } from 'components/common/Icons'
|
||||
import Text from 'components/common/Text'
|
||||
import { TextLink } from 'components/common/TextLink'
|
||||
import { DEFAULT_SETTINGS } from 'constants/defaultSettings'
|
||||
import { LocalStorageKeys } from 'constants/localStorageKeys'
|
||||
import useLocalStorage from 'hooks/localStorage/useLocalStorage'
|
||||
import useStore from 'store'
|
||||
import { DocURL } from 'types/enums/docURL'
|
||||
|
||||
export default function MigrationBanner() {
|
||||
const [_, setMigrationBanner] = useLocalStorage<boolean>(
|
||||
LocalStorageKeys.MIGRATION_BANNER,
|
||||
DEFAULT_SETTINGS.migrationBanner,
|
||||
)
|
||||
|
||||
const showMigrationBanner = useStore((s) => s.migrationBanner)
|
||||
|
||||
if (!showMigrationBanner) return null
|
||||
return (
|
||||
<Card
|
||||
className='relative w-full bg-info-bg/20 text-info'
|
||||
contentClassName='flex w-full gap-2 px-4 py-3 items-center'
|
||||
>
|
||||
<div className='flex w-6 h-6 p-1 text-white rounded bg-info'>
|
||||
<ExclamationMarkCircled />
|
||||
</div>
|
||||
<Text className='flex flex-grow' size='sm'>
|
||||
If you have funds on{' '}
|
||||
<TextLink
|
||||
href={DocURL.V1_URL}
|
||||
externalLink
|
||||
className='mx-1 text-white no-underline hover:underline'
|
||||
>
|
||||
Mars v1,
|
||||
</TextLink>
|
||||
please withdraw them and deposit them on Mars v2 to migrate.
|
||||
</Text>
|
||||
<div
|
||||
className='absolute right-0 flex items-center h-full px-4 w-11 opacity-80 hover:cursor-pointer hover:opacity-100'
|
||||
onClick={() => setMigrationBanner(false)}
|
||||
>
|
||||
<Cross className='w-3 h-3' />
|
||||
</div>
|
||||
</Card>
|
||||
)
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
import MigrationBanner from 'components/common/MigrationBanner'
|
||||
import Tab from 'components/common/Tab'
|
||||
import FarmIntro from 'components/farm/FarmIntro'
|
||||
import Vaults from 'components/farm/Vaults'
|
||||
@ -7,7 +6,6 @@ import { LEND_AND_BORROW_TABS } from 'constants/pages'
|
||||
export default function FarmPage() {
|
||||
return (
|
||||
<div className='flex flex-wrap w-full gap-6'>
|
||||
<MigrationBanner />
|
||||
<Tab tabs={LEND_AND_BORROW_TABS} activeTabIdx={2} showV1Toggle />
|
||||
<FarmIntro />
|
||||
<Vaults />
|
||||
|
@ -1,4 +1,3 @@
|
||||
import MigrationBanner from 'components/common/MigrationBanner'
|
||||
import Tab from 'components/common/Tab'
|
||||
import AvailableHLSVaults from 'components/hls/Farm/AvailableHLSVaults'
|
||||
import HlsFarmIntro from 'components/hls/Farm/HLSFarmIntro'
|
||||
@ -7,7 +6,6 @@ import { HLS_TABS } from 'constants/pages'
|
||||
export default function HLSFarmPage() {
|
||||
return (
|
||||
<div className='flex flex-wrap w-full gap-6'>
|
||||
<MigrationBanner />
|
||||
<Tab tabs={HLS_TABS} activeTabIdx={1} />
|
||||
<HlsFarmIntro />
|
||||
<AvailableHLSVaults />
|
||||
|
@ -1,4 +1,3 @@
|
||||
import MigrationBanner from 'components/common/MigrationBanner'
|
||||
import Tab from 'components/common/Tab'
|
||||
import ActiveStakingAccounts from 'components/hls/Staking/ActiveStakingAccounts'
|
||||
import AvailableHlsStakingAssets from 'components/hls/Staking/AvailableHLSStakingAssets'
|
||||
@ -8,7 +7,6 @@ import { HLS_TABS } from 'constants/pages'
|
||||
export default function HLSStakingPage() {
|
||||
return (
|
||||
<div className='flex flex-wrap w-full gap-6'>
|
||||
<MigrationBanner />
|
||||
<Tab tabs={HLS_TABS} activeTabIdx={0} />
|
||||
<HLSStakingIntro />
|
||||
<AvailableHlsStakingAssets />
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { useNavigate, useParams, useSearchParams } from 'react-router-dom'
|
||||
|
||||
import MigrationBanner from 'components/common/MigrationBanner'
|
||||
import ShareBar from 'components/common/ShareBar'
|
||||
import Balances from 'components/portfolio/Account/Balances'
|
||||
import BreadCrumbs from 'components/portfolio/Account/BreadCrumbs'
|
||||
@ -25,7 +24,6 @@ export default function PortfolioAccountPage() {
|
||||
|
||||
return (
|
||||
<div className='flex flex-wrap w-full gap-6'>
|
||||
<MigrationBanner />
|
||||
<BreadCrumbs accountId={accountId} />
|
||||
<Summary accountId={accountId} />
|
||||
<Balances accountId={accountId} />
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { useParams } from 'react-router-dom'
|
||||
|
||||
import MigrationBanner from 'components/common/MigrationBanner'
|
||||
import ShareBar from 'components/common/ShareBar'
|
||||
import Summary from 'components/portfolio/Account/Summary'
|
||||
import AccountOverview from 'components/portfolio/Overview'
|
||||
@ -11,7 +10,6 @@ export default function PortfolioPage() {
|
||||
const { address } = useParams()
|
||||
return (
|
||||
<div className='flex flex-wrap w-full gap-6'>
|
||||
<MigrationBanner />
|
||||
<PortfolioIntro />
|
||||
<PortfolioSummary />
|
||||
{address && <Summary accountId={address} v1 />}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { useMemo } from 'react'
|
||||
import { useLocation } from 'react-router-dom'
|
||||
|
||||
import MigrationBanner from 'components/common/MigrationBanner'
|
||||
import AccountDetailsCard from 'components/trade/AccountDetailsCard'
|
||||
import TradeChart from 'components/trade/TradeChart'
|
||||
import TradeModule from 'components/trade/TradeModule'
|
||||
@ -47,7 +46,6 @@ export default function TradePage() {
|
||||
)
|
||||
return (
|
||||
<div className='flex flex-col w-full h-full gap-4'>
|
||||
<MigrationBanner />
|
||||
<div className='grid w-full grid-cols-[auto_346px] gap-4'>
|
||||
<TradeChart buyAsset={buyAsset} sellAsset={sellAsset} />
|
||||
<TradeModule buyAsset={buyAsset} sellAsset={sellAsset} isAdvanced={isAdvanced} />
|
||||
|
Loading…
Reference in New Issue
Block a user