-
Notifications
You must be signed in to change notification settings - Fork 0
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: Implement custom button #7
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.
Left detailed comment about the theming and the coloring of the button component. Generally make use of existing functionalities and features of the libraries we use and do not think about how to implement this alone. Everything will be handled by the libraries for you, thats why we use them, not to define and do everything ourselves!
Also make sure you always merge main into your branch before creating a PR and always check for conflicts!
* Custom button component in the variants solid, bordered and flat. It can be used like a normal NextUI button | ||
* component. | ||
* @param variant solid | bordered | flat | ||
* @constructor |
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.
remove @constructor
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.
This file contains a lot of duplicated code. Generally all cases could be summarized in one and there is no need of having the same component with few changes for all cases. Imagine having 100 variants for the button, this simply will not work and the file will grow a lot. It's considered a good practice to separate the concerns (here styling and react component).
Nevertheless we use tailwindcss, which means we do not use style
on the component but everything will be with className="tailwindClasses"
. Also you do not need to check for the theme here, neither you do need the useEffects for the theme switch. Everything you need will be handled by NextUI and TailwindCSS. Colors and everything will be defined in thiw way, not custom css colors: Check here. Also check the existing tailwind.config.js
and research how to apply all colors and customize them there.
0e01723
to
0ceb1e5
Compare
Since the tailwind classes work properly now I refactored everything and made use of the tailwind classes. The colors when hovering don't align perfectly with Figma because NextUI automatically lowers the opacity when hovered. The alternative would have been to disable this functionality but this could also have an effect on other components. |
0ceb1e5
to
8ed75e2
Compare
8ed75e2
to
10e7e99
Compare
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.
LGTM!
You can test the buttons on the /elements page