Commit eab0abf3 by G

message and onPress props for the modal

parent e6f5c06d
...@@ -3,7 +3,12 @@ import Box from "@components/bases/Box"; ...@@ -3,7 +3,12 @@ import Box from "@components/bases/Box";
import ErrorIcon from "@components/icons/ErrorIcon"; import ErrorIcon from "@components/icons/ErrorIcon";
import { Text } from "react-native"; import { Text } from "react-native";
const ErrorModal = () => { interface Props {
message?: string;
onPress?: () => void;
}
const ErrorModal = ({ message = "Une erreur s'est produite", onPress = () => {} }: Props) => {
return ( return (
<Box <Box
width={300} width={300}
...@@ -20,15 +25,16 @@ const ErrorModal = () => { ...@@ -20,15 +25,16 @@ const ErrorModal = () => {
shadowColor={"black"} shadowColor={"black"}
shadowOffset={{ width: 0, height: 0 }} shadowOffset={{ width: 0, height: 0 }}
shadowOpacity={0.5} shadowOpacity={0.5}
p={"s"}
> >
<ErrorIcon /> <ErrorIcon />
<Text>Une erreur s'est produite</Text> <Text>{message}</Text>
<Box style={{ width: "80%" }}> <Box style={{ width: "80%" }}>
<Button <Button
variant={"fullError"} variant={"fullError"}
textVariants={"white"} textVariants={"white"}
label="Fermer" label="Fermer"
onPress={() => {}} onPress={onPress}
/> />
</Box> </Box>
</Box> </Box>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment