Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions apps/dapp/src/components/InputSelect/InputSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface SelectTempleDaoProps {
// use to limit the number of elements shown in the menu at anytime
maxMenuItems?: number;
isSearchable?: boolean;
isDisabled?: boolean;
width?: CSS.Property.Width;
fontSize?: CSS.Property.FontSize;
fontWeight?: CSS.Property.FontWeight;
Expand Down Expand Up @@ -52,18 +53,22 @@ export const InputSelect = (props: SelectTempleDaoProps) => {
borderRadius: 0,
})}
styles={{
control: (base) => ({
control: (base, state) => ({
...base,
border: `0.0625rem /* 1/16 */ solid ${theme.palette.brand}`,
borderRadius: `calc(${selectHeight} / 4)`,
boxShadow: 'none',
fontSize: '1rem',
textAlign: 'left',
padding: '0 0.5rem',
cursor: 'pointer',
cursor: state.isDisabled ? 'not-allowed' : 'pointer',
height: selectHeight,
zIndex: props.zIndex ? Number(props.zIndex) + 1 : 2, // place it above the menu 👇
width: props.width ?? '100%',
backgroundColor: state.isDisabled
? theme.palette.brand25 || `${theme.palette.brand}40`
: theme.palette.dark,
opacity: state.isDisabled ? 0.7 : 1,
}),
menu: (base, state) => ({
...base,
Expand Down Expand Up @@ -111,12 +116,15 @@ export const InputSelect = (props: SelectTempleDaoProps) => {
padding: 0,
}),
dropdownIndicator: (base, state) => ({
color: state.isFocused
color: state.isDisabled
? theme.palette.brandDark
: state.isFocused
? theme.palette.brandLight
: theme.palette.brand,
display: 'flex',
transform: state.isFocused ? 'rotateX(180deg)' : 'none',
transition: 'transform 250ms linear',
opacity: state.isDisabled ? 0.5 : 1,
}),
}}
/>
Expand Down
Loading
Loading