Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

[C-2685 C-2686] Implement collection upload form #3870

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

dylanjeffers
Copy link
Contributor

@dylanjeffers dylanjeffers commented Aug 10, 2023

Description

Implements collection upload form using formik + beautiful-dnd

Dragons

I would like to see if there is an easy way to animate out tracks that have been removed. Right now they just suddenly disappear.

image image

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/dj-collection-form-2

Comment on lines +29 to +30
<SelectGenreField name={getTrackFieldName(index, 'genre')} />
<SelectMoodField name={getTrackFieldName(index, 'mood')} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, much easier to read

import { useField } from 'formik'

const getFieldName = (base: string, index: number, path: string) =>
`${base}.${index}.${path}`

export const useIndexedField = <T>(
base: string,
index: number,
index: Maybe<number>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pleases me. If only we had data types and proper pattern matching


const [{ value: metadata }, , { setValue }] = useField<
CollectionTrackForUpload['metadata']
>(`tracks.${index}.metadata`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any sense in a useTrackOverrideField hook?
I guess here the index is known ahead of time, so maybe not necessary

Comment on lines +12 to +21
<FieldArray name='tracks'>
{({ move, remove }) => (
<DragDropContext
onDragEnd={(result) => {
if (!result.destination) {
return
}
move(result.source.index, result.destination.index)
}}
>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is so nice

Comment on lines +14 to +17
.row {
display: flex;
gap: var(--unit-4);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

layoutStyles has row and gap4

Any thoughts on that pattern now that we've been trying it for a bit?
I've enjoyed having the utilities, and I like having the role of the div apparent in code, however it sometimes makes the divs a bit verbose.

.trackField {
display: flex;
padding: var(--unit-4);
margin: 0 0 var(--unit-2) 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just use margin-bottom?


.overrideRow {
display: flex;
padding: var(--unit-2) 0px var(--unit-2) 72px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

72px => --unit-18

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also couldn't we do this with a separate flex container for the left and right groups and a parent with justify-content: space-between?

I feel like padding this big should be very rare


const handleSubmit = useCallback(
(values: CollectionValues) => {
console.log('submitting', values)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log

@dylanjeffers dylanjeffers merged commit bae86c3 into main Aug 15, 2023
2 checks passed
@dylanjeffers dylanjeffers deleted the dj-collection-form-2 branch August 15, 2023 03:31
schottra added a commit that referenced this pull request Aug 17, 2023
…e-page

* origin/main:
  [PAY-1720] Implements PlainButton (#3897)
  Fix minor bugs for multi-track upload demo (#3854)
  Limit lines in Leaving Audius Modal (#3896)
  [C-2681, C-2682, C-2683] Add new upload finish page (#3890)
  [C-2914] USDC purchase options for new upload UI (web) (#3888)
  Minor UI fixes for leaving audius modal (#3895)
  Fix OAuth login page width (#3894)
  Fix playlist form from crashing after double save (#3893)
  Update seo h1 to be accessibly hidden vs visually hidden (#3892)
  Move setCollectionPermalink within fetchCollectionSucceeded action (#3867)
  [plat-1055] revert legacy playlist route formatting in embed player to use permalink (#3824)
  [PAY-1717] Make sign in/sign up page overlap banner (#3886)
  [PAY-1658] Artist pick, hidden track tile tags moved to mid-left (#3889)
  [C-2957] Add h1 tag for SEO (#3887)
  [C-2685 C-2686] Implement collection upload form (#3870)
  [PAY-1702] Use existing chats as default user list when sharing to DMs (#3877)
  [PAY-1701] Fix "Share to DMs" on mobile to go through InboxUnavailable modal (#3878)
  [PAY-1700] Replace navigation if coming from ChatUserListScreen (#3879)
  [PAY-1588] Use existing balance in purchase flow on mobile (#3885)
audius-infra pushed a commit that referenced this pull request Aug 19, 2023
[bd3fdc7] [C-2972] Fix feed, trending track-page seo (#3907) Dylan Jeffers
[45279fe] [C-2969] Fix related artist images not loading (#3905) Andrew Mendelsohn
[f51e6ac] [C-2961] Fix LeftNav SEO (#3906) Dylan Jeffers
[6256792] Fix lint in useUserProfilePicture (#3903) Dylan Jeffers
[f7dc55b] [C-2971] Add Avatar (#3902) Dylan Jeffers
[ce441c1] [C-2970] Add Link, Improve Text (#3901) Dylan Jeffers
[72fcc88] [PAY-1631] Implements post-purchase content on web (#3898) Randy Schott
[0f28578] [C-2964] Cannonical URL should be uri encoded (#3899) Raymond Jacobson
[3fca3c9] [C-2684 C-2955] Improve upload component hierarchy, state, and validation (#3891) Dylan Jeffers
[3138da3] [PAY-1720] Implements PlainButton (#3897) Randy Schott
[b353f94] Fix minor bugs for multi-track upload demo (#3854) Andrew Mendelsohn
[22d4be5] Limit lines in Leaving Audius Modal (#3896) Marcus Pasell
[b73b2f6] [C-2681, C-2682, C-2683] Add new upload finish page (#3890) Kyle Shanks
[5d94b1f] [C-2914] USDC purchase options for new upload UI (web) (#3888) Andrew Mendelsohn
[30cc8f1] Minor UI fixes for leaving audius modal (#3895) Marcus Pasell
[970f411] Fix OAuth login page width (#3894) nicoback2
[deff919] Fix playlist form from crashing after double save (#3893) sabrina-kiam
[18227f3] Update seo h1 to be accessibly hidden vs visually hidden (#3892) Dylan Jeffers
[594b5c4] Move setCollectionPermalink within fetchCollectionSucceeded action (#3867) sabrina-kiam
[9165c76] [plat-1055] revert legacy playlist route formatting in embed player to use permalink (#3824) sabrina-kiam
[eb747cf] [PAY-1717] Make sign in/sign up page overlap banner (#3886) Marcus Pasell
[2887342] [PAY-1658] Artist pick, hidden track tile tags moved to mid-left (#3889) Reed
[2c80443] [C-2957] Add h1 tag for SEO (#3887) Raymond Jacobson
[bae86c3] [C-2685 C-2686] Implement collection upload form (#3870) Dylan Jeffers
[1c7ec6f] [PAY-1702] Use existing chats as default user list when sharing to DMs (#3877) Marcus Pasell
[bf09344] [PAY-1701] Fix "Share to DMs" on mobile to go through InboxUnavailable modal (#3878) Marcus Pasell
[9c9d7f4] [PAY-1700] Replace navigation if coming from ChatUserListScreen (#3879) Marcus Pasell
[eaef4e6] [PAY-1588] Use existing balance in purchase flow on mobile (#3885) Reed
[49d1d05] Add fb share page (#3876) Raymond Jacobson
[46c33eb] Change nullish check to falsey check for collection track times (#3884) Kyle Shanks
[b773045] Update twitter icon on mobile (#3880) Reed
[dfc6c60] [PAY-1707] Implements usage of existing balance during content purchases (#3883) Randy Schott
[5b4242f] [PAY-1592] Wire up USDC purchase flow on mobile (#3881) Reed
[41cc4af] [PAY-1629] Purchase flow cleanup (#3873) Randy Schott
@AudiusProject AudiusProject deleted a comment from linear bot Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants