diff --git a/components/Layout.tsx b/components/Layout.tsx
index 662e01c6..d6005bbb 100644
--- a/components/Layout.tsx
+++ b/components/Layout.tsx
@@ -8,7 +8,12 @@ import BottomBar from './mobile/BottomBar'
import BounceLoader from './shared/BounceLoader'
import TopBar from './TopBar'
import useLocalStorageState from '../hooks/useLocalStorageState'
-import { SIDEBAR_COLLAPSE_KEY } from '../utils/constants'
+import {
+ IS_ONBOARDED_KEY,
+ ONBOARDING_TOUR_KEY,
+ SIDEBAR_COLLAPSE_KEY,
+} from '../utils/constants'
+import OnboardingTour from './OnboardingTour'
const Layout = ({ children }: { children: ReactNode }) => {
const connected = mangoStore((s) => s.connected)
@@ -17,6 +22,8 @@ const Layout = ({ children }: { children: ReactNode }) => {
SIDEBAR_COLLAPSE_KEY,
false
)
+ const [showOnboardingTour] = useLocalStorageState(ONBOARDING_TOUR_KEY, false)
+ const [isOnboarded] = useLocalStorageState(IS_ONBOARDED_KEY)
const { width } = useViewport()
useEffect(() => {
@@ -77,6 +84,9 @@ const Layout = ({ children }: { children: ReactNode }) => {
+ {showOnboardingTour && isOnboarded && connected ? (
+
{t('accounts')}
- {mangoAccount.name} + {mangoAccount ? mangoAccount.name : 'No Accounts'}
Loading...
++ Create your first account 😎 +
)}{description}
+Health Check
++ {mangoAccount + ? mangoAccount.name + : connected + ? 'No Account' + : 'Connect'} +
+{t('account-value')}
{t('health')}
-{maintHealth}%
+{t('health')}
+{maintHealth}%
+{t('free-collateral')}
-- {mangoAccount - ? formatFixedDecimals( - toUiDecimalsForQuote( - mangoAccount.getCollateralValue()!.toNumber() - ), - true - ) - : (0).toFixed(2)} -
+{t('free-collateral')}
++ {mangoAccount + ? formatFixedDecimals( + toUiDecimalsForQuote( + mangoAccount.getCollateralValue()!.toNumber() + ), + true + ) + : (0).toFixed(2)} +
+{t('total-interest-value')}
{formatFixedDecimals(interestTotalValue, true)} diff --git a/components/account/HealthHeart.tsx b/components/account/HealthHeart.tsx index 10b24adc..10af6f70 100644 --- a/components/account/HealthHeart.tsx +++ b/components/account/HealthHeart.tsx @@ -1,4 +1,10 @@ -const HealthHeart = ({ health, size }: { health: number; size: number }) => { +const HealthHeart = ({ + health, + size, +}: { + health: number | undefined + size: number +}) => { const styles = { height: `${size}px`, width: `${size}px`, @@ -6,13 +12,16 @@ const HealthHeart = ({ health, size }: { health: number; size: number }) => { return (