diff --git a/app/components/Slides/SharedSlide.tsx b/app/components/Slides/SharedSlide.tsx new file mode 100644 index 0000000..923ad3c --- /dev/null +++ b/app/components/Slides/SharedSlide.tsx @@ -0,0 +1,54 @@ +import { + View, + Text, + ImageBackground, + StyleSheet, + Dimensions, +} from "react-native"; +import React from "react"; +import { SharedSlideProps } from "../../utils/types"; + +const SharedSlide = ({ + image, + text, + textWrapperStyle, + textStyle, + children, +}: SharedSlideProps) => { + return ( + + + + + {text} + {children} + + + + + ); +}; + +const styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: "#9DD6EB", + }, + image: { + flex: 1, + }, + textWrapper: { + flex: 1, + justifyContent: "flex-end", + alignItems: "center", + marginBottom: Dimensions.get("screen").width / 6, + width: "80%", + }, + text: { + color: "#fff", + textAlign: "center", + lineHeight: 25, + }, +}); + +export default SharedSlide; diff --git a/app/components/Slides/SlideFour.tsx b/app/components/Slides/SlideFour.tsx new file mode 100644 index 0000000..03019ba --- /dev/null +++ b/app/components/Slides/SlideFour.tsx @@ -0,0 +1,45 @@ +import { Dimensions } from "react-native"; +import React from "react"; +import Button from "../common/Button"; +import SharedSlide from "./SharedSlide"; +import AsyncStorage from "@react-native-async-storage/async-storage"; +import { useNavigation } from "expo-router"; +import { IS_APP_LAUNCHED } from "../../utils/constants"; + +const SlideFour = () => { + const navigation = useNavigation(); + + const onPress = async () => { + try { + await AsyncStorage.setItem(IS_APP_LAUNCHED, "true"); + navigation.reset({ + routes: [ + { + name: "onboarding/game-selection", + }, + ], + }); + } catch (e) { + console.log("Cannot set IS_NEW_USER to false", e); + } + }; + + + return ( + +