code4rena-dev / components-library

Components library for Code4rena, and accessible as a package to be used in React based Code4rena products.
https://components-library-wine.vercel.app
0 stars 0 forks source link

Button component #59

Open SamusElderg opened 5 months ago

SamusElderg commented 5 months ago

Just collating some button component thoughts here whilst been playing with it recently in WMA and core app

Currently if you choose to use a href it converts the button to a link type.

This means these both dont apply:

A button definitely should have a disabled option available even if it points to a link, so we should change that to accommodate.

And there are reasons to include an onClick along with a link, for instance if you need the app to do an action or change a state before routing to the linked page (especially for external links that open in a new page/tab)


We also dont handle internal links with the nextjs router, i wonder if we can drop the href & external options and have some kind of a linkElement instead where we can hand in either <Link or <a href based on our needs?


Style updates: not sure if the Figma is behind or ahead of the current styling but looks like the padding is more narrow in Figma (which i feel would be an improvement) so might be a good opportunity to get the design aligned/refreshed while we consider/implement the above