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
+24
View File
@@ -0,0 +1,24 @@
import { Button, Text } from "native-base"
import Translate from "./Translate";
import { RequireExactlyOne } from 'type-fest';
type TextButtonProps = Parameters<typeof Button>[0] & RequireExactlyOne<{
label: string;
translate: Parameters<typeof Translate>[0];
}>
const TextButton = (props: TextButtonProps) => {
// accepts undefined variant, as it is the default variant
const textColor = !props.variant || props.variant == 'solid'
? 'light.50'
: undefined;
return <Button {...props}>
{ props.label !== undefined
? <Text color={textColor}>{props.label}</Text>
: <Translate color={textColor} {...props.translate} />
}
</Button>
}
export default TextButton