Skip to content

Commit d50bdef

Browse files
committed
fix
1 parent 5690101 commit d50bdef

4 files changed

Lines changed: 21 additions & 35 deletions

File tree

src/app/[locale]/(private)/dashboard/_components/DashboardContent.tsx

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -92,28 +92,23 @@ export default function DashboardContent({
9292
void mutateUserCatalogs();
9393
}, [mutateUserCatalogs]);
9494

95-
const catalogFormSchema = useMemo(
96-
() =>
97-
z.object({
98-
name: z
99-
.string()
100-
.min(3, translation("form.validation.name.minLength"))
101-
.max(255, translation("form.validation.name.maxLength")),
102-
}),
103-
[translation]
104-
);
95+
const catalogFormSchema = useMemo(() => {
96+
return z.object({
97+
name: z
98+
.string()
99+
.min(3, translation("form.validation.name.minLength"))
100+
.max(255, translation("form.validation.name.maxLength")),
101+
});
102+
}, [translation]);
105103

106-
const handleModalOpenChange = useCallback(
107-
(nextIsOpen: boolean) => {
108-
setIsFormOpen(nextIsOpen);
104+
const handleModalOpenChange = useCallback((nextIsOpen: boolean) => {
105+
setIsFormOpen(nextIsOpen);
109106

110-
if (!nextIsOpen) {
111-
setEditingCatalog(null);
112-
setFormMode("create");
113-
}
114-
},
115-
[]
116-
);
107+
if (!nextIsOpen) {
108+
setEditingCatalog(null);
109+
setFormMode("create");
110+
}
111+
}, []);
117112

118113
const handleFormSubmit = useCallback(
119114
async (values: CreateCatalogCommand | UpdateCatalogCommand) => {
@@ -264,7 +259,7 @@ export default function DashboardContent({
264259
isOpen={isFormOpen}
265260
onOpenChange={handleModalOpenChange}
266261
onSubmit={handleFormSubmit}
267-
initialData={formMode === "edit" ? editingCatalog ?? undefined : undefined}
262+
initialData={formMode === "edit" ? (editingCatalog ?? undefined) : undefined}
268263
texts={{
269264
titleCreate: translation("form.create.title"),
270265
titleEdit: translation("form.edit.title"),

src/app/layout.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
import { ThemeProvider } from "@/components/theme-provider";
2-
import { FALLBACK_LOCALE, isSupportedLocale } from "@/lib/i18n/locales";
2+
import { FALLBACK_LOCALE } from "@/lib/i18n/locales";
33
import "@/styles/globals.css";
44
import type { ReactNode } from "react";
55

66
interface RootLayoutProps {
77
children: ReactNode;
8-
params: {
9-
locale?: string;
10-
};
118
}
129

13-
export default function RootLayout({ children, params }: RootLayoutProps) {
14-
const locale = isSupportedLocale(params.locale) ? params.locale : FALLBACK_LOCALE;
15-
10+
export default function RootLayout({ children }: RootLayoutProps) {
1611
return (
17-
<html lang={locale} suppressHydrationWarning>
12+
<html lang={FALLBACK_LOCALE} suppressHydrationWarning>
1813
<body className="min-h-screen bg-background font-sans antialiased">
1914
<ThemeProvider>{children}</ThemeProvider>
2015
</body>

src/components/ui/button.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ const buttonVariants = cva(
3232
);
3333

3434
export interface ButtonProps
35-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
36-
VariantProps<typeof buttonVariants> {
35+
extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
3736
asChild?: boolean;
3837
}
3938

src/features/auth/validation.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ const createEmailSchema = (messages: EmailValidationMessages) =>
3333
z.string().trim().min(1, { message: messages.required }).email({ message: messages.invalid });
3434

3535
const createPasswordSchema = (messages: PasswordValidationMessages) =>
36-
z
37-
.string()
38-
.min(1, { message: messages.required })
39-
.min(8, { message: messages.minLength });
36+
z.string().min(1, { message: messages.required }).min(8, { message: messages.minLength });
4037

4138
const createConfirmPasswordSchema = (messages: ConfirmPasswordValidationMessages) =>
4239
z.string().min(1, { message: messages.required });

0 commit comments

Comments
 (0)