-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38a75e3
commit ac18768
Showing
9 changed files
with
103 additions
and
61 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
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,40 +1,17 @@ | ||
'use client'; | ||
import UserSessionCard from '@/components/settings/sessions/user-session-card'; | ||
import { Button } from '@/components/ui/button'; | ||
import useUserSessions from '@/lib/hooks/useUserSessions'; | ||
import React from 'react'; | ||
import UserSessionList from '@/components/settings/sessions/user-session-list'; | ||
|
||
export default function SessionsSettingsPage() { | ||
const userSessions = useUserSessions(); | ||
|
||
return ( | ||
<div className='space-y-6'> | ||
<div> | ||
<div className='flex h-full flex-col space-y-6'> | ||
<div className='flex flex-col'> | ||
<h3 className='text-lg font-medium'>Sessions</h3> | ||
<p className='text-sm text-muted-foreground'> | ||
Here are all the sessions that are currently active. Revoke any | ||
sessions that you do not recognize. | ||
</p> | ||
</div> | ||
<div className='flex flex-col gap-4'> | ||
{userSessions.data.pages.map((page, i) => ( | ||
<React.Fragment key={i}> | ||
{page.entities.map((userSession) => ( | ||
<UserSessionCard userSession={userSession} key={userSession.id} /> | ||
))} | ||
</React.Fragment> | ||
))} | ||
{userSessions.hasNextPage ? ( | ||
<Button | ||
className='w-full' | ||
variant='outline' | ||
onClick={() => userSessions.fetchNextPage()} | ||
disabled={userSessions.isFetchingNextPage} | ||
> | ||
{userSessions.isFetchingNextPage ? 'Loading more...' : 'Load More'} | ||
</Button> | ||
) : null} | ||
</div> | ||
<UserSessionList /> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use client'; | ||
import { Button } from '@/components/ui/button'; | ||
import useUserSessions from '@/lib/hooks/useUserSessions'; | ||
import React from 'react'; | ||
|
||
export default function PasskeysList() { | ||
const userSessions = useUserSessions(); | ||
|
||
return ( | ||
<div className='flex flex-col gap-4'> | ||
{userSessions.data.pages.map((page, i) => ( | ||
<React.Fragment key={i}> | ||
{page.entities.map((userSession) => ( | ||
<p key={userSession.id} /> | ||
))} | ||
</React.Fragment> | ||
))} | ||
{userSessions.hasNextPage ? ( | ||
<Button | ||
className='w-full' | ||
variant='outline' | ||
onClick={() => userSessions.fetchNextPage()} | ||
disabled={userSessions.isFetchingNextPage} | ||
> | ||
{userSessions.isFetchingNextPage ? 'Loading more...' : 'Load More'} | ||
</Button> | ||
) : null} | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use client'; | ||
import { Button } from '@/components/ui/button'; | ||
import useUserSessions from '@/lib/hooks/useUserSessions'; | ||
import React from 'react'; | ||
import UserSessionCard from './user-session-card'; | ||
|
||
export default function UserSessionList() { | ||
const userSessions = useUserSessions(); | ||
|
||
return ( | ||
<div className='flex h-full flex-1 flex-col gap-4'> | ||
{userSessions.data.pages.map((page, i) => ( | ||
<React.Fragment key={i}> | ||
{page.entities.map((userSession) => ( | ||
<UserSessionCard userSession={userSession} key={userSession.id} /> | ||
))} | ||
</React.Fragment> | ||
))} | ||
{userSessions.hasNextPage ? ( | ||
<Button | ||
className='w-full' | ||
variant='outline' | ||
onClick={() => userSessions.fetchNextPage()} | ||
disabled={userSessions.isFetchingNextPage} | ||
> | ||
{userSessions.isFetchingNextPage ? 'Loading more...' : 'Load More'} | ||
</Button> | ||
) : null} | ||
</div> | ||
); | ||
} |
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