Browse Source

Merge pull request #1463 from meriadec/polish/select

Correct styling for Select borders, add isRight/isLeft
master
Thibaut 6 years ago
committed by GitHub
parent
commit
7392797c99
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/components/base/InputCurrency/index.js
  2. 6
      src/components/base/Select/createStyles.js
  3. 6
      src/components/base/Select/index.js

1
src/components/base/InputCurrency/index.js

@ -187,6 +187,7 @@ class InputCurrency extends PureComponent<Props, State> {
renderOption={this.renderOption} renderOption={this.renderOption}
renderValue={this.renderValue} renderValue={this.renderValue}
fakeFocusRight={isFocused} fakeFocusRight={isFocused}
isRight
/> />
</Currencies> </Currencies>
) )

6
src/components/base/Select/createStyles.js

@ -7,10 +7,14 @@ export default ({
width, width,
minWidth, minWidth,
small, small,
isRight,
isLeft,
}: { }: {
width: number, width: number,
minWidth: number, minWidth: number,
small: boolean, small: boolean,
isRight: boolean,
isLeft: boolean,
}) => ({ }) => ({
control: (styles: Object, { isFocused }: Object) => ({ control: (styles: Object, { isFocused }: Object) => ({
...styles, ...styles,
@ -19,6 +23,8 @@ export default ({
...ff('Open Sans|SemiBold'), ...ff('Open Sans|SemiBold'),
height: small ? 34 : 40, height: small ? 34 : 40,
minHeight: 'unset', minHeight: 'unset',
borderRadius: isRight ? '0 4px 4px 0' : isLeft ? '4px 0 0 4px' : 4,
borderColor: colors.fog,
backgroundColor: 'white', backgroundColor: 'white',
...(isFocused ...(isFocused

6
src/components/base/Select/index.js

@ -21,6 +21,8 @@ type Props = {
placeholder: string, placeholder: string,
isClearable: boolean, isClearable: boolean,
isDisabled: boolean, isDisabled: boolean,
isRight: boolean,
isLeft: boolean,
isLoading: boolean, isLoading: boolean,
isSearchable: boolean, isSearchable: boolean,
small: boolean, small: boolean,
@ -52,6 +54,8 @@ class Select extends PureComponent<Props> {
isSearchable, isSearchable,
isDisabled, isDisabled,
isLoading, isLoading,
isRight,
isLeft,
placeholder, placeholder,
options, options,
renderOption, renderOption,
@ -69,7 +73,7 @@ class Select extends PureComponent<Props> {
classNamePrefix="select" classNamePrefix="select"
options={options} options={options}
components={createRenderers({ renderOption, renderValue })} components={createRenderers({ renderOption, renderValue })}
styles={createStyles({ width, minWidth, small })} styles={createStyles({ width, minWidth, small, isRight, isLeft })}
placeholder={placeholder} placeholder={placeholder}
isDisabled={isDisabled} isDisabled={isDisabled}
isLoading={isLoading} isLoading={isLoading}

Loading…
Cancel
Save