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

feat: Add snackbars for toggling lock status #678

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

Conversation

kadiryazici
Copy link
Member

No description provided.

setVariant(variant)
setVisible(true)
}, []),
SnackbarNode,
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are going to keep this snackbar hook, can we just rename this to ToggleLockSnackbar instead of the generic SnackbarNode?

setVisible(false)
}}
message={
variant === 'success' ? t.successfullyUpdated : t.failedToUpdate
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this pattern mean we'll need a new hook (and file) for every single snackbar going forward? or maybe we only create one if it is being used in multiple places?

IMO duplicating seems simpler here instead of a separate hook.

Copy link
Contributor

Choose a reason for hiding this comment

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

@razor-x any thoughts on this?

Copy link
Member Author

Choose a reason for hiding this comment

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

the reason why I created a hook is there is two different components that are toggling snackbars. In order not to duplicate the code I created a hook for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea, I think we're ok to just duplicate it. Otherwise this pattern could result in too many hooks/files, for every snackbar type.

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.

2 participants