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

PE-6752: hide drives #1892

Merged
merged 25 commits into from
Oct 28, 2024
Merged

PE-6752: hide drives #1892

merged 25 commits into from
Oct 28, 2024

Conversation

thiagocarvalhodev
Copy link
Collaborator

@thiagocarvalhodev thiagocarvalhodev commented Oct 14, 2024

@thiagocarvalhodev thiagocarvalhodev self-assigned this Oct 17, 2024
Copy link

github-actions bot commented Oct 17, 2024

Visit the preview URL for this PR (updated for commit 9f47a53):

https://ardrive-web--pr1892-pe-6752-hide-drives-16psnjy3.web.app

(expires Mon, 04 Nov 2024 17:58:05 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: a224ebaee2f0939e7665e7630e7d3d6cd7d0f8b0

} else if (entryIsFolder) {
newFolderEntry = currentEntry.copyWith(
isHidden: isHidden,
lastUpdated: DateTime.now(),
Copy link
Contributor

Choose a reason for hiding this comment

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

recommend declaring the timestamp as a const and then using it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines 281 to 285
final hideAction = entryIsFile
? (isHidden ? HideAction.hideFile : HideAction.unhideFile)
: (isHidden ? HideAction.hideFolder : HideAction.unhideFolder);
: entryIsDrive
? (isHidden ? HideAction.hideDrive : HideAction.unhideDrive)
: (isHidden ? HideAction.hideFolder : HideAction.unhideFolder);
Copy link
Contributor

Choose a reason for hiding this comment

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

recommend declaring hide action up top and leveraging the if-if-else case above to set it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines 79 to 88
tooltip: hideState is ShowingHiddenItems
? 'Hide hidden items'
: 'Show hidden items',
icon: hideState is ShowingHiddenItems
? ArDriveIcons.eyeOpen(
color: colorTokens.textMid,
)
: ArDriveIcons.eyeClosed(
color: colorTokens.textMid,
),
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like you could combine these ternaries

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines +766 to +774
content: ArDriveDropdownItemTile(
name: item.isHidden
? appLocalizationsOf(context).unhide
: appLocalizationsOf(context).hide,
icon: item.isHidden
? ArDriveIcons.eyeOpen(size: defaultIconSize)
: ArDriveIcons.eyeClosed(size: defaultIconSize),
),
),
Copy link
Contributor

Choose a reason for hiding this comment

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

seems possible to combine ternaries here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant more like:

 content: ArDriveDropdownItemTile(
            item.isHidden ? {
              name: appLocalizationsOf(context).unhide,
              icon: ArDriveIcons.eyeOpen(size: defaultIconSize)
            } : {
              name: appLocalizationsOf(context).hide,
              icon: ArDriveIcons.eyeClose(size: defaultIconSize)
            }
          )

- refactor timestamp and action variables
- remove the option to toggle hide state on the drive explorer (we don't use it anymore)
- refactor where uses the drive detail state to know if we're showing hidden images
karlprieb
karlprieb previously approved these changes Oct 24, 2024
@thiagocarvalhodev thiagocarvalhodev merged commit 0a482a6 into dev Oct 28, 2024
2 checks passed
@thiagocarvalhodev thiagocarvalhodev deleted the PE-6752-hide-drives branch October 28, 2024 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants