Skip to content

Commit

Permalink
fix: update style of Checkbox, Dropdown, Select (#807)
Browse files Browse the repository at this point in the history
* fix: have 1.2rem margin for components using popover

* fix(CheckBox): update callback output

* fix: update css
  • Loading branch information
sun-tea authored and Thomas Roux committed Oct 12, 2019
1 parent 06516bd commit 3198734
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
5 changes: 3 additions & 2 deletions src/CheckBox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class CheckBox extends PureComponent {
* Handle Change
* fired when checkbox is triggered and state changes.
*/
handleChange = () => {
handleChange = event => {
event.persist();
const { onChange, isDisabled } = this.props;

if (isDisabled) {
Expand All @@ -65,7 +66,7 @@ class CheckBox extends PureComponent {
onChange && onChange(!isChecked);
} else {
this.setState({ isChecked: !isChecked }, () => {
onChange && onChange(!isChecked);
onChange && onChange(event);
});
}
};
Expand Down
10 changes: 7 additions & 3 deletions src/Dropdown/__stories__/Dropdown.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ import DropdownReadme from '../README.md';
const itemCss = css`
padding: 0.9rem 1.2rem;
&:first-child {
padding-top: 1.8rem;
padding-top: 1.2rem;
}
${({ searchable }) =>
searchable &&
css`
&:nth-child(2) {
padding-top: 1.8rem;
padding-top: 1.2rem;
}
`}
&:last-child {
padding-bottom: 1.8rem;
padding-bottom: 1.2rem;
}
:hover {
background: ${({ theme: { palette } }) => palette.veryLightGrey};
}
`;

Expand Down
4 changes: 0 additions & 4 deletions src/Dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ class Dropdown extends PureComponent {
</Menu>
}
contentRef={contentRef}
contentWrapperStyle={{
marginBottom: '0.4rem',
marginTop: '0.4rem',
}}
isOpen={displayMenu}
modifiers={modifiers}
onClickOutside={this.onClickOutside}
Expand Down
3 changes: 1 addition & 2 deletions src/Select/elements.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled, { css } from 'styled-components';
import { transparentize } from 'polished';

export const Header = styled.button`
display: flex;
Expand Down Expand Up @@ -98,7 +97,7 @@ export const MenuItem = styled.li`
`
: css`
:hover {
background: ${({ theme: { palette } }) => transparentize(0.5, palette.veryLightBlue)};
background: ${({ theme: { palette } }) => palette.veryLightGrey};
}
`};
`;
4 changes: 0 additions & 4 deletions src/Select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,6 @@ class Select extends PureComponent {
</Menu>
}
contentRef={contentRef}
contentWrapperStyle={{
marginBottom: '0.4rem',
marginTop: '0.4rem',
}}
isOpen={displayMenu}
modifiers={modifiers}
onClickOutside={this.onClickOutside}
Expand Down

0 comments on commit 3198734

Please sign in to comment.