Page MenuHomePhabricator

[web] Introduce plain Button variant
ClosedPublic

Authored by michal on Oct 11 2022, 6:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 18, 11:00 AM
Unknown Object (File)
Wed, Dec 18, 11:00 AM
Unknown Object (File)
Wed, Dec 18, 11:00 AM
Unknown Object (File)
Wed, Dec 18, 10:58 AM
Unknown Object (File)
Wed, Dec 18, 10:46 AM
Unknown Object (File)
Mon, Nov 25, 8:16 PM
Unknown Object (File)
Mon, Nov 25, 8:16 PM
Unknown Object (File)
Nov 24 2024, 2:46 PM
Subscribers

Details

Summary

Part of ENG-843
Introduces plain Button variant with minimal css properties. It becomes the default variant, so this diff also changes any Buttons without explicit variant to use filled.

Also makes the onClick nullable and sets the type to button to make it more general.

This variant is used in a later diff.

Test Plan
  • Run flow
  • Check if all changed buttons look and work the same
  • Check if there is any <form> that uses a Button without an explicit type set

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

michal edited the test plan for this revision. (Show Details)

Looks good, just a suggestion on using different variant of classnames(...).

web/components/button.react.js
38–43 ↗(On Diff #17489)

There's another variant of classnames(...) that we could use here. It would look something like:

const btnCls = classnames({
  [css.plain]: true,
  [css[variant]]: true,
  [css.btn]: variant !== 'plain',
  [css[buttonColor]]: typeof buttonColor === 'string',
});

Personally think it would be a little cleaner/easier to read. If you do decide to go with that approach, I'd make sure to do some testing and make sure that buttons appear as expected.

This revision is now accepted and ready to land.Oct 11 2022, 7:56 AM

good stuff, I agree with Atul's comment