fixing the filter dropdown to look like a dropdown
This commit is contained in:
parent
0d128ffac7
commit
f37f9b3dd7
@ -56,7 +56,7 @@ export const ToggleSwitch = ({ value, onChange, inputRef, children }: InputEleme
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const VerticalToggleSwitch = ({ value, onChange, inputRef, children }: InputElementProperties<boolean>) => {
|
export const VerticalToggleSwitch = ({ value, onChange, inputRef, children }: InputElementProperties<boolean>) => {
|
||||||
return <label>
|
return <label className="label-fix">
|
||||||
{children && <b>{children}</b>}
|
{children && <b>{children}</b>}
|
||||||
<span className="check-box">
|
<span className="check-box">
|
||||||
<input ref={inputRef} defaultChecked={value} onChange={onChange} type='checkbox' />
|
<input ref={inputRef} defaultChecked={value} onChange={onChange} type='checkbox' />
|
||||||
|
4
src/css/chota.min.css
vendored
4
src/css/chota.min.css
vendored
@ -775,6 +775,10 @@ input:disabled:hover {
|
|||||||
color: #bdbfc4
|
color: #bdbfc4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.placeholder{
|
||||||
|
color: #bdbfc4
|
||||||
|
}
|
||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
-webkit-box-align: stretch;
|
-webkit-box-align: stretch;
|
||||||
-ms-flex-align: stretch;
|
-ms-flex-align: stretch;
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
.dropdown .header {
|
.dropdown .header {
|
||||||
min-height: 40px;
|
min-height: 40px;
|
||||||
background-color: white;
|
background-color: field;
|
||||||
|
border: 1px solid var(--color-lightGrey);
|
||||||
|
border-radius: 4px;
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: 1em;
|
||||||
|
padding: 0.8rem 1rem;
|
||||||
|
transition: all .2s ease;
|
||||||
|
padding-right: 2.5rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown .item-list {
|
.dropdown .item-list {
|
||||||
@ -17,3 +24,20 @@
|
|||||||
padding: 0.5rem 1rem !important;
|
padding: 0.5rem 1rem !important;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
.dropdown summary .placeholder{
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
.dropdown summary{
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.dropdown summary::after{
|
||||||
|
content: " ";
|
||||||
|
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='40' fill='%23555'><polygon points='0,0 60,0 30,40'/></svg>");
|
||||||
|
background-size: 1ex;
|
||||||
|
position: absolute;
|
||||||
|
height: 1ex;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
width: 1ex;
|
||||||
|
right: 1rem;
|
||||||
|
}
|
@ -192,15 +192,18 @@ const FlagList = () => {
|
|||||||
/>
|
/>
|
||||||
{availableFilters && <Dropdown>
|
{availableFilters && <Dropdown>
|
||||||
<Dropdown.Header>
|
<Dropdown.Header>
|
||||||
{selectedFilters.map(f => <Dropdown.Item
|
{selectedFilters.length === 0
|
||||||
key={f}
|
? <p className="placeholder">Click to filter</p>
|
||||||
onClick={() => {
|
: selectedFilters.map(f => <Dropdown.Item
|
||||||
setSelectedFilters(selectedFilters.filter(ff => f !== ff));
|
key={f}
|
||||||
setAvailableFilters([...availableFilters, f]);
|
onClick={() => {
|
||||||
}}
|
setSelectedFilters(selectedFilters.filter(ff => f !== ff));
|
||||||
>
|
setAvailableFilters([...availableFilters, f]);
|
||||||
{f}
|
}}
|
||||||
</Dropdown.Item>)}
|
>
|
||||||
|
{f}
|
||||||
|
</Dropdown.Item>)
|
||||||
|
}
|
||||||
</Dropdown.Header>
|
</Dropdown.Header>
|
||||||
|
|
||||||
<Dropdown.ItemList>
|
<Dropdown.ItemList>
|
||||||
|
Loading…
Reference in New Issue
Block a user