-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth-client): Moved all components to components import path
- Loading branch information
1 parent
67fa0a0
commit 949078d
Showing
7 changed files
with
28 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...packages/auth-client/src/AuthProvider.tsx → ...th-client/src/components/AuthProvider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
'use client'; | ||
|
||
import { useContext } from 'react'; | ||
import { Modal } from '@signalco/ui-primitives/Modal'; | ||
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@signalco/ui-primitives/Menu'; | ||
import { IconButton } from '@signalco/ui-primitives/IconButton'; | ||
import { Button } from '@signalco/ui-primitives/Button'; | ||
import { Avatar } from '@signalco/ui-primitives/Avatar'; | ||
import { User } from '@signalco/ui-icons'; | ||
import { LogOut, User } from '@signalco/ui-icons'; | ||
import { AuthContext } from '../AuthContext'; | ||
|
||
export function UserButton() { | ||
const authContext = useContext(AuthContext); | ||
return ( | ||
<Modal trigger={( | ||
<IconButton> | ||
<Avatar> | ||
<User /> | ||
</Avatar> | ||
</IconButton> | ||
)}> | ||
<Button href={authContext.urls?.signOut ?? '/signout'}>Sign Out</Button> | ||
</Modal> | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<IconButton className="rounded-full"> | ||
<Avatar className="bg-transparent"> | ||
<User /> | ||
</Avatar> | ||
</IconButton> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent align="end"> | ||
<DropdownMenuItem href={authContext.urls?.signOut ?? '/sign-out'} startDecorator={<LogOut />}> | ||
Sign out | ||
</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
'use client'; | ||
|
||
export * from './useCurrentUser'; | ||
export * from './AuthProtectedSection'; | ||
export * from './AuthProvider'; | ||
export * from './useCurrentUser'; |