Skip to content
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

Use classnames package to improve conditional class names #12

Open
sphynx opened this issue Jun 21, 2020 · 1 comment
Open

Use classnames package to improve conditional class names #12

sphynx opened this issue Jun 21, 2020 · 1 comment
Labels
good first issue Good for newcomers web

Comments

@sphynx
Copy link
Owner

sphynx commented Jun 21, 2020

Now we have some code to conditional classes like this:

const kindClass = props.kind.toLowerCase();
const selectedClass = props.selected ? 'selected-card' : '';
...
return ( 
  <div className={`card ${kindClass} ${selectedClass}`}>
...
);

which can be made neater by using classnames.

See this for details:

@sphynx sphynx added web good first issue Good for newcomers labels Jun 21, 2020
@mahtabhnp
Copy link

I’d like to work on this issue. Can you assign it to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers web
Projects
None yet
Development

No branches or pull requests

2 participants