Skip to content

Commit

Permalink
fix(ts/components/settingsPage): move shuttle setting to after vehicl…
Browse files Browse the repository at this point in the history
…e setting to match figma
  • Loading branch information
firestack committed Nov 30, 2023
1 parent 9636559 commit 588b332
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
28 changes: 14 additions & 14 deletions assets/src/components/settingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,52 +31,52 @@ const SettingsPage = (): ReactElement<HTMLDivElement> => {
<ToggleSetting
label={
<>
Vehicle labels on <strong>shuttle</strong> buses
Vehicle labels on <strong>regular</strong> buses
</>
}
settingName="shuttle-vehicle-label"
value={userSettings.shuttleVehicleLabel}
settingName="ladder-vehicle-label"
value={userSettings.ladderVehicleLabel}
onChange={(value) => {
const newSetting: VehicleLabelSetting = parseInt(value, 10)
dispatch(setShuttleVehicleLabelSetting(newSetting))
putShuttleVehicleLabel(newSetting)
dispatch(setLadderVehicleLabelSetting(newSetting))
putLadderVehicleLabel(newSetting)
}}
options={[
{
label: "Run number",
value: VehicleLabelSetting.RunNumber,
optionId: "shuttle-vehicle-label-run-number",
optionId: "ladder-vehicle-label-run-number",
},
{
label: "Vehicle number",
value: VehicleLabelSetting.VehicleNumber,
optionId: "shuttle-vehicle-label-vehicle-number",
optionId: "ladder-vehicle-label-vehicle-number",
},
]}
/>
<ToggleSetting
label={
<>
Vehicle labels on <strong>regular</strong> buses
Vehicle labels on <strong>shuttle</strong> buses
</>
}
settingName="ladder-vehicle-label"
value={userSettings.ladderVehicleLabel}
settingName="shuttle-vehicle-label"
value={userSettings.shuttleVehicleLabel}
onChange={(value) => {
const newSetting: VehicleLabelSetting = parseInt(value, 10)
dispatch(setLadderVehicleLabelSetting(newSetting))
putLadderVehicleLabel(newSetting)
dispatch(setShuttleVehicleLabelSetting(newSetting))
putShuttleVehicleLabel(newSetting)
}}
options={[
{
label: "Run number",
value: VehicleLabelSetting.RunNumber,
optionId: "ladder-vehicle-label-run-number",
optionId: "shuttle-vehicle-label-run-number",
},
{
label: "Vehicle number",
value: VehicleLabelSetting.VehicleNumber,
optionId: "ladder-vehicle-label-vehicle-number",
optionId: "shuttle-vehicle-label-vehicle-number",
},
]}
/>
Expand Down
36 changes: 18 additions & 18 deletions assets/tests/components/__snapshots__/settingsPage.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports[`SettingsPage renders 1`] = `
>
Vehicle labels on
<strong>
shuttle
regular
</strong>
buses
</div>
Expand All @@ -43,27 +43,27 @@ exports[`SettingsPage renders 1`] = `
className="c-settings-page__options-container"
>
<label
className="c-settings-page__option-label-unselected"
className="c-settings-page__option-label-selected"
>
<input
checked={false}
checked={true}
className="c-settings-page__input"
data-testid="shuttle-vehicle-label-run-number"
name="shuttle-vehicle-label"
data-testid="ladder-vehicle-label-run-number"
name="ladder-vehicle-label"
onChange={[Function]}
type="radio"
value={1}
/>
Run number
</label>
<label
className="c-settings-page__option-label-selected"
className="c-settings-page__option-label-unselected"
>
<input
checked={true}
checked={false}
className="c-settings-page__input"
data-testid="shuttle-vehicle-label-vehicle-number"
name="shuttle-vehicle-label"
data-testid="ladder-vehicle-label-vehicle-number"
name="ladder-vehicle-label"
onChange={[Function]}
type="radio"
value={2}
Expand All @@ -83,7 +83,7 @@ exports[`SettingsPage renders 1`] = `
>
Vehicle labels on
<strong>
regular
shuttle
</strong>
buses
</div>
Expand All @@ -92,27 +92,27 @@ exports[`SettingsPage renders 1`] = `
className="c-settings-page__options-container"
>
<label
className="c-settings-page__option-label-selected"
className="c-settings-page__option-label-unselected"
>
<input
checked={true}
checked={false}
className="c-settings-page__input"
data-testid="ladder-vehicle-label-run-number"
name="ladder-vehicle-label"
data-testid="shuttle-vehicle-label-run-number"
name="shuttle-vehicle-label"
onChange={[Function]}
type="radio"
value={1}
/>
Run number
</label>
<label
className="c-settings-page__option-label-unselected"
className="c-settings-page__option-label-selected"
>
<input
checked={false}
checked={true}
className="c-settings-page__input"
data-testid="ladder-vehicle-label-vehicle-number"
name="ladder-vehicle-label"
data-testid="shuttle-vehicle-label-vehicle-number"
name="shuttle-vehicle-label"
onChange={[Function]}
type="radio"
value={2}
Expand Down

0 comments on commit 588b332

Please sign in to comment.