Open l-monninger opened 2 years ago
Lol, dude... This made me chuckle
export const variantMap = Variants.map((Variant) => VARIANT_STYLES);
.map
is a container method to transform an array of values to another array of values.
What you need is to map variants using an object that has keys which are the variants, and styles values which are the styles. What I was suggesting above is that you do something like this.
{
do : [['green', 'white', 'gray'], ['white', 'green', 'gray']]
}
The first three entries are for the button displaying statically. The second three could either be for the button under hover, or the button when inverted. We you get this closer to done, we'll talk through how to project this down into the design system.
I didn't give you the exact place to store the button as a bit of a puzzle. components/navigation
is not where it should go. And, it was a bit of trick question because the exact folder does not yet exist. It should be components/input/unary/Button
. Can you guess why?
You've got way too many if statements for this one my dude. Learn how to do the mapping above, and you should be able to figure out how to trim this down.
Implement roughly the same button you did in our exercises. The spec is as follows:
Spec:
loading
,success
,error
,warning
,helping
, andhinting
states.success
orerror
into default.variants
. Other color patterns should be achievable, but only by disregarding the basic variants and overriding.variants
at least should cover the following verbsdo
,get info
,get user info
,navigate
,find
,sort
,install
,comment
, andget help
.Spec draftsheet
Suggestions:
react-bootstrap-icons
.variants
. Just provide a map to a tuple of tuples[[string, string, string], [string, string, string]]
which describe the the background, border, and font colors. Then use that map to render the button.react-bootstrap-icons
using SVG gator. Just don't take too much time.