Merge pull request #377 from robintown/spatial-audio-copy

Tweak spatial audio copy
This commit is contained in:
Robin 2022-06-07 09:25:56 -04:00 committed by GitHub
commit 1a7211198b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 3 deletions

View file

@ -39,7 +39,18 @@ export function Field({ children, className, ...rest }) {
export const InputField = forwardRef( export const InputField = forwardRef(
( (
{ id, label, className, type, checked, prefix, suffix, disabled, ...rest }, {
id,
label,
className,
type,
checked,
prefix,
suffix,
description,
disabled,
...rest
},
ref ref
) => { ) => {
return ( return (
@ -82,6 +93,7 @@ export const InputField = forwardRef(
{label} {label}
</label> </label>
{suffix && <span>{suffix}</span>} {suffix && <span>{suffix}</span>}
{description && <p className={styles.description}>{description}</p>}
</Field> </Field>
); );
} }

View file

@ -118,13 +118,15 @@
.checkboxField { .checkboxField {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
flex-wrap: wrap;
} }
.checkboxField label { .checkboxField label {
display: flex; display: flex;
align-items: center; align-items: center;
flex-grow: 1; flex-grow: 1;
font-size: 13px; font-size: 15px;
line-height: 24px;
} }
.checkboxField input { .checkboxField input {
@ -176,3 +178,9 @@
color: var(--alert); color: var(--alert);
font-weight: 600; font-weight: 600;
} }
.description {
color: var(--secondary-content);
margin-left: 26px;
width: 100%; /* Ensure that it breaks onto the next row */
}

View file

@ -87,9 +87,10 @@ export const SettingsModal = (props) => {
<FieldRow> <FieldRow>
<InputField <InputField
id="spatialAudio" id="spatialAudio"
label="Spatial audio (experimental)" label="Spatial audio"
type="checkbox" type="checkbox"
checked={spatialAudio} checked={spatialAudio}
description="This will make a speaker's audio seem as if it is coming from where their tile is positioned on screen. (Experimental feature: this may impact the stability of audio.)"
onChange={(e) => setSpatialAudio(e.target.checked)} onChange={(e) => setSpatialAudio(e.target.checked)}
/> />
</FieldRow> </FieldRow>