Skip to content

Commit

Permalink
app: Select fields are visually improved
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Nov 19, 2020
1 parent ad85252 commit 5f17065
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/renderer/components/form/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import Control, {components} from 'react-select';
import {X} from 'react-feather';
import {ChevronDown, X} from 'react-feather';

type ControlProps = React.ComponentProps<typeof Control>;

Expand All @@ -23,16 +23,27 @@ const selectStyles: ControlProps['styles'] = {
...base,
borderRadius: '3px',
zIndex: 10,
boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)',
}),
option: (base, state) => ({
...base,
backgroundColor: state.isFocused ? '#4b98f8' : 'none',
color: state.isFocused ? '#fff' : 'none',
padding: '0.25rem 0.5rem',
margin: '0 0.25rem',
borderRadius: '3px',
width: 'auto',
}),
};

const selectComponents: ControlProps['components'] = {
IndicatorsContainer: () => null,
IndicatorSeparator: () => null,
ClearIndicator: () => null,
DropdownIndicator: p => (
<components.DropdownIndicator {...p}>
<ChevronDown size="1rem" />
</components.DropdownIndicator>
),
MultiValueRemove: p => (
<components.MultiValueRemove {...p}>
<X size="0.75rem" />
Expand Down

0 comments on commit 5f17065

Please sign in to comment.