Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

[V2] Button sizes #1633

Merged
merged 7 commits into from
Nov 20, 2020
Merged

[V2] Button sizes #1633

merged 7 commits into from
Nov 20, 2020

Conversation

W3stside
Copy link
Contributor

馃挧 into #1632

Adds theme capabilities for creating sized versions of buttons and creates a ThemeProvider wrapped Button default export

See stories BIG and SMOL to test

@gnosis-info
Copy link

Travis automatic deployment:

  • 馃帺 Dapp: Testing web app
  • 馃摎 Storybook: Component stories

Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll approve this one, but has the same concern that the other PR in the waterfall 馃挧

src/components/common/Button/index.stories.tsx Outdated Show resolved Hide resolved
// Wrap ColouredAndSizedButtonsBase in it's own ThemeProvider which takes the toplevel app theme
// ThemeProvider and interpolate over it's props
const ThemedButtonBase: React.FC<React.ButtonHTMLAttributes<Element>> = (props) => (
<ThemeProvider theme={({ mode }: ThemeMode): ThemeMap => ({ mode, component: 'buttons' })}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure how styled-theming works, but can't we, instead of an extra Provider, do variants('mode', 'size', like here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but the theme structure then falls on sth like:

{ 
  big: {
    light: { ... }
  }
}

where light and big have no connection

Base automatically changed from v2/colour-sheet-pt1 to v2/button-theming November 20, 2020 10:24
1. kind > $type
2. size > $size
@W3stside W3stside merged commit 6c5ff70 into v2/button-theming Nov 20, 2020
W3stside added a commit that referenced this pull request Jan 5, 2021
* added styled-theming lib

* styling sheets

1. colours
2. styles
3. commented out stuff in theme

* simplify ButtonBase code + add stories

* adjust darkMode decorator for new theme

1, add colour to colourSheet

* StyledButton base

* addressed PR comments:

1. added type to Story
2. Changed DarkThemeTOggler to ThemeToggler
3. simplified ButtonVariant enum

* fix button type, add disabled button, string enum

1. use string enum as button type
2. default to dark mode on start

* [V2] Colour Sheet from Invision wireframes + added to Button + stories (#1632)

* cleanup button story

* new colour sheet

* fix type, remove class styles, use const style

* use new colours in StyledButton

* misc.

1. add borderRadius to const
2. use theme bg for darkMode switch

* [V2] Button sizes (#1633)

* wrap our base styled button in own theme provider and add size opt

* add proper types for button size

* Stories: add B I G and smol button stories

* misc.

1. make theme toggle button smol
2. add buttonFontSize to styles sheet

* enum > type for ButtonVariations

* incorrect darkMode button logo

* better prop names (#1637)

1. kind > $type
2. size > $size

* [V2 button] Rearrange component file structure and small prop fixes (#1640)

* saving

* $transient name props not allowed - use _propName

* change props again

* _type > variation
* _size > size

* variation > variant prop name
W3stside added a commit that referenced this pull request Jan 7, 2021
* creating theme pt 1

* theme

* DarkModeThemeToggler decorator

* Button common component

* Button story

* cleaned up Theme types

* simplify ButtonBase prop logic

* unmemo fn

* fix story bprops

* V2/button theming (#1626)

* added styled-theming lib

* styling sheets

1. colours
2. styles
3. commented out stuff in theme

* simplify ButtonBase code + add stories

* adjust darkMode decorator for new theme

1, add colour to colourSheet

* StyledButton base

* addressed PR comments:

1. added type to Story
2. Changed DarkThemeTOggler to ThemeToggler
3. simplified ButtonVariant enum

* fix button type, add disabled button, string enum

1. use string enum as button type
2. default to dark mode on start

* [V2] Colour Sheet from Invision wireframes + added to Button + stories (#1632)

* cleanup button story

* new colour sheet

* fix type, remove class styles, use const style

* use new colours in StyledButton

* misc.

1. add borderRadius to const
2. use theme bg for darkMode switch

* [V2] Button sizes (#1633)

* wrap our base styled button in own theme provider and add size opt

* add proper types for button size

* Stories: add B I G and smol button stories

* misc.

1. make theme toggle button smol
2. add buttonFontSize to styles sheet

* enum > type for ButtonVariations

* incorrect darkMode button logo

* better prop names (#1637)

1. kind > $type
2. size > $size

* [V2 button] Rearrange component file structure and small prop fixes (#1640)

* saving

* $transient name props not allowed - use _propName

* change props again

* _type > variation
* _size > size

* variation > variant prop name
W3stside added a commit that referenced this pull request Jan 7, 2021
* creating theme pt 1

* theme

* DarkModeThemeToggler decorator

* Button common component

* Button story

* cleaned up Theme types

* simplify ButtonBase prop logic

* unmemo fn

* fix story bprops

* V2/button theming (#1626)

* added styled-theming lib

* styling sheets

1. colours
2. styles
3. commented out stuff in theme

* simplify ButtonBase code + add stories

* adjust darkMode decorator for new theme

1, add colour to colourSheet

* StyledButton base

* addressed PR comments:

1. added type to Story
2. Changed DarkThemeTOggler to ThemeToggler
3. simplified ButtonVariant enum

* fix button type, add disabled button, string enum

1. use string enum as button type
2. default to dark mode on start

* [V2] Colour Sheet from Invision wireframes + added to Button + stories (#1632)

* cleanup button story

* new colour sheet

* fix type, remove class styles, use const style

* use new colours in StyledButton

* misc.

1. add borderRadius to const
2. use theme bg for darkMode switch

* [V2] Button sizes (#1633)

* wrap our base styled button in own theme provider and add size opt

* add proper types for button size

* Stories: add B I G and smol button stories

* misc.

1. make theme toggle button smol
2. add buttonFontSize to styles sheet

* enum > type for ButtonVariations

* incorrect darkMode button logo

* better prop names (#1637)

1. kind > $type
2. size > $size

* [V2 button] Rearrange component file structure and small prop fixes (#1640)

* saving

* $transient name props not allowed - use _propName

* change props again

* _type > variation
* _size > size

* variation > variant prop name

* add polished, css interpolation pkg
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants