From c5c570392ba52a56dd35d77f13844c2acf9bce7f Mon Sep 17 00:00:00 2001 From: devthejo Date: Sun, 4 Jan 2026 13:44:25 +0100 Subject: [PATCH] fix(ios): wip --- src/components/EULA/index.js | 95 +++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 34 deletions(-) diff --git a/src/components/EULA/index.js b/src/components/EULA/index.js index 0a7869f..bc4e7ae 100644 --- a/src/components/EULA/index.js +++ b/src/components/EULA/index.js @@ -1,9 +1,12 @@ import React from "react"; -import { View, ScrollView, StyleSheet, Platform } from "react-native"; +import { View, ScrollView, StyleSheet, Platform, Modal } from "react-native"; +import { useSafeAreaInsets } from "react-native-safe-area-context"; import AsyncStorage from "~/storage/memoryAsyncStorage"; import { STORAGE_KEYS } from "~/storage/storageKeys"; +import { useTheme } from "~/theme"; -import Text from "../Text"; +import CustomButton from "~/components/CustomButton"; +import Text from "~/components/Text"; const EULA_TEXT = `Contrat de Licence Utilisateur Final (CLUF) @@ -66,6 +69,9 @@ Si vous avez des questions concernant ce Contrat, veuillez nous contacter à : Email : contact@alertesecours.fr`; const EULA = ({ onAccept, visible = true }) => { + const theme = useTheme(); + const insets = useSafeAreaInsets(); + if (!visible || Platform.OS !== "ios") return null; const handleAccept = async () => { @@ -78,63 +84,84 @@ const EULA = ({ onAccept, visible = true }) => { }; return ( - - - Conditions Générales - - {EULA_TEXT} - - - - Accepter + {}} + > + + + + Conditions Générales + + + {EULA_TEXT} + + + + + Accepter + + - + ); }; const styles = StyleSheet.create({ container: { - position: "absolute", - top: 0, - left: 0, - right: 0, - bottom: 0, - backgroundColor: "rgba(0,0,0,0.5)", + flex: 1, justifyContent: "center", alignItems: "center", - zIndex: 1000, + paddingHorizontal: 16, }, content: { - backgroundColor: "white", - borderRadius: 10, - width: "90%", - maxHeight: "80%", - padding: 20, + borderRadius: 12, + width: "100%", + maxWidth: 520, + maxHeight: "85%", + paddingHorizontal: 16, + paddingTop: 16, + paddingBottom: 12, + flexShrink: 1, }, title: { fontSize: 20, - fontWeight: "bold", + fontWeight: "600", marginBottom: 15, textAlign: "center", }, scrollView: { - maxHeight: "80%", + flexGrow: 0, + }, + scrollViewContent: { + paddingBottom: 8, }, text: { fontSize: 14, lineHeight: 20, }, buttonContainer: { - marginTop: 20, - alignItems: "center", - }, - acceptButton: { - color: "#007AFF", - fontSize: 18, - fontWeight: "bold", - padding: 10, + marginTop: 12, }, });