-
Notifications
You must be signed in to change notification settings - Fork 15
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
Create new gallery & delete gallery #2453
base: main
Are you sure you want to change the base?
Conversation
…z/blank-gallery-editor
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Bundle SizesCompared against decf548 Route: No significant changes found Dynamic import: No significant changes found |
); | ||
|
||
// get first section in the gallery | ||
const firstSection = gallery.collections?.[0]; |
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.
Only get the first section of gallery for rendering gallery preview. Since it only have a small container
if (route.params.isNewGallery) { | ||
// reset the navigation stack to remove the nft selector screen | ||
navigation.reset({ | ||
index: 0, | ||
routes: [ | ||
{ | ||
name: 'MainTabs', | ||
state: { | ||
index: 0, | ||
routes: [ | ||
{ | ||
name: 'AccountTab', | ||
params: { | ||
screen: 'Profile', | ||
params: { | ||
username, | ||
navigateToTab: 'Galleries', | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: 'GalleryEditor', | ||
params: { | ||
galleryId: route.params.galleryId, | ||
stagedTokens: route.params.stagedTokens, | ||
isNewGallery: false, | ||
}, | ||
}, | ||
], | ||
}); | ||
|
||
return; | ||
} |
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.
Reset the navigation stack if its a new create gallery flow.
updateRow(rowId, (previousRow) => { | ||
if (previousRow.items.length === 0) { | ||
isNewSection = true; | ||
// if the total number of tokens is less than 6, then the number of columns should be equal to the number of tokens | ||
// if more than 6, then the number of columns should be equal to 6 | ||
const columns = tokensToAdd.length < 6 ? tokensToAdd.length : 6; | ||
return { ...previousRow, items: tokensToAdd, columns }; | ||
} |
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.
If its a new section/row, the row will be updated based on how many tokens been added
if (communityIds.size === 1 && tokensToAdd[0]) { | ||
sectionName = tokensToAdd[0].communityName; | ||
sectionCollectorsNote = tokensToAdd[0].communityDescription; | ||
} |
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.
If the user only select token from the same community, we wanna populate the community name and description into editor
async ( | ||
position: string, | ||
onSuccess: (galleryId: string) => void, | ||
updater?: SelectorStoreUpdater<useCreateGalleryMutation['response']> |
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.
Add updater
props here to isolate the updater from web and mobile.
Summary of Changes
Demo or Before/After Pics
CleanShot.2024-05-03.at.13.50.40.mp4
Edge Cases
Testing Steps
Provide steps on how the reviewer can test the changes.
Checklist
Please make sure to review and check all of the following: