Skip to content

Commit

Permalink
change the root page to user page when user is logged in (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoncalves authored Sep 16, 2024
1 parent 237a830 commit 7cd6bb8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
'use client'
import { useAccount } from 'wagmi'
import { Login } from './login'
import User from './user/page'

export default function Home() {
const { isConnected } = useAccount()
if (isConnected) {
return <User />
}
return <Login />
}
6 changes: 3 additions & 3 deletions src/components/LeftSidebar/SidebarButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ const DEFAULT_BUTTON_CLASSNAME = 'mb-[32px] pl-11'
const START_ICON_CLASSES = 'left-[-28px] top-[2px]'

export const SidebarButtons = ({ onClick, activeButton = 'communities' }: SidebarButtonsProps) => (
<div>
<>
<Button
startIcon={<ImageAsIcon src="/images/sidemenu/user.svg" alt="User" />}
onClick={() => onClick?.('user')}
fullWidth
variant={activeButton.startsWith('user') ? 'primary' : 'borderless'}
variant={!activeButton || activeButton.startsWith('user') ? 'primary' : 'borderless'}
centerContent={false}
className={DEFAULT_BUTTON_CLASSNAME}
buttonProps={{ id: 'Button_User', name: 'user' }}
Expand Down Expand Up @@ -60,5 +60,5 @@ export const SidebarButtons = ({ onClick, activeButton = 'communities' }: Sideba
>
Communities
</Button>
</div>
</>
)
4 changes: 0 additions & 4 deletions src/pages/proposals/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,6 @@ const BreadcrumbSection: FC<{ title: string }> = ({ title }) => {
return (
<Breadcrumb className="pb-4 border-b">
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink href="/">Home</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbLink href="/proposals">Proposals</BreadcrumbLink>
</BreadcrumbItem>
Expand Down

0 comments on commit 7cd6bb8

Please sign in to comment.