Skip to content
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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

jakzaizzat
Copy link
Collaborator

@jakzaizzat jakzaizzat commented May 2, 2024

Summary of Changes

  • Able to create a new gallery
  • Added a publish flow screen too after created gallery
  • Able to delete gallery

Demo or Before/After Pics

CleanShot.2024-05-03.at.13.50.40.mp4

Edge Cases

  1. Create a new gallery and deleted it
  2. Edit the new created gallery
  3. Edit the existing gallery

Testing Steps

Provide steps on how the reviewer can test the changes.

Checklist

Please make sure to review and check all of the following:

  • I've tested the changes and all tests pass.
  • (if web) I've tested the changes on various desktop screen sizes to ensure responsiveness.
  • (if mobile) I've tested the changes on both light and dark modes.

Copy link

vercel bot commented May 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gallery ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 7:13am

Copy link

github-actions bot commented May 2, 2024

Bundle Sizes

Compared against decf548

Route: No significant changes found

Dynamic import: No significant changes found

);

// get first section in the gallery
const firstSection = gallery.collections?.[0];
Copy link
Collaborator Author

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

Comment on lines +54 to +89
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;
}
Copy link
Collaborator Author

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.

Comment on lines +397 to +404
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 };
}
Copy link
Collaborator Author

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

Comment on lines +390 to +393
if (communityIds.size === 1 && tokensToAdd[0]) {
sectionName = tokensToAdd[0].communityName;
sectionCollectorsNote = tokensToAdd[0].communityDescription;
}
Copy link
Collaborator Author

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']>
Copy link
Collaborator Author

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.

@jakzaizzat jakzaizzat changed the title Jakz/blank gallery editor Create new gallery & delete gallery May 3, 2024
@jakzaizzat jakzaizzat marked this pull request as ready for review May 3, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant