Skip to content

Commit c1c7206

Browse files
committed
Organize routes
1 parent b8bb21a commit c1c7206

File tree

17 files changed

+94
-159
lines changed

17 files changed

+94
-159
lines changed

src/app/(auth)/(center)/layout.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/app/(auth)/dashboard/page.tsx

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/app/(auth)/layout.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.
File renamed without changes.

src/app/(auth)/dashboard/organization-profile/[[...organization-profile]]/page.tsx renamed to src/app/(authenticated)/dashboard/organization-profile/[[...organization-profile]]/page.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useTranslations } from 'next-intl';
33

44
import { TitleBar } from '@/components/dashboard/TitleBar';
55

6-
const OrganizationProfilePage = () => {
6+
export default function Page() {
77
const t = useTranslations('OrganizationProfile');
88

99
return (
@@ -26,6 +26,4 @@ const OrganizationProfilePage = () => {
2626
/>
2727
</>
2828
);
29-
};
30-
31-
export default OrganizationProfilePage;
29+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { useTranslations } from 'next-intl';
2+
3+
import { TitleBar } from '@/components/dashboard/TitleBar';
4+
5+
const DashboardIndexPage = () => {
6+
const t = useTranslations('DashboardIndex');
7+
8+
return (
9+
<>
10+
<TitleBar
11+
title={t('title_bar')}
12+
description={t('title_bar_description')}
13+
/>
14+
<div className="flex h-[600px] flex-col items-center justify-center rounded-md bg-card p-5">
15+
<div className="size-16 rounded-full bg-muted p-3 [&_svg]:stroke-muted-foreground [&_svg]:stroke-2">
16+
<svg
17+
xmlns="http://www.w3.org/2000/svg"
18+
viewBox="0 0 24 24"
19+
fill="none"
20+
strokeLinecap="round"
21+
strokeLinejoin="round"
22+
>
23+
<path d="M0 0h24v24H0z" stroke="none" />
24+
<path d="M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3M12 12l8-4.5M12 12v9M12 12L4 7.5" />
25+
</svg>
26+
</div>
27+
<div className="mt-3 text-center">
28+
<div className="text-xl font-semibold">
29+
{t('message_state_title')}
30+
</div>
31+
</div>
32+
</div>
33+
</>
34+
);
35+
};
36+
37+
export default DashboardIndexPage;

src/app/(auth)/dashboard/user-profile/[[...user-profile]]/page.tsx renamed to src/app/(authenticated)/dashboard/user-profile/[[...user-profile]]/page.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useTranslations } from 'next-intl';
33

44
import { TitleBar } from '@/components/dashboard/TitleBar';
55

6-
const UserProfilePage = () => {
6+
export default function Page() {
77
const t = useTranslations('UserProfile');
88

99
return (
@@ -12,19 +12,11 @@ const UserProfilePage = () => {
1212
title={t('title_bar')}
1313
description={t('title_bar_description')}
1414
/>
15-
1615
<UserProfile
1716
routing="path"
1817
path="/dashboard/user-profile"
19-
appearance={{
20-
elements: {
21-
rootBox: 'w-full',
22-
cardBox: 'w-full flex',
23-
},
24-
}}
18+
appearance={{ elements: { rootBox: 'w-full', cardBox: 'w-full flex' } }}
2519
/>
2620
</>
2721
);
28-
};
29-
30-
export default UserProfilePage;
22+
}

src/app/(authenticated)/layout.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { redirect } from 'next/navigation';
2+
import { auth as clerkAuth } from '@clerk/nextjs/server';
3+
4+
export default async function CenteredLayout({
5+
children,
6+
}: {
7+
children: React.ReactNode;
8+
}) {
9+
const auth = await clerkAuth();
10+
11+
if (!auth.userId) {
12+
redirect('/');
13+
}
14+
15+
return children;
16+
}

src/app/(auth)/onboarding/organization-selection/page.tsx renamed to src/app/(authenticated)/onboarding/organization-selection/page.tsx

File renamed without changes.

src/app/layout.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import '@/styles/globals.css';
33
import type { Metadata } from 'next';
44
import { NextIntlClientProvider } from 'next-intl';
55
import { getLocale } from 'next-intl/server';
6+
import { enUS, frFR } from '@clerk/localizations';
7+
import { ClerkProvider } from '@clerk/nextjs';
68

79
import { ThemeProvider } from '@/components/ThemeProvider';
810

@@ -45,7 +47,9 @@ export default async function RootLayout({
4547
enableSystem
4648
disableTransitionOnChange
4749
>
48-
{children}
50+
<ClerkProvider localization={locale === 'fr' ? frFR : enUS}>
51+
{children}
52+
</ClerkProvider>
4953
</ThemeProvider>
5054
</NextIntlClientProvider>
5155
</body>

0 commit comments

Comments
 (0)