Refactors useLocale (#908)
* Removes unused component * Refactors useLocale We don't need to pass the locale prop everywhere * Fixes syntax error * Adds warning for missing localeProps * Simplify i18n utils * Update components/I18nLanguageHandler.tsx Co-authored-by: Mihai C <[email protected]> * Type fixes Co-authored-by: Mihai C <[email protected]>
This commit is contained in:
1 parent
7dd6fdde7a
commit
cfd70172f0
35 files changed
+366
-440
No files matched your search
@@ -9,7 +9,6 @@ import { DialogClose, DialogContent } from "@components/Dialog";
|
||||
import { Button } from "@components/ui/Button";
|
||||
|
||||
export type ConfirmationDialogContentProps = {
|
||||
localeProp: string;
|
||||
confirmBtnText?: string;
|
||||
cancelBtnText?: string;
|
||||
onConfirm?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||
@@ -18,7 +17,7 @@ export type ConfirmationDialogContentProps = {
|
||||
};
|
||||
|
||||
export default function ConfirmationDialogContent(props: PropsWithChildren<ConfirmationDialogContentProps>) {
|
||||
const { t } = useLocale({ localeProp: props.localeProp });
|
||||
const { t } = useLocale();
|
||||
const {
|
||||
title,
|
||||
variety,
|
||||
|
||||
Reference in new issue
Block a user