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)
Sat, May 4, 2:59 AM
Unknown Object (File)
Sat, May 4, 2:59 AM
Unknown Object (File)
Sat, May 4, 2:59 AM
Unknown Object (File)
Sat, May 4, 2:57 AM
Unknown Object (File)
Sat, May 4, 2:04 AM
Unknown Object (File)
Thu, May 2, 12:14 AM
Unknown Object (File)
Mar 29 2024, 7:34 PM
Unknown Object (File)
Mar 25 2024, 4:40 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
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