Show settings cog for camera toggles on mobile (#8098)

* Show settings cog on mobile

* Cleanup ui and remove label

* Fix tests
This commit is contained in:
Nicolas Mowen
2023-10-08 13:49:41 -06:00
committed by GitHub
parent cc6e049966
commit d7ddcea951
4 changed files with 96 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
import { h } from 'preact';
import { useCallback, useState } from 'preact/hooks';
export default function Switch({ checked, id, onChange, label, labelPosition = 'before' }) {
export default function Switch({ className, checked, id, onChange, label, labelPosition = 'before' }) {
const [isFocused, setFocused] = useState(false);
const handleChange = useCallback(() => {
@@ -21,7 +21,7 @@ export default function Switch({ checked, id, onChange, label, labelPosition = '
return (
<label
htmlFor={id}
className={`flex items-center space-x-4 w-full ${onChange ? 'cursor-pointer' : 'cursor-not-allowed'}`}
className={`${className ? className : ''} flex items-center space-x-4 w-full ${onChange ? 'cursor-pointer' : 'cursor-not-allowed'}`}
>
{label && labelPosition === 'before' ? (
<div data-testid={`${id}-label`} className="inline-flex flex-grow">