only show insufficient sol message if connected
This commit is contained in:
parent
157bc3c176
commit
3ec735f2e9
|
@ -110,7 +110,7 @@ const MobileTradePage = () => {
|
|||
<Swipeable index={viewIndex} onChangeIndex={handleChangeViewIndex}>
|
||||
<div>
|
||||
<div className="mb-2 grid grid-cols-12 grid-rows-1 gap-4 rounded-lg py-2">
|
||||
<div className="col-span-7 pt-2">
|
||||
<div className="col-span-7">
|
||||
<AdvancedTradeForm />
|
||||
</div>
|
||||
<div className="col-span-5">
|
||||
|
|
|
@ -149,7 +149,9 @@ export default function AdvancedTradeForm({
|
|||
|
||||
useEffect(() => {
|
||||
const walletSol = walletTokens.find((a) => a.config.symbol === 'SOL')
|
||||
walletSol ? setInsufficientSol(walletSol.uiBalance < 0.01) : null
|
||||
walletSol && connected
|
||||
? setInsufficientSol(walletSol.uiBalance < 0.01)
|
||||
: null
|
||||
}, [walletTokens])
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -760,7 +762,7 @@ export default function AdvancedTradeForm({
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-full flex-col">
|
||||
<div>
|
||||
<ElementTitle className="hidden md:flex">
|
||||
{marketConfig.name}
|
||||
<span className="ml-2 rounded border border-th-primary px-1 py-0.5 text-xs text-th-primary">
|
||||
|
@ -768,7 +770,7 @@ export default function AdvancedTradeForm({
|
|||
</span>
|
||||
</ElementTitle>
|
||||
{insufficientSol ? (
|
||||
<div className="pb-3 text-left">
|
||||
<div className="mb-3 text-left">
|
||||
<InlineNotification desc={t('add-more-sol')} type="warning" />
|
||||
</div>
|
||||
) : null}
|
||||
|
|
|
@ -18,7 +18,7 @@ const OrderSideTabs: FunctionComponent<OrderSideTabsProps> = ({
|
|||
const { t } = useTranslation('common')
|
||||
const market = useMangoStore((s) => s.selectedMarket.current)
|
||||
return (
|
||||
<div className={`relative mb-3 -mt-2.5 md:border-b md:border-th-fgd-4`}>
|
||||
<div className={`relative mb-3 md:-mt-2.5 md:border-b md:border-th-fgd-4`}>
|
||||
<div
|
||||
className={`absolute hidden md:block ${
|
||||
side === 'buy'
|
||||
|
|
Loading…
Reference in New Issue