diff --git a/App.tsx b/App.tsx index fe87972..b37e6fa 100644 --- a/App.tsx +++ b/App.tsx @@ -1,10 +1,8 @@ -import ProvideQueryClient from "@components/providers_wrappers/ProvideQueryClient"; import { LOG } from "@logger"; import { DefaultTheme, NavigationContainer } from "@react-navigation/native"; import { ThemeProvider } from "@shopify/restyle"; import { injectStoreIntoAxiosInstance } from "@/axios"; -import { ModalsManagerProvider } from "@/contexts/ModalsManagerContext"; -import { UserAuthenticationContextProvider } from "@/contexts/UserAuthenticationContext"; +import ProvideQueryClient from "@/contexts/ProvideQueryClient"; import { AppMainStackNavigatorAuthWrapper } from "@/navigations/AppMainStackNavigator"; import theme from "@/themes/Theme"; import "react-native-gesture-handler"; @@ -24,30 +22,22 @@ export default function App() { - - - - - - - - - - - - + + + + + + + + diff --git a/src/components/BalanceContainer.tsx b/src/components/BalanceContainer.tsx deleted file mode 100644 index 911ab6b..0000000 --- a/src/components/BalanceContainer.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import Box from "@components/bases/Box"; -import Text from "@components/bases/Text"; -import Card from "@re-card"; -import { images } from "@styles/Commons"; -import * as LocalAuthentication from "expo-local-authentication"; -import { useState } from "react"; -import { Image, TouchableOpacity } from "react-native"; - -type Props = { balance: number; label: string }; - -const BalanceContainer = ({ label, balance }: Props) => { - const [showBalance, setShowBalance] = useState(false); - - const handleLocalAuthentication = async () => { - console.log("handleLocalAuthentication :: start"); - if (showBalance) { - return setShowBalance(false); - } - const result = await LocalAuthentication.authenticateAsync(); - if (result.success) { - setShowBalance(true); - } - console.log("handleLocalAuthentication :: end", result); - }; - - return ( - - - - - - - - - {showBalance ? ( - - {balance} - - ) : ( - - - - )} - - - - {label} - - - ); -}; - -export default BalanceContainer; diff --git a/src/components/BarWithBeasyAndNotificationsIcon.tsx b/src/components/BarWithBeasyAndNotificationsIcon.tsx deleted file mode 100644 index 63ad568..0000000 --- a/src/components/BarWithBeasyAndNotificationsIcon.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import {} from "react-native"; -import BeasyLogoIcon from "./BeasyLogoIcon"; -import NotificationIconButton from "./NotificationIconButton"; -import Box from "./bases/Box"; - -const BarWithBeasyAndNotificationsIcon = () => { - return ( - - - - - ); -}; - -export default BarWithBeasyAndNotificationsIcon; diff --git a/src/components/BeasyLogoIcon.tsx b/src/components/BeasyLogoIcon.tsx index 9f41baf..b616cb4 100644 --- a/src/components/BeasyLogoIcon.tsx +++ b/src/components/BeasyLogoIcon.tsx @@ -1,10 +1,15 @@ +import { asp as g } from "@asp/asp"; import Box from "@components/bases/Box"; -import { images } from "@styles/Commons"; import { Image } from "react-native"; + const BeasyLogoIcon = () => { return ( - + ); }; diff --git a/src/components/Button.tsx b/src/components/Button.tsx deleted file mode 100644 index f8423d0..0000000 --- a/src/components/Button.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import type { BoxProps, VariantProps } from "@shopify/restyle"; -import type { Theme } from "@themes/Theme"; -import { ActivityIndicator, TouchableOpacity } from "react-native"; -import ButtonBase from "./bases/ButtonBase"; -import Text from "./bases/Text"; - -type Props = BoxProps & - VariantProps & - VariantProps & { - label: string; - onPress: () => void; - isLoading?: boolean; - }; - -const Button = ({ onPress, label, isLoading, textVariants, variant, ...rest }: Props) => { - return ( - - - {isLoading ? ( - - ) : ( - {label} - )} - - - ); -}; - -export default Button; diff --git a/src/components/ContainerBorderTopCurved.tsx b/src/components/ContainerBorderTopCurved.tsx deleted file mode 100644 index e330f7e..0000000 --- a/src/components/ContainerBorderTopCurved.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { containers } from "@styles/Commons"; -import { useEffect } from "react"; -import { Animated, Dimensions } from "react-native"; -import Box from "./bases/Box"; - -type Props = { children: React.ReactNode }; -const ContainerBorderTopCurved = ({ children }: Props) => { - const animated = new Animated.Value(0); - // biome-ignore lint/correctness/useExhaustiveDependencies: - useEffect(() => { - Animated.spring(animated, { - toValue: 1, - useNativeDriver: true, - }).start(); - }, []); - - return ( - - - {children} - - - ); -}; - -export default ContainerBorderTopCurved; diff --git a/src/components/GoBackIconButton.tsx b/src/components/GoBackIconButton.tsx deleted file mode 100644 index 05033b5..0000000 --- a/src/components/GoBackIconButton.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import Box from "@components/bases/Box"; -import { Ionicons } from "@expo/vector-icons"; -import { TouchableOpacity } from "react-native"; - -type Props = { - onPress: () => void; -}; -const GoBackIconButton = ({ onPress }: Props) => { - return ( - - - - - - ); -}; - -export default GoBackIconButton; diff --git a/src/components/Input.tsx b/src/components/Input.tsx deleted file mode 100644 index 7ce7e0c..0000000 --- a/src/components/Input.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import type { VariantProps } from "@shopify/restyle"; -import type { Theme } from "@themes/Theme"; -import type { TextInputProps } from "react-native"; -import { TextInput } from "react-native"; -import Box from "./bases/Box"; - -type Props = TextInputProps & VariantProps; - -const Input = ({ textVariants, ...rest }: Props) => { - return ( - - - - - - ); -}; - -export default Input; diff --git a/src/components/InputWithTopLabel.tsx b/src/components/InputWithTopLabel.tsx deleted file mode 100644 index 25ca24e..0000000 --- a/src/components/InputWithTopLabel.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { VariantProps } from "@shopify/restyle"; -import type { Theme } from "@themes/Theme"; -import type { TextInputProps } from "react-native"; -import { TextInput } from "react-native"; -import Box from "./bases/Box"; -import Text from "./bases/Text"; - -type Props = TextInputProps & - VariantProps & { - label: string; - }; - -const InputWithTopLabel = ({ label, textVariants, ...rest }: Props) => { - return ( - - {label} - - - - - ); -}; - -export default InputWithTopLabel; diff --git a/src/components/NotificationIconButton.tsx b/src/components/NotificationIconButton.tsx deleted file mode 100644 index 7a49a63..0000000 --- a/src/components/NotificationIconButton.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import Box from "@components/bases/Box"; -import { Ionicons } from "@expo/vector-icons"; -const NotificationIconButton = () => { - return ( - - - - - - - ); -}; - -export default NotificationIconButton; diff --git a/src/components/PaymentOption.tsx b/src/components/PaymentOption.tsx deleted file mode 100644 index c83f6b6..0000000 --- a/src/components/PaymentOption.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import type { PaymentCode } from "@/utils/requests/types"; -import { images } from "@styles/Commons"; -import { Image, TouchableOpacity } from "react-native"; -import Box from "./bases/Box"; - -type PaymentOptions = "OM" | "MTN" | "FLOOZ" | "WAVE" | "CB"; - -type Props = { - onPress: () => void; - paymentMethod: PaymentCode; -}; - -const PaymentOptionContainer = ({ children }: { children: React.ReactNode }) => { - return ( - - {children} - - ); -}; - -const Orange = () => { - return ( - - ); -}; - -const Mtn = () => { - return ; -}; - -const Flooz = () => { - return ; -}; - -const Wave = () => { - return ; -}; - -const Cb = () => { - return ; -}; - -const PaymentOption = ({ onPress, paymentMethod }: Props) => { - return ( - - {paymentMethod === "OM" && } - {paymentMethod === "MTN" && } - {paymentMethod === "FLOOZ" && } - {paymentMethod === "WAVE" && } - {paymentMethod === "CB" && } - - ); -}; - -export default PaymentOption; diff --git a/src/components/PaymentsOptionsRendererTwoColumn.tsx b/src/components/PaymentsOptionsRendererTwoColumn.tsx deleted file mode 100644 index bd2dd39..0000000 --- a/src/components/PaymentsOptionsRendererTwoColumn.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import type React from "react"; -import { Dimensions } from "react-native"; -import Box from "./bases/Box"; - -// const PaymentsOptionsRendererTwoColumn = () => { -// return ( -// -// -// -// navigation.navigate("paymentAmountInputScreen")} -// paymentMethod={"OrangeMoney"} -// /> -// -// -// navigation.navigate("paymentAmountInputScreen")} -// paymentMethod={"MtnMoney"} -// /> -// -// -// -// -// navigation.navigate("paymentAmountInputScreen")} -// paymentMethod={"MoovMoney"} -// /> -// -// -// navigation.navigate("paymentAmountInputScreen")} -// paymentMethod={"WaveMoney"} -// /> -// -// -// -// navigation.navigate("paymentAmountInputScreen")} -// paymentMethod={"VisaCard"} -// /> -// -// -// ); -// }; - -const screenWidth = Dimensions.get("window").width; -const paymentOptionCardWidth = screenWidth / 2 - 30; -const paymentOptionCardHeight = paymentOptionCardWidth * 0.65; -const PaymentOptionContainer = ({ children }: { children: React.ReactNode }) => { - return ( - - {children} - - ); -}; - -// export default PaymentsOptionsRendererTwoColumn; diff --git a/src/components/TransactionInformationsItem.tsx b/src/components/TransactionInformationsItem.tsx deleted file mode 100644 index d6a0e43..0000000 --- a/src/components/TransactionInformationsItem.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import type { PaymentCode } from "@/utils/requests/types"; -import moment from "moment"; -import "moment/locale/fr"; -import PaymentOption from "./PaymentOption"; -import Box from "./bases/Box"; -import Text from "./bases/Text"; - -interface Props { - paymentType: PaymentCode; - reference: string; - date: string; - amount: number; - status: "SUCCESS" | "INITIATED" | "FAILED"; -} - -moment.locale("fr"); - -const TransactionInformationsItem = ({ paymentType, reference, date, amount, status }: Props) => { - const dateObject = Date.parse(date); - return ( - - - - {}} /> - - - {reference} - {moment(dateObject).fromNow()} - - - - - - - - ); -}; - -const AmountColorRenderer = ({ status, amount }: { status: string; amount: number }) => { - if (status === "SUCCESS") { - return {amount}; - } - if (status === "INITIATED") { - return {amount}; - } - return {amount}; -}; - -const AmountWrapper = ({ - color, - children, -}: { color: "secondary" | "softYellow" | "softRed"; children: React.ReactNode }) => { - return ( - - - {children} F - - - ); -}; - -export default TransactionInformationsItem; diff --git a/src/components/WrapperTopEdgeCurved.tsx b/src/components/WrapperTopEdgeCurved.tsx deleted file mode 100644 index a74ac8c..0000000 --- a/src/components/WrapperTopEdgeCurved.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import type React from "react"; -import Box from "./bases/Box"; - -const WrapperTopEdgeCurved = ({ children }: { children?: React.ReactElement }) => { - return ( - - {children} - - ); -}; - -export default WrapperTopEdgeCurved; diff --git a/src/components/backgrounds/BackgroundGreenWhiteContentArea.tsx b/src/components/backgrounds/BackgroundGreenWhiteContentArea.tsx deleted file mode 100644 index 12a8070..0000000 --- a/src/components/backgrounds/BackgroundGreenWhiteContentArea.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { containers, images } from "@styles/Commons"; -import { ImageBackground, View } from "react-native"; - -type Props = { children: React.ReactNode }; - -const BackgroundGreenWhiteContentArea = ({ children }: Props) => { - return ( - - - {children} - - - ); -}; - -export default BackgroundGreenWhiteContentArea; diff --git a/src/components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea.tsx b/src/components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea.tsx deleted file mode 100644 index a440727..0000000 --- a/src/components/backgrounds/BackgroundWithBeasyIconAndWhiteContentArea.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import BeasyLogoIcon from "@components/BeasyLogoIcon"; -import GoBackIconButton from "@components/GoBackIconButton"; -import WrapperTopEdgeCurved from "@components/WrapperTopEdgeCurved"; -import Box from "@components/bases/Box"; -import { useNavigation } from "@react-navigation/native"; -import type { ReactElement } from "react"; -import BackgroundDefault from "./BeasyDefaultBackground"; - -const BackgroundWithBeasyIconAndWhiteContentArea = ({ - children, - goBack = false, -}: { children?: ReactElement; goBack?: boolean }) => { - const navigation = useNavigation(); - return ( - - - - {goBack && navigation.goBack()} />} - - {children} - - ); -}; - -export default BackgroundWithBeasyIconAndWhiteContentArea; diff --git a/src/components/backgrounds/BeasyDefaultBackground.tsx b/src/components/backgrounds/BeasyDefaultBackground.tsx deleted file mode 100644 index 3e54f17..0000000 --- a/src/components/backgrounds/BeasyDefaultBackground.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { images } from "@styles/Commons"; -import { ImageBackground } from "react-native"; - -type Props = { children: React.ReactNode }; - -const BeasyDefaultBackground = ({ children }: Props) => { - return ( - - {children} - - ); -}; - -export default BeasyDefaultBackground; diff --git a/src/components/bases/ButtonBase.tsx b/src/components/bases/ButtonBase.tsx deleted file mode 100644 index 87885db..0000000 --- a/src/components/bases/ButtonBase.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { type BoxProps, type VariantProps, createRestyleComponent } from "@shopify/restyle"; -import type { Theme } from "@themes/Theme"; -import { buttonVariants } from "@themes/Variants"; -import Box from "./Box"; - -const ButtonBase = createRestyleComponent< - VariantProps & - BoxProps & { - children: React.ReactNode; - }, - Theme ->([buttonVariants], Box); - -export default ButtonBase; diff --git a/src/components/bases/Card.tsx b/src/components/bases/Card.tsx deleted file mode 100644 index 7393772..0000000 --- a/src/components/bases/Card.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import type { Theme } from "@/themes/Theme"; -import Box from "@re-box"; -import { type VariantProps, createRestyleComponent, createVariant } from "@shopify/restyle"; - -const Card = createRestyleComponent< - VariantProps & React.ComponentProps, - Theme ->( - [ - createVariant({ - themeKey: "cardVariants", - defaults: { - margin: { - phone: "s", - tablet: "m", - }, - backgroundColor: "red", - }, - }), - ], - Box, -); -export default Card; diff --git a/src/components/bases/Text.tsx b/src/components/bases/Text.tsx deleted file mode 100644 index ad64fae..0000000 --- a/src/components/bases/Text.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import type { Theme } from "@/themes/Theme"; -import { createText } from "@shopify/restyle"; - -const Text = createText(); - -export default Text; diff --git a/src/components/containers/SafeAreaViewTopLeftRightFull.tsx b/src/components/containers/SafeAreaViewTopLeftRightFull.tsx deleted file mode 100644 index 4454c82..0000000 --- a/src/components/containers/SafeAreaViewTopLeftRightFull.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import Box from "@components/bases/Box"; -import type React from "react"; -import {} from "react-native"; -import { SafeAreaView } from "react-native-safe-area-context"; - -const SafeAreaViewTopLeftRightFull = ({ children }: { children: React.ReactNode }) => { - return ( - - - {children} - - - ); -}; - -export default SafeAreaViewTopLeftRightFull; diff --git a/src/components/icons/CheckIcon.tsx b/src/components/icons/CheckIcon.tsx index 014924d..3182522 100644 --- a/src/components/icons/CheckIcon.tsx +++ b/src/components/icons/CheckIcon.tsx @@ -1,5 +1,5 @@ +import { asp as g } from "@asp/asp"; import Box from "@components/bases/Box"; -import { images } from "@styles/Commons"; import { Image } from "react-native"; const CheckIcon = () => { @@ -7,7 +7,8 @@ const CheckIcon = () => { ); diff --git a/src/components/icons/ErrorIcon.tsx b/src/components/icons/ErrorIcon.tsx index c3dc64e..c7eeb9f 100644 --- a/src/components/icons/ErrorIcon.tsx +++ b/src/components/icons/ErrorIcon.tsx @@ -1,5 +1,5 @@ +import { asp as g } from "@asp/asp"; import Box from "@components/bases/Box"; -import { images } from "@styles/Commons"; import { Image } from "react-native"; const ErrorIcon = () => { @@ -7,7 +7,8 @@ const ErrorIcon = () => { ); diff --git a/src/components/icons/InformationIcon.tsx b/src/components/icons/InformationIcon.tsx index 429b096..5cc263c 100644 --- a/src/components/icons/InformationIcon.tsx +++ b/src/components/icons/InformationIcon.tsx @@ -1,5 +1,5 @@ +import { asp as g } from "@asp/asp"; import Box from "@components/bases/Box"; -import { images } from "@styles/Commons"; import { Image } from "react-native"; const InformationIcon = () => { @@ -7,7 +7,8 @@ const InformationIcon = () => { ); diff --git a/src/components/modals/ErrorModal.tsx b/src/components/modals/ErrorModal.tsx deleted file mode 100644 index e932ea0..0000000 --- a/src/components/modals/ErrorModal.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { useModalsManagerContext } from "@/contexts/ModalsManagerContext"; -import Button from "@components/Button"; -import ErrorIcon from "@components/icons/ErrorIcon"; -import Box from "@re-box"; -import Card from "@re-card"; -import Text from "@re-text"; - -interface Props { - message?: string; - // onPress?: () => void; -} - -const ErrorModal = ({ message = "Une erreur s'est produite" }: Props) => { - const { closeModal } = useModalsManagerContext(); - return ( - - - - {message} - - -