Skip to content

Commit 2a5df4c

Browse files
chore(swingset): add connected accounts live page
1 parent c8bfcd0 commit 2a5df4c

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

‎packages/swingset/src/app/(clerk)/live-sidebar.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
} from '@/components/ui/sidebar';
2020

2121
const flows = [
22+
{ title: 'Connected accounts', href: '/live/connected-accounts' },
2223
{ title: 'Delete account', href: '/live/delete-account' },
2324
{ title: 'Reverification', href: '/live/reverification' },
2425
];
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
'use client';
2+
3+
import { UserProfileConnectedAccountsSection } from '@clerk/mosaic/features/user-profile/user-profile-connected-accounts-section/user-profile-connected-accounts-section';
4+
import { MosaicProvider } from '@clerk/mosaic/MosaicProvider';
5+
import { useUser } from '@clerk/nextjs';
6+
import Link from 'next/link';
7+
8+
export default function ConnectedAccountsLivePage() {
9+
const { isLoaded, isSignedIn } = useUser();
10+
11+
return (
12+
<MosaicProvider>
13+
<div className='mx-auto flex w-full max-w-3xl flex-col gap-6 p-3 sm:p-8'>
14+
<div className='flex flex-col gap-1'>
15+
<h1 className='text-xl font-semibold'>Connected accounts</h1>
16+
<p className='text-muted-foreground text-sm'>
17+
Connects, reconnects, and removes the signed-in user&apos;s social accounts. The section stays hidden when
18+
no social provider is enabled.
19+
</p>
20+
</div>
21+
{!isLoaded ? <p className='text-muted-foreground text-sm'>Loading…</p> : null}
22+
{isLoaded && !isSignedIn ? (
23+
<p className='text-muted-foreground text-sm'>
24+
<Link
25+
href='/sign-in'
26+
className='text-foreground underline underline-offset-4'
27+
>
28+
Sign in
29+
</Link>{' '}
30+
to manage connected accounts.
31+
</p>
32+
) : null}
33+
{isLoaded && isSignedIn ? <UserProfileConnectedAccountsSection /> : null}
34+
</div>
35+
</MosaicProvider>
36+
);
37+
}

‎packages/swingset/src/stories/fixtures/user-profile.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { useDestructiveController } from '@clerk/mosaic/blocks/destructive/destructive.controller';
22
import type { UserProfileViewProps } from '@clerk/mosaic/features/user-profile/user-profile.view';
3-
import { UserProfileDeleteSectionView } from '@clerk/mosaic/features/user-profile/user-profile-delete-section/user-profile-delete-section.view';
43
import type {
54
UserProfilePaymentMethod,
65
UserProfileSubscription,
76
} from '@clerk/mosaic/features/user-profile/user-profile-billing-panel.view';
7+
import { UserProfileDeleteSectionView } from '@clerk/mosaic/features/user-profile/user-profile-delete-section/user-profile-delete-section.view';
88
import type {
99
UserProfileEmail,
1010
UserProfilePhone,

0 commit comments

Comments
 (0)