pingcap / website

The website of PingCAP. Powered by Gatsby ⚛️ and Rocket 🚀.
11 stars 21 forks source link

I recommend using 'classnames' for code readability #273

Open cw1997 opened 3 years ago

cw1997 commented 3 years ago

classnames is classnames

https://github.com/pingcap/website/blob/3d50973ad6c2a64d48c5930663a126886b09456c/src/components/navbar.js#L58

use classnames instead of ternary operator: replace

className={`${showBorder ? ' has-border-and-shadow' : ''}`

to

className={classnames({'has-border-and-shadow': showBorder})}