Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 134
[PE-7058] Fix signup skip flow and update UI#13113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,19 @@ | ||
| import { useCallback } from 'react' | ||
| import { useCallback, useState } from 'react' | ||
| import { selectArtistsPageMessages } from '@audius/common/messages' | ||
| import { | ||
| addFollowArtists, | ||
| finishSignUp, | ||
| signUp, | ||
| completeFollowArtists | ||
| } from '@audius/web/src/common/store/pages/signon/actions' | ||
| import { EditingStatus } from '@audius/web/src/common/store/pages/signon/types' | ||
| import { | ||
| getFollowIds, | ||
| getGenres, | ||
| getStatus | ||
| } from 'common/store/pages/signon/selectors' | ||
| import { getFollowIds, getGenres } from 'common/store/pages/signon/selectors' | ||
| import { useDispatch, useSelector } from 'react-redux' | ||
| import { Flex, Text } from '@audius/harmony-native' | ||
| import { createCollapsibleTabNavigator } from 'app/components/top-tab-bar/createCollapsibleTabNavigator' | ||
| import { useNavigation } from 'app/hooks/useNavigation' | ||
| import { ReadOnlyAccountHeader } from '../../components/AccountHeader' | ||
| import { SkipButton } from '../../components/SkipButton' | ||
| import { Heading, PageFooter } from '../../components/layout' | ||
| import type { SignOnScreenParamList } from '../../types' | ||
| import { useTrackScreen } from '../../utils/useTrackScreen' | ||
| @@ -42,7 +36,7 @@ export const SelectArtistsScreen = () => { | ||
| const navigation = useNavigation<SignOnScreenParamList>() | ||
| useTrackScreen('SelectArtists') | ||
| const accountCreationStatus = useSelector(getStatus) | ||
| const [isSubmitting, setIsSubmitting] = useState(false) | ||
| const renderHeader = useCallback( | ||
| () => ( | ||
| @@ -62,15 +56,18 @@ export const SelectArtistsScreen = () => { | ||
| ) | ||
| const handleSubmit = useCallback(() => { | ||
| // Follow selected artists | ||
| dispatch(addFollowArtists(selectedArtists)) | ||
| dispatch(completeFollowArtists()) | ||
| setIsSubmitting(true) | ||
| dispatch(finishSignUp()) | ||
| if (accountCreationStatus === EditingStatus.LOADING) { | ||
| navigation.navigate('AccountLoading') | ||
| // Only add artists if some were selected | ||
| if (selectedArtists.length > 0) { | ||
| dispatch(addFollowArtists(selectedArtists)) | ||
| dispatch(completeFollowArtists()) | ||
| } | ||
| }, [accountCreationStatus, dispatch, navigation, selectedArtists]) | ||
| // Always create the account (whether artists selected or not) | ||
| dispatch(signUp()) | ||
Comment on lines
+62
to
+68
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are these follow artist things synchronous? If not may need to wait on them to finish before signing up or we'll miss the follows | ||
| navigation.navigate('AccountLoading') | ||
| }, [dispatch, navigation, selectedArtists]) | ||
| return ( | ||
| <SelectArtistsPreviewContextProvider> | ||
| @@ -91,15 +88,18 @@ export const SelectArtistsScreen = () => { | ||
| </Tab.Navigator> | ||
| <PageFooter | ||
| buttonProps={{ | ||
| disabled: selectedArtists.length < 3, | ||
| disabled: isSubmitting, | ||
| isLoading: isSubmitting, | ||
| onPress: handleSubmit | ||
| }} | ||
| prefix={<SkipButton />} | ||
| postfix={ | ||
| <Text variant='body'> | ||
| {selectArtistsPageMessages.selected} {selectedArtists.length || 0} | ||
| /3 | ||
| </Text> | ||
| prefix={ | ||
| <Flex direction='column' gap='m' alignItems='center'> | ||
| <Text variant='body'> | ||
| {selectArtistsPageMessages.selected}{' '} | ||
| {selectedArtists.length || 0} | ||
| /3 | ||
| </Text> | ||
| </Flex> | ||
| } | ||
| /> | ||
| </Flex> | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a feature flag or something? I thought this fast referral thing was dead