mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-20 17:11:20 -08:00
Add disabled state to Ratio, Fix typos and bad typing (#878)
This commit is contained in:
1 parent
3a50153980
commit
e79c7ebf0e
3 files changed
+30
-28
No files matched your search
@@ -7,7 +7,7 @@ export function Radio({
|
||||
name,
|
||||
label,
|
||||
value,
|
||||
desciption,
|
||||
description,
|
||||
// input props
|
||||
disabled,
|
||||
...props
|
||||
@@ -15,8 +15,8 @@ export function Radio({
|
||||
control: Control<any>;
|
||||
name: string;
|
||||
label: string;
|
||||
value: string | number;
|
||||
desciption?: string | null;
|
||||
value: string;
|
||||
description?: string | null;
|
||||
} & React.HTMLProps<HTMLInputElement>) {
|
||||
return (
|
||||
<Controller
|
||||
@@ -24,14 +24,12 @@ export function Radio({
|
||||
name={name}
|
||||
render={({ field: { onChange, ref, name, value: checked } }) => (
|
||||
<label
|
||||
className={classNames(
|
||||
'w-full bg-background-60 p-3 rounded-md flex gap-3 border-2',
|
||||
{
|
||||
'border-accent-background-30': value == checked,
|
||||
'border-transparent': value != checked,
|
||||
'cursor-pointer': !disabled,
|
||||
}
|
||||
)}
|
||||
className={classNames('w-full p-3 rounded-md flex gap-3 border-2', {
|
||||
'border-accent-background-30': value == checked,
|
||||
'border-transparent': value != checked,
|
||||
'bg-background-60 cursor-pointer': !disabled,
|
||||
'bg-background-80 cursor-not-allowed': disabled,
|
||||
})}
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
@@ -43,14 +41,15 @@ export function Radio({
|
||||
ref={ref}
|
||||
onChange={onChange}
|
||||
value={value}
|
||||
disabled={disabled}
|
||||
checked={value == checked}
|
||||
{...props}
|
||||
/>
|
||||
<div className="flex flex-col gap-2">
|
||||
<Typography bold>{label}</Typography>
|
||||
{desciption && (
|
||||
{description && (
|
||||
<Typography variant="standard" color="secondary">
|
||||
{desciption}
|
||||
{description}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@ export function ThemeSelector({
|
||||
control: Control<any>;
|
||||
name: string;
|
||||
colors: string | undefined;
|
||||
value: string | number;
|
||||
value: string;
|
||||
} & React.HTMLProps<HTMLInputElement>) {
|
||||
return (
|
||||
<Controller
|
||||
|
||||
@@ -479,10 +479,10 @@ export function GeneralSettings() {
|
||||
label={l10n.getString(
|
||||
'settings-general-tracker_mechanics-filtering-type-none'
|
||||
)}
|
||||
desciption={l10n.getString(
|
||||
description={l10n.getString(
|
||||
'settings-general-tracker_mechanics-filtering-type-none-description'
|
||||
)}
|
||||
value={FilteringType.NONE}
|
||||
value={FilteringType.NONE.toString()}
|
||||
></Radio>
|
||||
<Radio
|
||||
control={control}
|
||||
@@ -490,10 +490,10 @@ export function GeneralSettings() {
|
||||
label={l10n.getString(
|
||||
'settings-general-tracker_mechanics-filtering-type-smoothing'
|
||||
)}
|
||||
desciption={l10n.getString(
|
||||
description={l10n.getString(
|
||||
'settings-general-tracker_mechanics-filtering-type-smoothing-description'
|
||||
)}
|
||||
value={FilteringType.SMOOTHING}
|
||||
value={FilteringType.SMOOTHING.toString()}
|
||||
></Radio>
|
||||
<Radio
|
||||
control={control}
|
||||
@@ -501,10 +501,10 @@ export function GeneralSettings() {
|
||||
label={l10n.getString(
|
||||
'settings-general-tracker_mechanics-filtering-type-prediction'
|
||||
)}
|
||||
desciption={l10n.getString(
|
||||
description={l10n.getString(
|
||||
'settings-general-tracker_mechanics-filtering-type-prediction-description'
|
||||
)}
|
||||
value={FilteringType.PREDICTION}
|
||||
value={FilteringType.PREDICTION.toString()}
|
||||
></Radio>
|
||||
</div>
|
||||
<div className="flex gap-5 pt-5 md:flex-row flex-col">
|
||||
@@ -729,10 +729,10 @@ export function GeneralSettings() {
|
||||
label={l10n.getString(
|
||||
'settings-general-fk_settings-arm_fk-back'
|
||||
)}
|
||||
desciption={l10n.getString(
|
||||
description={l10n.getString(
|
||||
'settings-general-fk_settings-arm_fk-back-description'
|
||||
)}
|
||||
value={0}
|
||||
value={'0'}
|
||||
></Radio>
|
||||
<Radio
|
||||
control={control}
|
||||
@@ -740,10 +740,10 @@ export function GeneralSettings() {
|
||||
label={l10n.getString(
|
||||
'settings-general-fk_settings-arm_fk-forward'
|
||||
)}
|
||||
desciption={l10n.getString(
|
||||
description={l10n.getString(
|
||||
'settings-general-fk_settings-arm_fk-forward-description'
|
||||
)}
|
||||
value={1}
|
||||
value={'1'}
|
||||
></Radio>
|
||||
<Radio
|
||||
control={control}
|
||||
@@ -751,10 +751,10 @@ export function GeneralSettings() {
|
||||
label={l10n.getString(
|
||||
'settings-general-fk_settings-arm_fk-tpose_up'
|
||||
)}
|
||||
desciption={l10n.getString(
|
||||
description={l10n.getString(
|
||||
'settings-general-fk_settings-arm_fk-tpose_up-description'
|
||||
)}
|
||||
value={2}
|
||||
value={'2'}
|
||||
></Radio>
|
||||
<Radio
|
||||
control={control}
|
||||
@@ -762,10 +762,10 @@ export function GeneralSettings() {
|
||||
label={l10n.getString(
|
||||
'settings-general-fk_settings-arm_fk-tpose_down'
|
||||
)}
|
||||
desciption={l10n.getString(
|
||||
description={l10n.getString(
|
||||
'settings-general-fk_settings-arm_fk-tpose_down-description'
|
||||
)}
|
||||
value={3}
|
||||
value={'3'}
|
||||
></Radio>
|
||||
</div>
|
||||
{config?.debug && (
|
||||
@@ -1112,6 +1112,9 @@ export function GeneralSettings() {
|
||||
<NumberSelector
|
||||
control={control}
|
||||
name="tapDetection.numberTrackersOverThreshold"
|
||||
label={l10n.getString(
|
||||
'settings-general-gesture_control-numberTrackersOverThreshold'
|
||||
)}
|
||||
valueLabelFormat={(value) =>
|
||||
l10n.getString(
|
||||
'settings-general-gesture_control-trackers',
|
||||
|
||||
Reference in new issue
Block a user