[Update/bugfix] UI: Add disable/enable UI function when osc query is disabled.

Fix the error that the mic mute sync couldn't enable/disable.
This commit is contained in:
Sakamoto Shiina
2025-05-30 15:32:03 +09:00
parent ae38ed165d
commit 88cb4f72b5
16 changed files with 116 additions and 13 deletions

View File

@@ -3,15 +3,16 @@ import styles from "./Checkbox.module.scss";
export const Checkbox = ({
checkboxId,
variable,
is_available = true,
toggleFunction,
size = "2.8rem",
color = "var(--primary_600_color)",
borderWidth = "0.2rem",
padding = "2rem",
}) => {
const wrapper_class_names = clsx(styles.checkbox_wrapper, {
[styles.is_disabled]: variable.state === "pending",
[styles.is_disabled]: !is_available,
[styles.is_pending]: variable.state === "pending",
});
return (
@@ -21,7 +22,6 @@ export const Checkbox = ({
htmlFor={checkboxId}
style={{
"--checkbox-size": size,
"--checkbox-color": color,
"--checkbox-border-width": borderWidth,
"--checkbox-padding": padding,
}}

View File

@@ -18,12 +18,19 @@
border: var(--checkbox-color, var(--primary_600_color)) solid var(--checkbox-border-width, 0.2rem);
}
}
&.is_disabled {
&.is_pending {
pointer-events: none;
& .cbx {
border-color: var(--primary_800_color);
}
}
&.is_disabled {
pointer-events: none;
& .cbx {
filter: grayscale(100%);
border-color: var(--dark_800_color);
}
}
}
.checkbox_wrapper .cbx {