Skip to content

Commit

Permalink
remove user footer
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlovin committed Jun 14, 2024
1 parent 98a1921 commit cfb57a1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 65 deletions.
63 changes: 0 additions & 63 deletions src/components/Sidebar/UserFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,66 +19,3 @@ function Container(props) {
/>
)
}

export function UserFooter() {
const { data, loading, error } = useViewerQuery()
const { setIsOpen } = React.useContext(GlobalNavigationContext)

function signInButton() {
return (
<GhostButton
onClick={() =>
authik.loginWithTwitter({ returnTo: window.location.pathname })
}
style={{ width: '100%' }}
>
Sign in
</GhostButton>
)
}

if (loading) {
return (
<Container>
<div className="flex items-center justify-center w-full py-1">
<LoadingSpinner />
</div>
</Container>
)
}

if (error) {
return <Container>{signInButton()}</Container>
}

if (data?.viewer) {
return (
<Container>
<Link
href={`/u/${data.viewer.username}`}
onClick={() => setIsOpen(false)}
className="flex items-center flex-none rounded-full"
>
<Avatar
user={data.viewer}
src={data.viewer.avatar}
width={24}
height={24}
layout="fixed"
className="rounded-full"
/>
</Link>
<GhostButton
aria-label="Manage settings"
onClick={() => setIsOpen(false)}
size="small-square"
href="/settings"
>
<Settings size={16} />
</GhostButton>
</Container>
)
}

return <Container>{signInButton()}</Container>
}
2 changes: 0 additions & 2 deletions src/components/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { GlobalNavigationContext } from '~/components/Providers'

import { SidebarNavigation } from './Navigation'
import { SidebarOverlay } from './Overlay'
import { UserFooter } from './UserFooter'

export function Sidebar() {
const { isOpen } = React.useContext(GlobalNavigationContext)
Expand All @@ -26,7 +25,6 @@ export function Sidebar() {
title="Brian Lovin"
/>
<SidebarNavigation />
<UserFooter />
</nav>

<SidebarOverlay />
Expand Down

0 comments on commit cfb57a1

Please sign in to comment.