Skip to content

Commit

Permalink
fix: settings page layout (4-way joystick toggle, profile number) (#518)
Browse files Browse the repository at this point in the history
fix: FIX: settings page layout (4-way joystick toggle, profile number)

Changed number input to dropdown and added containers for toggle
  • Loading branch information
HoboDev authored Sep 15, 2023
1 parent e471ff6 commit 7a5b5b3
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions www/src/Pages/SettingsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,35 +397,41 @@ export default function SettingsPage() {
</Form.Control.Feedback>
</div>
</Form.Group>
<Form.Check
label={t('SettingsPage:4-way-joystick-mode-label')}
type="switch"
id="fourWayMode"
isInvalid={false}
checked={Boolean(values.fourWayMode)}
onChange={(e) => {
setFieldValue('fourWayMode', e.target.checked ? 1 : 0);
}}
/>
<div className="row mb-3">
<div className="col-sm-3">
<Form.Check
label={t('SettingsPage:4-way-joystick-mode-label')}
type="switch"
id="fourWayMode"
isInvalid={false}
checked={Boolean(values.fourWayMode)}
onChange={(e) => {
setFieldValue('fourWayMode', e.target.checked ? 1 : 0);
}}
/>
</div>
</div>
<Form.Group className="row mb-3">
<Form.Label>
{t('SettingsPage:profile-number-label')}
</Form.Label>
<div className="col-sm-3">
<Form.Control
type="number"
className="row mb-3"
<Form.Select
name="profileNumber"
className="form-select-sm"
value={values.profileNumber}
min={1}
max={4}
isInvalid={false}
onChange={(e) => {
setFieldValue(
'profileNumber',
parseInt(e.target.value),
);
}}
></Form.Control>
onChange={handleChange}
isInvalid={errors.profileNumber}
>
{[1, 2, 3, 4].map((i) => (
<option
key={`button-profileNumber-option-${i}`}
value={i}
>
{i}
</option>
))}
</Form.Select>
</div>
</Form.Group>
</Section>
Expand Down

0 comments on commit 7a5b5b3

Please sign in to comment.