Support filtering to own/all servers if user is an admin

This commit is contained in:
Dane Everitt 2020-04-25 17:52:32 -07:00
parent 67c6be9f6f
commit f45c03a449
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 86 additions and 19 deletions

View file

@ -36,7 +36,7 @@ const ToggleContainer = styled.div`
export interface SwitchProps {
name: string;
label: string;
label?: string;
description?: string;
defaultChecked?: boolean;
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
@ -48,7 +48,7 @@ const Switch = ({ name, label, description, defaultChecked, onChange, children }
return (
<div className={'flex items-center'}>
<ToggleContainer className={'mr-4 flex-none'}>
<ToggleContainer className={'flex-none'}>
{children
|| <input
id={uuid}
@ -60,17 +60,21 @@ const Switch = ({ name, label, description, defaultChecked, onChange, children }
}
<label htmlFor={uuid}/>
</ToggleContainer>
<div className={'w-full'}>
{(label || description) &&
<div className={'ml-4 w-full'}>
{label &&
<label
className={classNames('input-dark-label cursor-pointer', { 'mb-0': !!description })}
htmlFor={uuid}
>{label}</label>
}
{description &&
<p className={'input-help'}>
{description}
</p>
}
</div>
}
</div>
);
};