Skip to content

Commit

Permalink
Fix signup button layout shift in incognito
Browse files Browse the repository at this point in the history
unfortunately this causes a flash for signed in users instead.
it takes 500 ms to tell whether a user is logged in,
we can choose to be optimistic for signed in xor signed out view,
or we can speed up this phase somehow
  • Loading branch information
sipec committed Nov 12, 2024
1 parent 0abb0ae commit 5ec831b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions web/components/nav/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ export default function Sidebar(props: {
>
<ManifoldLogo className="pb-3 pt-6" />

{/* causes jumping around in signed out sidebar */}
{/* {user === undefined && <div className="h-[56px]" />} */}

{user && !isMobile && <ProfileSummary user={user} className="mb-3" />}

<div className="mb-4 flex flex-col gap-1">
Expand All @@ -114,7 +111,7 @@ export default function Sidebar(props: {
setIsModalOpen={setIsModalOpen}
/>

{user === null && <SidebarSignUpButton />}
{!user && <SidebarSignUpButton />}

<Col className="gap-2">
{createMarketButton}
Expand All @@ -124,9 +121,7 @@ export default function Sidebar(props: {
<div
className={clsx('mb-6 mt-auto flex flex-col gap-1', isMobile && 'pb-8')}
>
{user !== null && (
<AppBadgesOrGetAppButton hideOnDesktop className="mb-2" />
)}
{!!user && <AppBadgesOrGetAppButton hideOnDesktop className="mb-2" />}
{bottomNavOptions.map((item) => (
<SidebarItem key={item.name} item={item} currentPage={currentPage} />
))}
Expand Down

0 comments on commit 5ec831b

Please sign in to comment.