Commit bd9cd55b by G

refactor: PaymentResultScreen no longer have dependencies on old components such as Box.

parent e66a4d54
import { asp as g } from "@asp/asp";
import { BarnoinPayBackground } from "@components/BarnoinPayBackground";
import BeasyLogoIcon from "@components/BeasyLogoIcon"; import BeasyLogoIcon from "@components/BeasyLogoIcon";
import Button from "@components/Button"; import * as Button from "@components/ButtonNew";
import BeasyDefaultBackgroundWrapper from "@components/backgrounds/BeasyDefaultBackground";
import Box from "@components/bases/Box";
import Text from "@components/bases/Text";
import GoBackIconButton from "@components/GoBackIconButton";
import CheckIcon from "@components/icons/CheckIcon"; import CheckIcon from "@components/icons/CheckIcon";
import { AntDesign } from "@expo/vector-icons";
import { LOG } from "@logger"; import { LOG } from "@logger";
import { CommonActions } from "@react-navigation/native"; import { Text, View } from "react-native";
// import { Text } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context";
import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
import type { MainStackScreenComponentProps } from "@/navigations/types"; import type { MainStackScreenComponentProps } from "@/navigations/types";
const log = LOG.extend("PaymentResultScreen"); const log = LOG.extend("PaymentResultScreen");
...@@ -20,122 +18,109 @@ const PaymentResultScreen: MainStackScreenComponentProps<"paymentResultScreen"> ...@@ -20,122 +18,109 @@ const PaymentResultScreen: MainStackScreenComponentProps<"paymentResultScreen">
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();
log.debug("insets", insets); log.debug("insets", insets);
return ( return (
<BeasyDefaultBackgroundWrapper> <BarnoinPayBackground style={[g.gap_lg]}>
<SafeAreaView edges={["top", "left", "right"]}> <View style={[g.px_lg, g.flex_row, g.align_center, g.justify_between]}>
<Box <BeasyLogoIcon />
style={{ <AntDesign
height: "100%", name="arrowleft"
width: "100%", size={24}
// marginTop: insets.top, color="black"
}} onPress={() => navigation.goBack()}
/>
</View>
<View style={[g.flex_1]}>
<View
style={[
g.flex_1,
g.gap_lg,
g.p_lg,
{
backgroundColor: "white",
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
},
]}
> >
<Box <View style={[g.self_center]}>
px={"l"} <CheckIcon />
flexDirection={"row"} </View>
justifyContent={"space-between"} <Text style={[g.text_center]}>Transactions effectué avec succès !</Text>
alignItems={"center"}
mb={"m"} <Button.Container style={[g.self_center, { width: 200 }]}>
> <Button.Label>Imprimer le réçu</Button.Label>
<BeasyLogoIcon /> </Button.Container>
<GoBackIconButton
onPress={() => { <View style={[g.rounded_lg, g.p_lg, { backgroundColor: "#eeeef1ff" }]}>
navigation.dispatch( <View
CommonActions.reset({ style={[
index: 1, g.flex_row,
routes: [{ name: "appBottomTabsNavigator" }], g.justify_between,
}), g.p_md,
); { borderBottomColor: "#000", borderBottomWidth: 1 },
}} ]}
/> >
</Box> <Text style={[g.font_bold]}>Caisse</Text>
<Box <Text>00147C</Text>
flex={1} </View>
backgroundColor={"white"} <View
borderRadius={20} style={[
p={"l"} g.flex_row,
flexDirection={"column"} g.justify_between,
gap={"l"} g.p_md,
> { borderBottomColor: "#000", borderBottomWidth: 1 },
<Box alignItems={"center"}> ]}
<CheckIcon /> >
</Box> <Text style={[g.font_bold]}>Reference</Text>
<Text variant={"secondary"} fontWeight={"bold"} textAlign={"center"}> <Text>CP...</Text>
Transactions effectué avec succès ! </View>
</Text> <View
<Button style={[
width={200} g.flex_row,
alignSelf={"center"} g.justify_between,
variant={"full"} g.p_md,
textVariants={"white"} { borderBottomColor: "#000", borderBottomWidth: 1 },
label={"Imprimer le réçu"} ]}
onPress={() => {}} >
/> <Text style={[g.font_bold]}>Mode de paiement</Text>
<Box backgroundColor={"lightGray"} flex={1} borderRadius={20} p={"l"}> <Text>Orange</Text>
<Box </View>
flexDirection={"row"} <View
justifyContent={"space-between"} style={[
borderBottomColor={"gray"} g.flex_row,
borderBottomWidth={1} g.justify_between,
py={"m"} g.p_md,
> { borderBottomColor: "#000", borderBottomWidth: 1 },
<Text fontWeight={"bold"}>Caisse</Text> ]}
<Text variant={"black"}>00147C</Text> >
</Box> <Text style={[g.font_bold]}>Infos client</Text>
<Box <Text>Dogeless Miso</Text>
flexDirection={"row"} </View>
justifyContent={"space-between"} <View
borderBottomColor={"gray"} style={[
borderBottomWidth={1} g.flex_row,
py={"m"} g.justify_between,
> g.p_md,
<Text fontWeight={"bold"}>Reference</Text> { borderBottomColor: "#000", borderBottomWidth: 1 },
<Text variant={"black"}>CP...</Text> ]}
</Box> >
<Box <Text style={[g.font_bold]}>Montant</Text>
flexDirection={"row"} <Text>10</Text>
justifyContent={"space-between"} </View>
borderBottomColor={"gray"} <View
borderBottomWidth={1} style={[
py={"m"} g.flex_row,
> g.justify_between,
<Text fontWeight={"bold"}>Mode de paiement</Text> g.p_md,
<Text variant={"black"}>Orange</Text> { borderBottomColor: "#000" },
</Box> ]}
<Box >
flexDirection={"row"} <Text style={[g.font_bold]}>N° Client</Text>
justifyContent={"space-between"} <Text>Dogeless Misso</Text>
borderBottomColor={"gray"} </View>
borderBottomWidth={1} </View>
py={"m"} </View>
> </View>
<Text fontWeight={"bold"}>Infos client</Text> </BarnoinPayBackground>
<Text variant={"black"}>Dogeless Miso</Text>
</Box>
<Box
flexDirection={"row"}
justifyContent={"space-between"}
borderBottomColor={"gray"}
borderBottomWidth={1}
py={"m"}
>
<Text fontWeight={"bold"}>Montant</Text>
<Text variant={"black"}>10</Text>
</Box>
<Box
flexDirection={"row"}
justifyContent={"space-between"}
borderBottomColor={"gray"}
borderBottomWidth={1}
py={"m"}
>
<Text fontWeight={"bold"}>N° Client</Text>
<Text variant={"black"}>Dogeless Misso</Text>
</Box>
</Box>
</Box>
</Box>
</SafeAreaView>
</BeasyDefaultBackgroundWrapper>
); );
}; };
......
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