mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
make namespace filter multi select and change onChange (#987)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
bc228c9e36
commit
34e141e517
@ -58,7 +58,7 @@ export class NamespaceSelect extends React.Component<Props> {
|
||||
const { value, label } = option;
|
||||
return label || (
|
||||
<>
|
||||
{showIcons && <Icon small material="layers"/>}
|
||||
{showIcons && <Icon small material="layers" />}
|
||||
{value}
|
||||
</>
|
||||
);
|
||||
@ -91,14 +91,15 @@ export class NamespaceSelectFilter extends React.Component {
|
||||
closeMenuOnSelect={false}
|
||||
isOptionSelected={() => false}
|
||||
controlShouldRenderValue={false}
|
||||
onChange={({ value: namespace }: SelectOption) => toggleContext(namespace)}
|
||||
isMulti
|
||||
onChange={([{ value }]: SelectOption[]) => toggleContext(value)}
|
||||
formatOptionLabel={({ value: namespace }: SelectOption) => {
|
||||
const isSelected = hasContext(namespace);
|
||||
return (
|
||||
<div className="flex gaps align-center">
|
||||
<FilterIcon type={FilterType.NAMESPACE}/>
|
||||
<FilterIcon type={FilterType.NAMESPACE} />
|
||||
<span>{namespace}</span>
|
||||
{isSelected && <Icon small material="check" className="box right"/>}
|
||||
{isSelected && <Icon small material="check" className="box right" />}
|
||||
</div>
|
||||
)
|
||||
}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user