-
Notifications
You must be signed in to change notification settings - Fork 1
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
Missions/buttons #29
Missions/buttons #29
Conversation
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.
{!status ? ( | ||
<Badge bg="secondary">Not A Member</Badge> | ||
) : ( | ||
<Badge bg="primary">Active Member</Badge> | ||
)} |
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.
I think it is more efficient to do a variable(But I am not sure we could argue):
const button = !status
? { class: "secondary", text: "Not a Member" }
: { class: "secondary", text: "Active Member" };
.
.
.
<Badge bg={button.class}>{button.text}</Badge>
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.
Thank you for your review @Leboroz, but In my opinion it's not a big deal because React doc uses the same way (Inline If-Else with Conditional Operator)
Maybe your way is more readable but I can use it only with the badges
. But I can't use it with the buttons
because I have events
on these buttons (onClick).
I agree that your way is more readable, so I will implement it on the badges
. π―
Add badge object that contains style and text
Hello @Leboroz πββοΈ,
Thanks for taking the time to review my project.
I've done with these issues