-
Notifications
You must be signed in to change notification settings - Fork 132
[C-3408] Native Create Account Page #6838
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ce8dc60
Create email page + temp harmony components + fixes to harmony native
DejayJD 0211f4f
Merge branch 'main' of github.com:AudiusProject/audius-protocol into …
DejayJD 2410299
share common email schema
DejayJD 947fdf9
fix radial gradient
DejayJD 2e9cbe7
update links
DejayJD 3b3d2b5
add link back to create account
DejayJD 0222d65
fix lint
DejayJD 6c70522
fix lint
DejayJD d6732c9
Update packages/mobile/src/screens/sign-up-screen/screens/CreateEmail…
DejayJD cdc015b
move around messages + PR feedback
DejayJD 7a8c44b
fix type/lint errors
DejayJD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export * from './sign-on/socialMediaMessages' | ||
| export * from './sign-on/pages' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| export const createEmailPageMessages = { | ||
| title: 'Sign Up For Audius', | ||
| emailLabel: 'Email', | ||
| signUp: 'Sign Up Free', | ||
| haveAccount: 'Already have an account?', | ||
| signIn: 'Sign In', | ||
| subHeader: { | ||
| // Two separate lines separated by a divider. Can't include the divider here since its different for native vs web | ||
| line1: 'Join the revolution in music streaming!', | ||
| line2: 'Discover, connect, and create on Audius.' | ||
| }, | ||
| socialsDividerText: 'Or, get started with one of your socials', | ||
| unknownError: 'Unknown error occurred.', | ||
| metaMaskNotRecommended: 'Signing up with MetaMask is not recommended.', | ||
| signUpMetamask: 'Sign Up With MetaMask', | ||
| learnMore: 'Learn More' | ||
| } |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,149 +1,2 @@ | ||
| // TODO(nkang) - convert to TS | ||
| // @ts-nocheck | ||
| import { pick } from 'lodash' | ||
|
|
||
| const trackMetadataSchema = { | ||
| track_cid: null, | ||
| owner_id: null, | ||
| title: null, | ||
| duration: null, | ||
| length: null, | ||
| cover_art: null, | ||
| cover_art_sizes: null, | ||
| tags: null, | ||
| genre: null, | ||
| mood: null, | ||
| credits_splits: null, | ||
| created_at: null, | ||
| // TODO: CREATE DATE IS REQUIRED, BUT THIS FIELD IS NEVER USED. | ||
| create_date: null, | ||
| updated_at: null, | ||
| release_date: null, | ||
| file_type: null, | ||
| track_segments: [], | ||
| has_current_user_reposted: false, | ||
| followee_reposts: null, | ||
| followee_saves: null, | ||
| is_current: true, | ||
| is_unlisted: false, | ||
| is_premium: false, | ||
| premium_conditions: null, | ||
| preview_start_seconds: null, | ||
| audio_upload_id: null, | ||
| field_visibility: { | ||
| genre: true, | ||
| mood: true, | ||
| tags: true, | ||
| share: false, | ||
| play_count: false, | ||
| remixes: true | ||
| }, | ||
| remix_of: null, | ||
| repost_count: 0, | ||
| save_count: 0, | ||
| description: null, | ||
| license: null, | ||
| isrc: null, | ||
| iswc: null, | ||
| download: null, | ||
| is_playlist_upload: false, | ||
| ai_attribution_user_id: null | ||
| } | ||
|
|
||
| export const newTrackMetadata = (fields, validate = false): TrackMetadata => { | ||
| const validFields = validate | ||
| ? pick(fields, Object.keys(trackMetadataSchema).concat(['track_id'])) | ||
| : fields | ||
| const remixParentTrackId = fields?.remix_of?.tracks?.[0]?.parent_track_id | ||
| return { | ||
| ...trackMetadataSchema, | ||
| track_segments: [...trackMetadataSchema.track_segments], | ||
| followee_reposts: [...(trackMetadataSchema.followee_reposts || [])], | ||
| followee_saves: [...(trackMetadataSchema.followee_saves || [])], | ||
| ...validFields, | ||
| // Reformat remixes last so we don't carry through any extra metadata that | ||
| // was part of the remix_of response from backends | ||
| remix_of: remixParentTrackId | ||
| ? createRemixOfMetadata({ parentTrackId: remixParentTrackId }) | ||
| : null | ||
| } | ||
| } | ||
|
|
||
| const collectionMetadataSchema = { | ||
| is_album: false, | ||
| is_current: true, | ||
| is_private: true, | ||
| tags: null, | ||
| genre: null, | ||
| mood: null, | ||
| created_at: null, | ||
| updated_at: null, | ||
| cover_art: null, | ||
| cover_art_sizes: null, | ||
| playlist_name: '', | ||
| playlist_owner_id: null, | ||
| save_count: null, | ||
| license: null, | ||
| upc: null, | ||
| description: null | ||
| } | ||
|
|
||
| export const newCollectionMetadata = (fields?: any, validate = false) => { | ||
| const validFields = validate | ||
| ? pick( | ||
| fields, | ||
| Object.keys(collectionMetadataSchema).concat(['playlist_id']) | ||
| ) | ||
| : fields | ||
| return { | ||
| ...collectionMetadataSchema, | ||
| ...validFields | ||
| } | ||
| } | ||
|
|
||
| const userMetadataSchema = { | ||
| allow_ai_attribution: false, | ||
| wallet: '', | ||
| name: null, | ||
| handle: '', | ||
| profile_picture: null, | ||
| profile_picture_sizes: null, | ||
| cover_photo_sizes: null, | ||
| cover_photo: null, | ||
| bio: null, | ||
| location: null, | ||
| is_verified: false, | ||
| creator_node_endpoint: null, | ||
| updated_at: null, | ||
| associated_wallets: null, | ||
| associated_sol_wallets: null, | ||
| collectibles: null, | ||
| playlist_library: null, | ||
| events: null, | ||
| is_deactivated: false, | ||
| artist_pick_track_id: null | ||
| } | ||
|
|
||
| export const newUserMetadata = (fields?: any, validate = false): User => { | ||
| const validFields = validate | ||
| ? pick(fields, Object.keys(userMetadataSchema).concat(['user_id'])) | ||
| : fields | ||
| return { | ||
| ...userMetadataSchema, | ||
| ...validFields | ||
| } | ||
| } | ||
|
|
||
| export const createRemixOfMetadata = ({ | ||
| parentTrackId | ||
| }: { | ||
| parentTrackId: number | ||
| }) => { | ||
| return { | ||
| tracks: [ | ||
| { | ||
| parent_track_id: parentTrackId | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| export * from './metadata' | ||
| export * from './sign-on/emailSchema' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| // TODO(nkang) - convert to TS | ||
| // @ts-nocheck | ||
|
|
||
| import { pick } from 'lodash' | ||
|
|
||
| const trackMetadataSchema = { | ||
| track_cid: null, | ||
| owner_id: null, | ||
| title: null, | ||
| duration: null, | ||
| length: null, | ||
| cover_art: null, | ||
| cover_art_sizes: null, | ||
| tags: null, | ||
| genre: null, | ||
| mood: null, | ||
| credits_splits: null, | ||
| created_at: null, | ||
| // TODO: CREATE DATE IS REQUIRED, BUT THIS FIELD IS NEVER USED. | ||
| create_date: null, | ||
| updated_at: null, | ||
| release_date: null, | ||
| file_type: null, | ||
| track_segments: [], | ||
| has_current_user_reposted: false, | ||
| followee_reposts: null, | ||
| followee_saves: null, | ||
| is_current: true, | ||
| is_unlisted: false, | ||
| is_premium: false, | ||
| premium_conditions: null, | ||
| preview_start_seconds: null, | ||
| audio_upload_id: null, | ||
| field_visibility: { | ||
| genre: true, | ||
| mood: true, | ||
| tags: true, | ||
| share: false, | ||
| play_count: false, | ||
| remixes: true | ||
| }, | ||
| remix_of: null, | ||
| repost_count: 0, | ||
| save_count: 0, | ||
| description: null, | ||
| license: null, | ||
| isrc: null, | ||
| iswc: null, | ||
| download: null, | ||
| is_playlist_upload: false, | ||
| ai_attribution_user_id: null | ||
| } | ||
|
|
||
| export const newTrackMetadata = (fields, validate = false): TrackMetadata => { | ||
| const validFields = validate | ||
| ? pick(fields, Object.keys(trackMetadataSchema).concat(['track_id'])) | ||
| : fields | ||
| const remixParentTrackId = fields?.remix_of?.tracks?.[0]?.parent_track_id | ||
| return { | ||
| ...trackMetadataSchema, | ||
| track_segments: [...trackMetadataSchema.track_segments], | ||
| followee_reposts: [...(trackMetadataSchema.followee_reposts || [])], | ||
| followee_saves: [...(trackMetadataSchema.followee_saves || [])], | ||
| ...validFields, | ||
| // Reformat remixes last so we don't carry through any extra metadata that | ||
| // was part of the remix_of response from backends | ||
| remix_of: remixParentTrackId | ||
| ? createRemixOfMetadata({ parentTrackId: remixParentTrackId }) | ||
| : null | ||
| } | ||
| } | ||
|
|
||
| const collectionMetadataSchema = { | ||
| is_album: false, | ||
| is_current: true, | ||
| is_private: true, | ||
| tags: null, | ||
| genre: null, | ||
| mood: null, | ||
| created_at: null, | ||
| updated_at: null, | ||
| cover_art: null, | ||
| cover_art_sizes: null, | ||
| playlist_name: '', | ||
| playlist_owner_id: null, | ||
| save_count: null, | ||
| license: null, | ||
| upc: null, | ||
| description: null | ||
| } | ||
|
|
||
| export const newCollectionMetadata = (fields?: any, validate = false) => { | ||
| const validFields = validate | ||
| ? pick( | ||
| fields, | ||
| Object.keys(collectionMetadataSchema).concat(['playlist_id']) | ||
| ) | ||
| : fields | ||
| return { | ||
| ...collectionMetadataSchema, | ||
| ...validFields | ||
| } | ||
| } | ||
|
|
||
| const userMetadataSchema = { | ||
| allow_ai_attribution: false, | ||
| wallet: '', | ||
| name: null, | ||
| handle: '', | ||
| profile_picture: null, | ||
| profile_picture_sizes: null, | ||
| cover_photo_sizes: null, | ||
| cover_photo: null, | ||
| bio: null, | ||
| location: null, | ||
| is_verified: false, | ||
| creator_node_endpoint: null, | ||
| updated_at: null, | ||
| associated_wallets: null, | ||
| associated_sol_wallets: null, | ||
| collectibles: null, | ||
| playlist_library: null, | ||
| events: null, | ||
| is_deactivated: false, | ||
| artist_pick_track_id: null | ||
| } | ||
|
|
||
| export const newUserMetadata = (fields?: any, validate = false): User => { | ||
| const validFields = validate | ||
| ? pick(fields, Object.keys(userMetadataSchema).concat(['user_id'])) | ||
| : fields | ||
| return { | ||
| ...userMetadataSchema, | ||
| ...validFields | ||
| } | ||
| } | ||
|
|
||
| export const createRemixOfMetadata = ({ | ||
| parentTrackId | ||
| }: { | ||
| parentTrackId: number | ||
| }) => { | ||
| return { | ||
| tracks: [ | ||
| { | ||
| parent_track_id: parentTrackId | ||
| } | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { z } from 'zod' | ||
|
|
||
| import { AudiusQueryContextType } from 'audius-query' | ||
| import { signUpFetch } from 'src/api' | ||
| import { EMAIL_REGEX } from 'utils/email' | ||
|
|
||
| export const emailSchemaMessages = { | ||
| invalidEmail: 'Please enter a valid email.', | ||
| emailInUse: 'Email already taken.' | ||
| } | ||
|
|
||
| export const emailSchema = <T extends AudiusQueryContextType>( | ||
| queryContext: T | ||
| ) => | ||
| z.object({ | ||
| email: z | ||
| .string({ required_error: emailSchemaMessages.invalidEmail }) | ||
| .regex(EMAIL_REGEX, { message: emailSchemaMessages.invalidEmail }) | ||
| .refine( | ||
| async (email) => { | ||
| return !(await signUpFetch.isEmailInUse({ email }, queryContext)) | ||
| }, | ||
| { message: emailSchemaMessages.emailInUse } | ||
| ) | ||
| }) |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| export * from './Link' | ||
| export * from './layout' |
6 changes: 6 additions & 0 deletions
6
packages/mobile/src/harmony-native/components/layout/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| export * from './Box/Box' | ||
| export * from './Box/types' | ||
| export * from './Flex/Flex' | ||
| export * from './Flex/types' | ||
| export * from './Paper/Paper' | ||
| export * from './Paper/types' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
idk why but this "barrel file" actually had stuff in here