diff options
author | Alex Benzer <abenzer@users.noreply.github.com> | 2025-09-04 07:20:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-04 07:20:46 -0700 |
commit | 625b4e61dbf11c1d485bf8e8265df4d5af0c9657 (patch) | |
tree | 8d36b6564cb2b679269dea4b1fc3a8d3887d2fd2 /src/view/shell | |
parent | 0b02d9d9a7ca33dab256a35e4fc9b8feabe20d34 (diff) | |
download | voidsky-625b4e61dbf11c1d485bf8e8265df4d5af0c9657.tar.zst |
Welcome modal on logged-out homepage (#8944)
* Adds welcome modal to logged-out homepage * Adds metrics and feature gate for welcome modal * Slightly smaller text for mobile screens to avoid wrapping * Remove unused SVG * Adds text gradient and "X" close button * Fix color on "Already have an account?" text * tweak hooks, react import * rm stylesheet * use hardcoded colors * add focus guards and scope * no such thing as /home * reduce spacign * use css animations * use session storage * fix animation fill mode * add a11y props * Fix link/button color mismatch, reduce gap between buttons, show modal until user dismisses it * Fix "Already have an account?" line left-aligning in small window sizes * Adds "dismissed" and "presented" metric events --------- Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'src/view/shell')
-rw-r--r-- | src/view/shell/index.web.tsx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/view/shell/index.web.tsx b/src/view/shell/index.web.tsx index f942ab49e..bb09b5f62 100644 --- a/src/view/shell/index.web.tsx +++ b/src/view/shell/index.web.tsx @@ -8,6 +8,7 @@ import {RemoveScrollBar} from 'react-remove-scroll-bar' import {useIntentHandler} from '#/lib/hooks/useIntentHandler' import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {type NavigationProp} from '#/lib/routes/types' +import {useGate} from '#/lib/statsig/statsig' import {useGeolocation} from '#/state/geolocation' import {useIsDrawerOpen, useSetDrawerOpen} from '#/state/shell' import {useComposerKeyboardShortcut} from '#/state/shell/composer/useComposerKeyboardShortcut' @@ -22,11 +23,13 @@ import {EmailDialog} from '#/components/dialogs/EmailDialog' import {LinkWarningDialog} from '#/components/dialogs/LinkWarning' import {MutedWordsDialog} from '#/components/dialogs/MutedWords' import {SigninDialog} from '#/components/dialogs/Signin' +import {useWelcomeModal} from '#/components/hooks/useWelcomeModal' import { Outlet as PolicyUpdateOverlayPortalOutlet, usePolicyUpdateContext, } from '#/components/PolicyUpdateOverlay' import {Outlet as PortalOutlet} from '#/components/Portal' +import {WelcomeModal} from '#/components/WelcomeModal' import {FlatNavigator, RoutesContainer} from '#/Navigation' import {Composer} from './Composer.web' import {DrawerContent} from './Drawer' @@ -42,6 +45,8 @@ function ShellInner() { const showDrawer = !isDesktop && isDrawerOpen const [showDrawerDelayedExit, setShowDrawerDelayedExit] = useState(showDrawer) const {state: policyUpdateState} = usePolicyUpdateContext() + const welcomeModalControl = useWelcomeModal() + const gate = useGate() useLayoutEffect(() => { if (showDrawer !== showDrawerDelayedExit) { @@ -80,6 +85,11 @@ function ShellInner() { <LinkWarningDialog /> <Lightbox /> + {/* Show welcome modal if the gate is enabled */} + {welcomeModalControl.isOpen && gate('welcome_modal') && ( + <WelcomeModal control={welcomeModalControl} /> + )} + {/* Until policy update has been completed by the user, don't render anything that is portaled */} {policyUpdateState.completed && ( <> |