-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: main
Are you sure you want to change the base?
feat: Add snackbars for toggling lock status #678
Conversation
setVariant(variant) | ||
setVisible(true) | ||
}, []), | ||
SnackbarNode, |
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 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 |
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.
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.
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.
@razor-x any thoughts on this?
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.
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.
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.
Yea, I think we're ok to just duplicate it. Otherwise this pattern could result in too many hooks/files, for every snackbar type.
No description provided.