Skip to content
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

Change multiselect camera icon #8016

Merged
merged 9 commits into from Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/src/components/MultiSelect.jsx
Expand Up @@ -4,8 +4,8 @@
import { ArrowDropdown } from '../icons/ArrowDropdown';
import Heading from './Heading';
import Button from './Button';
import CameraIcon from '../icons/Camera';
import SelectOnlyIcon from '../icons/SelectOnly';
import SpeakerIcon from '../icons/Speaker';

Check failure on line 8 in web/src/components/MultiSelect.jsx

View workflow job for this annotation

GitHub Actions / Web - Lint

'SpeakerIcon' is defined but never used. Allowed unused vars must match /^_/u
import useSWR from 'swr';

export default function MultiSelect({ className, title, options, selection, onToggle, onShowAll, onSelectSingle }) {
Expand All @@ -20,7 +20,7 @@
};

const menuHeight = Math.round(window.innerHeight * 0.55);
const { data: config } = useSWR('config');

Check failure on line 23 in web/src/components/MultiSelect.jsx

View workflow job for this annotation

GitHub Actions / Web - Lint

'config' is assigned a value but never used. Allowed unused vars must match /^_/u
return (
<div className={`${className} p-2`} ref={popupRef}>
<div className="flex justify-between min-w-[120px]" onClick={() => setState({ showMenu: true })}>
Expand Down Expand Up @@ -61,7 +61,7 @@
className="max-h-[35px] mx-2"
onClick={() => onSelectSingle(item)}
>
{ (title === "Labels" && config.audio.listen.includes(item)) ? ( <SpeakerIcon /> ) : ( <CameraIcon /> ) }
{ ( <SelectOnlyIcon /> ) }

</Button>
</div>
Expand Down
21 changes: 21 additions & 0 deletions web/src/icons/SelectOnly.jsx
@@ -0,0 +1,21 @@
import { h } from 'preact';
import { memo } from 'preact/compat';

export function SelectOnly({ className = 'h-5 w-5', stroke = 'currentColor', fill = 'none', onClick = () => {} }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
className={className}
fill={fill}
viewBox="0 0 24 24"
stroke={stroke}
onClick={onClick}
>
<path
d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-7 7H3v4c0 1.1.9 2 2 2h4v-2H5v-4zM5 5h4V3H5c-1.1 0-2 .9-2 2v4h2V5zm14-2h-4v2h4v4h2V5c0-1.1-.9-2-2-2zm0 16h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4z"
/>
</svg>
);
}

export default memo(SelectOnly);