More cleanup

This commit is contained in:
cte 2025-05-11 23:01:36 -07:00
parent 4ea155cf33
commit aee48a55a0
6 changed files with 15 additions and 23 deletions

View file

@ -2,27 +2,25 @@
import { enUS, frFR } from '@clerk/localizations';
import { ClerkProvider } from '@clerk/nextjs';
import { useLocale } from 'next-intl';
export default function AuthLayout(props: {
export default function AuthLayout({
children,
}: {
children: React.ReactNode;
params: { locale: string };
}) {
let clerkLocale = enUS;
if (props.params.locale === 'fr') {
clerkLocale = frFR;
}
const locale = useLocale();
return (
<ClerkProvider
localization={clerkLocale}
localization={locale === 'fr' ? frFR : enUS}
signInUrl="/sign-in"
signUpUrl="/sign-up"
signInFallbackRedirectUrl="/dashboard"
signUpFallbackRedirectUrl="/dashboard"
afterSignOutUrl="/"
>
{props.children}
{children}
</ClerkProvider>
);
}

View file

@ -1,7 +1,7 @@
import { render, screen } from '@testing-library/react';
import { NextIntlClientProvider } from 'next-intl';
import messages from '@/locales/en.json';
import messages from '@/i18n/locales/en.json';
import { CenteredFooter } from './CenteredFooter';
@ -10,7 +10,7 @@ describe('CenteredFooter', () => {
it('should have copyright information', () => {
render(
<NextIntlClientProvider locale="en" messages={messages}>
<CenteredFooter logo={null} name="" iconList={null} legalLinks={null}>
<CenteredFooter iconList={null} legalLinks={null}>
Random children
</CenteredFooter>
</NextIntlClientProvider>,

View file

@ -1,14 +1,14 @@
import React from 'react';
import { APP_NAME } from '@/lib/constants';
type CenteredFooterProps = {
name: string;
iconList: React.ReactNode;
legalLinks: React.ReactNode;
children?: React.ReactNode;
};
export const CenteredFooter = ({
name,
iconList,
legalLinks,
children,
@ -24,7 +24,7 @@ export const CenteredFooter = ({
</ul>
<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">
<div>
© Copyright {new Date().getFullYear()} {name}.
© Copyright {new Date().getFullYear()} {APP_NAME}.
</div>
<ul className="flex gap-x-4 font-medium [&_a:hover]:opacity-100 [&_a]:opacity-60">
{legalLinks}

View file

@ -3,7 +3,6 @@ import { useTranslations } from 'next-intl';
import { CenteredFooter } from '@/components/landing/CenteredFooter';
import { Section } from '@/components/landing/Section';
import { APP_CONFIG } from '@/lib/constants';
export const Footer = () => {
const t = useTranslations('Footer');
@ -11,7 +10,6 @@ export const Footer = () => {
return (
<Section className="pb-16 pt-0">
<CenteredFooter
name={APP_CONFIG.name}
iconList={
<>
<li>

View file

@ -1,7 +1,5 @@
import { APP_CONFIG } from '@/lib/constants';
import { APP_NAME } from '@/lib/constants';
export const Logo = () => (
<div className="flex items-center text-xl font-semibold">
{APP_CONFIG.name}
</div>
<div className="flex items-center text-xl font-semibold">{APP_NAME}</div>
);

View file

@ -1,3 +1 @@
export const APP_CONFIG = {
name: 'Roo Code Cloud',
};
export const APP_NAME = 'Roo Code Cloud';