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)
Thu, Nov 14, 4:49 PM
Unknown Object (File)
Thu, Nov 14, 4:49 PM
Unknown Object (File)
Thu, Nov 14, 4:49 PM
Unknown Object (File)
Thu, Nov 14, 4:48 PM
Unknown Object (File)
Thu, Nov 14, 4:35 PM
Unknown Object (File)
Oct 15 2024, 9:49 AM
Unknown Object (File)
Oct 15 2024, 9:49 AM
Unknown Object (File)
Oct 15 2024, 9:49 AM
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
No Lint Coverage
Unit
No Test Coverage

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