I am not sure what is the best way to insure the best way to complete a registration.
My register page is complete and redirects with a parameter perfectly, I have 3 types of users,
1- Normal user
After a Normal user register, I redirect them to the home page, I do not need anything more.
2- Artist
After the Artist register, I need more data.
3- Host
After the Host register, I still need more data.
But the data is completely different, I though I will benefit from a single page and use statements to render the rest using the type
parameter, But I am not sure if it's the right thing to do.
Example:
<Button onPress={handleSignUp} marginVertical={sizes.s} marginHorizontal={sizes.sm} gradient={gradients.primary} disabled={Object.values(isValid).includes(false) || isLoading}><Text bold white transform="uppercase"> {isLoading ? '' : t('common.signup')} {isLoading && <ActivityIndicator size={'small'} />}</Text></Button>
const handleSignUp = useCallback(() => { /*. . No need to write the whole code for the sign up process .*/ navigation.navigate('CompleteProfile', { paramKey: type, });});
What is the best approach?
- Using a single page and go with a
statement rendering
and combine them with users table and seperate them usingtype
variable? - Use a seperate pages and redirect
Artist
toArtistCompleteProfile.tsx
andHost
toHostCompleteProfile.tsx
to complete reteriving their data and use a single table for each one? Your new Apporach..