diff --git a/src/App.svelte b/src/App.svelte index 87c26f1..fe3f138 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -11,8 +11,8 @@ import { USD_CONVERSION_MARKETS } from '@lib/config' import { checkCountry, loadRoute, catchLinks, navigateTo } from '@lib/routing' import { component, address, pageName, countryDisallowed } from '@lib/stores' - import { hidePopoversOnKeydown, hidePopoversOnClick } from '@lib/ui' - import { runAndInterval, hashString, getChainData } from '@lib/utils' + import { hidePopoversOnKeydown, hidePopoversOnClick, showModal } from '@lib/ui' + import { runAndInterval, hashString, getChainData, getUserSetting } from '@lib/utils' import { getUserAssetBalances } from '@api/assets' import { listenToEvents } from '@api/listener' @@ -27,6 +27,10 @@ loadRoute(); catchLinks((path) => navigateTo(path)); + if (!getUserSetting('hasSeenWelcome')) { + showModal('Welcome'); + } + // For back button functionality window.onpopstate = () => loadRoute(); @@ -257,4 +261,4 @@
{/if} - \ No newline at end of file + diff --git a/src/components/header/Nav.svelte b/src/components/header/Nav.svelte index 514ad9d..4d4877b 100644 --- a/src/components/header/Nav.svelte +++ b/src/components/header/Nav.svelte @@ -5,11 +5,17 @@ import Rewards from './Rewards.svelte' import { pageName, showMobileNav } from '@lib/stores' + import { showModal } from '@lib/ui' import { TROPHY_ICON, BULLET_LIST_ICON } from '@lib/icons' function toggleMobileNav() { showMobileNav.set(!$showMobileNav); } + + function openWelcome() { + showMobileNav.set(false); + showModal('Welcome'); + } @@ -121,6 +127,7 @@ Trade Pool Stake + Help @@ -132,6 +139,7 @@ Trade Pool Stake + Help Docs {/if} @@ -140,4 +148,4 @@ {@html BULLET_LIST_ICON} - \ No newline at end of file + diff --git a/src/components/layout/Modals.svelte b/src/components/layout/Modals.svelte index 03b829d..3acd1b8 100644 --- a/src/components/layout/Modals.svelte +++ b/src/components/layout/Modals.svelte @@ -14,9 +14,14 @@ import UnstakeCAP from '../modals/UnstakeCAP.svelte' import HistoryOrderStatus from '../modals/HistoryOrderStatus.svelte' import Settings from '../modals/Settings.svelte' + import Welcome from '../modals/Welcome.svelte' +{#if $activeModal && $activeModal.name == 'Welcome'} + +{/if} + {#if $activeModal && $activeModal.name == 'Settings'} {/if} @@ -67,4 +72,4 @@ {#if $activeModal && $activeModal.name == 'MarketInfo'} -{/if} \ No newline at end of file +{/if} diff --git a/src/components/modals/Welcome.svelte b/src/components/modals/Welcome.svelte new file mode 100644 index 0000000..2b0a4b1 --- /dev/null +++ b/src/components/modals/Welcome.svelte @@ -0,0 +1,121 @@ + + + + + +
+
+ CAP is a decentralized trading dashboard for perpetual markets and liquidity pools on Arbitrum. +
+ +
+
+
1. Connect a wallet
+
Use an Arbitrum wallet to trade, provide liquidity, stake CAP, and view account activity.
+
+
+
2. Bridge funds to Arbitrum
+
Bridge ETH or supported collateral before trading. Keep ETH available for gas.
+
+
+
3. Start from the dashboard
+
Trade opens markets, Pool manages liquidity, and Stake manages CAP staking.
+
+
+ + + +
+ You can reopen this guide from Help in the navigation. +
+
+