From e1bf6f60ffd6214dde323bbe9af599814380a67f Mon Sep 17 00:00:00 2001 From: Guilherme Barbosa Ferreira Date: Fri, 28 Jun 2024 03:06:20 -0300 Subject: [PATCH] feat: create screen to offer tutorial to new users --- app/src/Navigation/AuthNavigation/index.jsx | 2 ++ .../pages/AuthPages/ConfirmRegister/index.jsx | 2 +- .../AuthPages/WalkthroughTutorial/index.jsx | 25 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 app/src/pages/AuthPages/WalkthroughTutorial/index.jsx diff --git a/app/src/Navigation/AuthNavigation/index.jsx b/app/src/Navigation/AuthNavigation/index.jsx index ad912c499..90b5a967c 100644 --- a/app/src/Navigation/AuthNavigation/index.jsx +++ b/app/src/Navigation/AuthNavigation/index.jsx @@ -8,6 +8,7 @@ import ForgotPassword from '../../pages/AuthPages/ForgotPassword'; import InitialScreen from '../../pages/AuthPages/InitialScreen'; import Location from '../../pages/AuthPages/Location'; import ConfirmRegister from '../../pages/AuthPages/ConfirmRegister'; +import WalkthroughTutorial from '../../pages/AuthPages/WalkthroughTutorial'; const Stack = createStackNavigator(); const AuthRoutes = () => { @@ -29,6 +30,7 @@ const AuthRoutes = () => { + ); }; diff --git a/app/src/pages/AuthPages/ConfirmRegister/index.jsx b/app/src/pages/AuthPages/ConfirmRegister/index.jsx index ed6942d86..387135dbc 100644 --- a/app/src/pages/AuthPages/ConfirmRegister/index.jsx +++ b/app/src/pages/AuthPages/ConfirmRegister/index.jsx @@ -36,7 +36,7 @@ export default function ConfirmRegister({ route, navigation }) { } setIsLoading(false); - navigation.navigate('login'); + navigation.navigate('walkthroughTutorial'); } const titleCheckBox = ( diff --git a/app/src/pages/AuthPages/WalkthroughTutorial/index.jsx b/app/src/pages/AuthPages/WalkthroughTutorial/index.jsx new file mode 100644 index 000000000..1bf58f6f6 --- /dev/null +++ b/app/src/pages/AuthPages/WalkthroughTutorial/index.jsx @@ -0,0 +1,25 @@ +import React from 'react'; +import { Text, View } from 'react-native'; +import { DefaultButton } from '../../../components/atoms/DefaultButton'; +import { WalkthroughStepsContext } from '../../../store/contexts/walkthroughStepsContext'; + +export default function WalkthroughTutorial({ navigation }) { + + const { setWalkthroughStep } = useContext(WalkthroughStepsContext); + + const handleContinue = (shouldRenderTutorial) => { + if (shouldRenderTutorial) setWalkthroughStep(1) + + navigation.navigate('login') + } + + return ( + + Deseja fazer um tutorial inicial? + + + + + + ); +} \ No newline at end of file