Skip to content

Commit aee48a5

Browse files
committed
More cleanup
1 parent 4ea155c commit aee48a5

File tree

6 files changed

+15
-23
lines changed

6 files changed

+15
-23
lines changed

src/app/(auth)/layout.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@
22

33
import { enUS, frFR } from '@clerk/localizations';
44
import { ClerkProvider } from '@clerk/nextjs';
5+
import { useLocale } from 'next-intl';
56

6-
export default function AuthLayout(props: {
7+
export default function AuthLayout({
8+
children,
9+
}: {
710
children: React.ReactNode;
8-
params: { locale: string };
911
}) {
10-
let clerkLocale = enUS;
11-
12-
if (props.params.locale === 'fr') {
13-
clerkLocale = frFR;
14-
}
12+
const locale = useLocale();
1513

1614
return (
1715
<ClerkProvider
18-
localization={clerkLocale}
16+
localization={locale === 'fr' ? frFR : enUS}
1917
signInUrl="/sign-in"
2018
signUpUrl="/sign-up"
2119
signInFallbackRedirectUrl="/dashboard"
2220
signUpFallbackRedirectUrl="/dashboard"
2321
afterSignOutUrl="/"
2422
>
25-
{props.children}
23+
{children}
2624
</ClerkProvider>
2725
);
2826
}

src/components/landing/CenteredFooter.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { render, screen } from '@testing-library/react';
22
import { NextIntlClientProvider } from 'next-intl';
33

4-
import messages from '@/locales/en.json';
4+
import messages from '@/i18n/locales/en.json';
55

66
import { CenteredFooter } from './CenteredFooter';
77

@@ -10,7 +10,7 @@ describe('CenteredFooter', () => {
1010
it('should have copyright information', () => {
1111
render(
1212
<NextIntlClientProvider locale="en" messages={messages}>
13-
<CenteredFooter logo={null} name="" iconList={null} legalLinks={null}>
13+
<CenteredFooter iconList={null} legalLinks={null}>
1414
Random children
1515
</CenteredFooter>
1616
</NextIntlClientProvider>,

src/components/landing/CenteredFooter.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from 'react';
22

3+
import { APP_NAME } from '@/lib/constants';
4+
35
type CenteredFooterProps = {
4-
name: string;
56
iconList: React.ReactNode;
67
legalLinks: React.ReactNode;
78
children?: React.ReactNode;
89
};
910

1011
export const CenteredFooter = ({
11-
name,
1212
iconList,
1313
legalLinks,
1414
children,
@@ -24,7 +24,7 @@ export const CenteredFooter = ({
2424
</ul>
2525
<div className="mt-6 flex w-full items-center justify-between gap-y-2 border-t pt-3 text-sm text-muted-foreground max-md:flex-col">
2626
<div>
27-
© Copyright {new Date().getFullYear()} {name}.
27+
© Copyright {new Date().getFullYear()} {APP_NAME}.
2828
</div>
2929
<ul className="flex gap-x-4 font-medium [&_a:hover]:opacity-100 [&_a]:opacity-60">
3030
{legalLinks}

src/components/templates/Footer.tsx

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

44
import { CenteredFooter } from '@/components/landing/CenteredFooter';
55
import { Section } from '@/components/landing/Section';
6-
import { APP_CONFIG } from '@/lib/constants';
76

87
export const Footer = () => {
98
const t = useTranslations('Footer');
109

1110
return (
1211
<Section className="pb-16 pt-0">
1312
<CenteredFooter
14-
name={APP_CONFIG.name}
1513
iconList={
1614
<>
1715
<li>

src/components/templates/Logo.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { APP_CONFIG } from '@/lib/constants';
1+
import { APP_NAME } from '@/lib/constants';
22

33
export const Logo = () => (
4-
<div className="flex items-center text-xl font-semibold">
5-
{APP_CONFIG.name}
6-
</div>
4+
<div className="flex items-center text-xl font-semibold">{APP_NAME}</div>
75
);

src/lib/constants.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
export const APP_CONFIG = {
2-
name: 'Roo Code Cloud',
3-
};
1+
export const APP_NAME = 'Roo Code Cloud';

0 commit comments

Comments
 (0)