File tree Expand file tree Collapse file tree 6 files changed +15
-23
lines changed
Expand file tree Collapse file tree 6 files changed +15
-23
lines changed Original file line number Diff line number Diff line change 22
33import { enUS , frFR } from '@clerk/localizations' ;
44import { 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}
Original file line number Diff line number Diff line change 11import { render , screen } from '@testing-library/react' ;
22import { NextIntlClientProvider } from 'next-intl' ;
33
4- import messages from '@/locales/en.json' ;
4+ import messages from '@/i18n/ locales/en.json' ;
55
66import { 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 > ,
Original file line number Diff line number Diff line change 11import React from 'react' ;
22
3+ import { APP_NAME } from '@/lib/constants' ;
4+
35type CenteredFooterProps = {
4- name : string ;
56 iconList : React . ReactNode ;
67 legalLinks : React . ReactNode ;
78 children ?: React . ReactNode ;
89} ;
910
1011export 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 }
Original file line number Diff line number Diff line change @@ -3,15 +3,13 @@ import { useTranslations } from 'next-intl';
33
44import { CenteredFooter } from '@/components/landing/CenteredFooter' ;
55import { Section } from '@/components/landing/Section' ;
6- import { APP_CONFIG } from '@/lib/constants' ;
76
87export 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 >
Original file line number Diff line number Diff line change 1- import { APP_CONFIG } from '@/lib/constants' ;
1+ import { APP_NAME } from '@/lib/constants' ;
22
33export 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) ;
Original file line number Diff line number Diff line change 1- export const APP_CONFIG = {
2- name : 'Roo Code Cloud' ,
3- } ;
1+ export const APP_NAME = 'Roo Code Cloud' ;
You can’t perform that action at this time.
0 commit comments