diff --git a/components/Layout.tsx b/components/Layout.tsx index 160ce2a7..6fba87bd 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -20,13 +20,14 @@ import UserSetupModal from './modals/UserSetupModal' import { ConnectWalletButton } from './wallet/ConnectWalletButton' import ConnectedMenu from './wallet/ConnectedMenu' import WalletIcon from './icons/WalletIcon' +import BounceLoader from './shared/BounceLoader' export const IS_ONBOARDED_KEY = 'isOnboarded' const Layout = ({ children }: { children: ReactNode }) => { const mangoAccount = mangoStore((s) => s.mangoAccount.current) + const loadingMangoAccount = mangoStore((s) => s.mangoAccount.loading) const { t } = useTranslation('common') - const { connected } = useWallet() const [isCollapsed, setIsCollapsed] = useState(false) const { width } = useViewport() const isMobile = width ? width < breakpoints.md : false @@ -60,66 +61,75 @@ const Layout = ({ children }: { children: ReactNode }) => { } return ( -
-
- {isMobile ? ( -
- -
- ) : ( -
- -
- + <> + {loadingMangoAccount && isOnboarded ? ( +
+ +
+ ) : null} +
+
+ {isMobile ? ( +
+
-
- )} -
-
-
- + ) : ( +
+ +
+ +
+
+ )} +
+
+
+ + {mangoAccount ? ( + + ) : ( + + 🔗{t('connect-helper')} + + + )} + +
+
{mangoAccount ? ( - + + ) : isOnboarded ? ( + ) : ( - - 🔗{t('connect-helper')} - - + )} - +
-
- {mangoAccount ? ( - - ) : isOnboarded ? ( - - ) : ( - - )} +
+ {children}
-
- {children} -
{showUserSetupModal ? ( @@ -128,7 +138,7 @@ const Layout = ({ children }: { children: ReactNode }) => { onClose={handleCloseModal} /> ) : null} -
+ ) }