-
Notifications
You must be signed in to change notification settings - Fork 255
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
Dashboard UI for adding users to a team #334
Conversation
fomalhautb
commented
Nov 8, 2024
•
edited
Loading
edited
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
toast({ title: 'User added to team', variant: 'success' }); | ||
} catch (error) { | ||
if (error instanceof KnownErrors.TeamMembershipAlreadyExists) { | ||
toast({ title: 'User already a member of this team', variant: 'destructive' }); |
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.
IMO toasts are for things that are not crucial to the user flow (eg. "everything went as planned") — this should be an alert
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.
Actually, I think it is better to show an "added" button (see the updated image in the PR description). It will be a bit more annoying when we later paginate the team-member tables as we will need to do it on the server side, but we can worry about that later
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.
What happens if the user was not added successfully because they're already in the team?
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.
Ah nvm I get what you mean now
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.
SGTM
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 toast is not necessary though — from a user perspective, "the user has been added" and "the user has already been on the team" is equivalent