-
Notifications
You must be signed in to change notification settings - Fork 7
Feature/mobile camera admin #312
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
base: main
Are you sure you want to change the base?
Changes from all commits
e8bb584
61c99c3
8b7290c
69913e0
5a4a277
bac4961
b6e5610
e74fbfd
f62b993
4133562
5d51c9c
457cc16
93a20e2
c497bc5
bd9fe89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,10 +7,29 @@ import InfoIcon from './InfoIcon'; | |
| // TODO: refactor using radix select primative. | ||
| // I don't love the incongruous approach to styling react-select forces | ||
|
|
||
| const valueContainerStyles = (isSearchable) => { | ||
| return (provided) => ({ | ||
| ...provided, | ||
| padding: 'var(--space-2)', | ||
| '@media screen only and (min-width: 768px)': { | ||
| padding: '0px 16px', | ||
| }, | ||
| fontSize: 'var(--fontSizes-3)', | ||
| fontFamily: 'var(--fonts-sourceSansPro)', | ||
| color: 'var(--colors-gray7)', | ||
| ...(!isSearchable && { | ||
| '> div': { margin: '2px' }, | ||
| '> input': { display: 'none' }, | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For some reason, when
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes me a bit nervous - have made sure this doesn't have any unintended consequences on desktop on other fields where Updating this: this does make all selects shorter across the app on desktop. This is an interesting catch, but I'm not sure how comfortable I am making this change in general without a thorough evaluation of the implications, and if we do roll with it it should be it's own PR, IMO. How necessary is this to make now? Is it important for the mobile UI? |
||
| }), | ||
| }); | ||
| }; | ||
|
|
||
| const customStyles = { | ||
| control: (provided, state) => ({ | ||
| ...provided, | ||
| height: '55px', | ||
| '@bp2': { | ||
| height: '55px', | ||
| }, | ||
| boxSizing: 'border-box', | ||
| border: '1px solid', | ||
| borderColor: 'var(--colors-border) !important', | ||
|
|
@@ -26,21 +45,6 @@ const customStyles = { | |
| }, | ||
| }), | ||
| }), | ||
| input: (provided) => ({ | ||
| ...provided, | ||
| 'input:focus': { | ||
| boxShadow: 'none !important', | ||
| transition: 'none', | ||
| }, | ||
| }), | ||
| valueContainer: (provided) => ({ | ||
| ...provided, | ||
| height: '100%', | ||
| padding: '0px 16px', | ||
| fontSize: 'var(--fontSizes-3)', | ||
| fontFamily: 'var(--fonts-sourceSansPro)', | ||
| color: 'var(--colors-gray7)', | ||
| }), | ||
| menu: (provided) => ({ | ||
| ...provided, | ||
| color: 'var(--colors-hiContrast)', | ||
|
|
@@ -57,6 +61,13 @@ const customStyles = { | |
| backgroundColor: 'var(--colors-gray3)', | ||
| }), | ||
| }), | ||
| input: (provided, state) => ({ | ||
| ...provided, | ||
| boxShadow: 'none', | ||
| ...(state.isFocused && { | ||
| boxShadow: 'none', | ||
| }), | ||
| }), | ||
| }; | ||
|
|
||
| const SelectField = ({ | ||
|
|
@@ -81,6 +92,11 @@ const SelectField = ({ | |
| onBlur(name, true); | ||
| }; | ||
|
|
||
| const styles = { | ||
| ...customStyles, | ||
| ...{ valueContainer: valueContainerStyles(isSearchable ?? false) }, | ||
| }; | ||
|
|
||
| return ( | ||
| <div> | ||
| {label && ( | ||
|
|
@@ -90,7 +106,7 @@ const SelectField = ({ | |
| </label> | ||
| )} | ||
| <Select | ||
| styles={customStyles} | ||
| styles={styles} | ||
| inputId={name} | ||
| options={options} | ||
| multi={true} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.