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

ui: CSS modules for Button component #48155

Merged
merged 8 commits into from
Jun 9, 2020

Conversation

koorosh
Copy link
Collaborator

@koorosh koorosh commented Apr 29, 2020

Depends on #48090
Related to #47527

Before, Button component had styles defined with
own namespacing and now styles are imported as
CSS module.

The main change is separation BackIcon component
which was coupled with Button and the way
custom styles were applied to display button as
a link without highlighting.

  • BackIcon is refactored to it's own module with
    styles
  • custom styles are applied with new Button type
    option - unstyled-link.

Release note: None

@koorosh koorosh requested a review from a team April 29, 2020 14:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@koorosh koorosh marked this pull request as draft April 29, 2020 14:26
@koorosh koorosh added the do-not-merge bors won't merge a PR with this label. label Apr 30, 2020
@blathers-crl
Copy link

blathers-crl bot commented Apr 30, 2020

❌ The GitHub CI (Cockroach) build has failed on 29f7a7ba.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@koorosh koorosh marked this pull request as ready for review April 30, 2020 13:43
@koorosh koorosh removed the do-not-merge bors won't merge a PR with this label. label Jun 5, 2020
This change refactors following components to
use CSS modules instead of styles defined as
global:
- Dropdown
- Search
- PageConfig

Release note: None
Following components are refactored to use CSS modules
 instead of global styles:
- Statement Details page
- Statements Diagnostics components
- Anchor
- Text
- Empty

Before, `Empty` component had styles which override
 Text, and Anchor components. Now, these styles are
 passed via `className` component props and custom
 styles defined by outer component.

Release note: None
Statement Details pages has four tabs which aren't
controlled and it wasn't possible to open particular
tab and render it in storybook. It is also led to
usability issue where selected tab was not preserved
after page refresh.

With current commit:
- selected tab is tracked as search param in URL
- added storybook for Statement Details page for
every tab except Diagnostics tab.
Content of Diagnostics tab is independent connected
view and has to be defined in it's own storybook.

Release note (admin ui change): preserve selected tab in Statement
Details page after reload.
Instead of accessing to CSS modules class names as fields,
`classnames/bind` function is used to bind class names to
hashed names in imported CSS module file.

Release note: None
Following components are refactored to use CSS modules
 instead of global styles:
- Statement Details page
- Statements Diagnostics components
- Anchor
- Text
- Empty

Before, `Empty` component had styles which override
 Text, and Anchor components. Now, these styles are
 passed via `className` component props and custom
 styles defined by outer component.

Release note: None
Before, Button component had styles defined with
own namespacing and now styles are imported as
CSS module.

The main change is separation BackIcon component
which was coupled with Button and the way
custom styles were applied to display button as
a link without highlighting.

- BackIcon is refactored to it's own module with
styles
- custom styles are applied with new Button type
option - `unstyled-link`.

Release note: None
@koorosh
Copy link
Collaborator Author

koorosh commented Jun 9, 2020

bors r+

@craig
Copy link
Contributor

craig bot commented Jun 9, 2020

Build succeeded

@craig craig bot merged commit d9ae34b into cockroachdb:master Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants