Skip to content

Commit

Permalink
remove unreachable sign in button in user dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Sep 4, 2024
1 parent f042ad4 commit 169edee
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions app/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ export function TopBar({ children }: { children: React.ReactNode }) {
// fetch happens in loader wrapping all authed pages
const { me } = useCurrentUser()

const loggedIn = !!me

// toArray filters out nulls, which is essential because the silo/system
// picker is going to come in null when the user isn't supposed to see it
const [cornerPicker, ...otherPickers] = React.Children.toArray(children)
Expand Down Expand Up @@ -62,15 +60,9 @@ export function TopBar({ children }: { children: React.ReactNode }) {
</DropdownMenu.Trigger>
<DropdownMenu.Content align="end" sideOffset={8}>
<DropdownMenu.LinkItem to={pb.profile()}>Settings</DropdownMenu.LinkItem>
{loggedIn ? (
<DropdownMenu.Item onSelect={() => logout.mutate({})}>
Sign out
</DropdownMenu.Item>
) : (
<DropdownMenu.Item onSelect={() => navToLogin({ includeCurrent: true })}>
Sign In
</DropdownMenu.Item>
)}
<DropdownMenu.Item onSelect={() => logout.mutate({})}>
Sign out
</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu.Root>
</div>
Expand Down

0 comments on commit 169edee

Please sign in to comment.