Skip to content

Commit

Permalink
feat: create screen to offer tutorial to new users
Browse files Browse the repository at this point in the history
  • Loading branch information
guibrbs committed Aug 27, 2024
1 parent b2f2b6e commit e1bf6f6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/src/Navigation/AuthNavigation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand All @@ -29,6 +30,7 @@ const AuthRoutes = () => {
<Stack.Screen name="riskGroup" component={RiskGroup} />
<Stack.Screen name="forgotPassword" component={ForgotPassword} />
<Stack.Screen name="confirmRegister" component={ConfirmRegister} />
<Stack.Screen name="walkthroughTutorial" component={WalkthroughTutorial} />
</Stack.Navigator>
);
};
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/AuthPages/ConfirmRegister/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function ConfirmRegister({ route, navigation }) {
}

setIsLoading(false);
navigation.navigate('login');
navigation.navigate('walkthroughTutorial');
}

const titleCheckBox = (
Expand Down
25 changes: 25 additions & 0 deletions app/src/pages/AuthPages/WalkthroughTutorial/index.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<View className='px-4 py-4 flex h-full justify-center'>
<Text className='font-ms-semibold text-2xl text-center mt-auto mb-[55%]'>Deseja fazer um tutorial inicial?</Text>
<View className='pb-8'>
<DefaultButton title='Sim' onPress={handleContinue(true)}/>
<DefaultButton title='Pular tutorial' variant='transparent' onPress={handleContinue(false)}/>
</View>
</View>
);
}

0 comments on commit e1bf6f6

Please sign in to comment.