Front: Dark mode (#157)

This commit is contained in:
Arthur Jamet
2023-02-19 10:02:57 +00:00
committed by GitHub
parent 144d9bec5f
commit f5770cd104
22 changed files with 266 additions and 233 deletions
+4 -3
View File
@@ -6,16 +6,17 @@ import { RootState, useSelector } from "../state/Store";
type TranslateProps = {
translationKey: keyof typeof en;
format?: (translated: string) => string;
}
} & Parameters<typeof Text>[0];
/**
* Translation component
* @param param0
* @returns
*/
const Translate = ({ translationKey, format }: TranslateProps) => {
const Translate = ({ translationKey, format, ...props }: TranslateProps) => {
const selectedLanguage = useSelector((state: RootState) => state.language.value);
const translated = translate(translationKey, selectedLanguage);
return <Text>{format ? format(translated) : translated}</Text>;
return <Text {...props}>{format ? format(translated) : translated}</Text>;
}
export default Translate;