From f8fc4c4f509c2131c2972935dd5ea04376f35aec Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Tue, 7 Nov 2023 11:39:34 -0500 Subject: [PATCH] style: Update text and styling on settings page (#2270) --- assets/css/_settings_page.scss | 10 ++-- assets/src/components/settingsPage.tsx | 32 +++++-------- .../__snapshots__/settingsPage.test.tsx.snap | 48 ++++--------------- 3 files changed, 29 insertions(+), 61 deletions(-) diff --git a/assets/css/_settings_page.scss b/assets/css/_settings_page.scss index a24d1a906..8fd0ff949 100644 --- a/assets/css/_settings_page.scss +++ b/assets/css/_settings_page.scss @@ -1,8 +1,10 @@ .c-settings-page__section-header { - @include font-label; - padding: 0.5rem 0rem 0.625rem 1.25rem; + padding: 0.5rem 0rem 0.625rem 0rem; margin-top: 0; margin-bottom: 0; + color: $color-gray-900; + font-size: 1.25rem; + font-weight: 600; } .c-settings-page__setting { @@ -29,12 +31,11 @@ } .c-settings-page__setting-label { - @include font-body; + font-size: 1rem; flex: 1 1 6rem; } .c-settings-page__options-container { - margin-left: 1.3125rem; display: flex; justify-content: flex-start; } @@ -49,6 +50,7 @@ .c-settings-page__option-label-unselected { @include toggle-unselected; + color: $color-gray-600; } .c-settings-page__vehicle-adherence-setting-row { diff --git a/assets/src/components/settingsPage.tsx b/assets/src/components/settingsPage.tsx index 6faa18469..c48e55663 100644 --- a/assets/src/components/settingsPage.tsx +++ b/assets/src/components/settingsPage.tsx @@ -1,11 +1,6 @@ import React, { ReactElement, useContext } from "react" import { StateDispatchContext } from "../contexts/stateDispatchContext" -import { - LadderIcon, - MapIcon, - TriangleUpIcon, - TriangleUpLargeIcon, -} from "../helpers/icon" +import { TriangleUpIcon } from "../helpers/icon" import { setLadderVehicleLabelSetting, setShuttleVehicleLabelSetting, @@ -31,12 +26,14 @@ const SettingsPage = (): ReactElement => {

Settings

-

Vehicle Settings

} - label="Vehicle labels on map" + label={ + <> + Vehicle labels on regular buses + + } settingName="shuttle-vehicle-label" value={userSettings.shuttleVehicleLabel} onChange={(value) => { @@ -58,8 +55,11 @@ const SettingsPage = (): ReactElement => { ]} /> } - label="Vehicle labels on route ladder" + label={ + <> + Vehicle labels on shuttle buses + + } settingName="ladder-vehicle-label" value={userSettings.ladderVehicleLabel} onChange={(value) => { @@ -81,8 +81,7 @@ const SettingsPage = (): ReactElement => { ]} /> } - label="Adherence colors" + label={<>Adherence colors} settingName="vehicle-adherence-colors" value={userSettings.vehicleAdherenceColors} onChange={(value) => { @@ -143,15 +142,13 @@ const SettingsPage = (): ReactElement => { } const ToggleSetting = ({ - icon, label, settingName, value, onChange, options, }: { - icon: ReactElement - label: string + label: ReactElement settingName: string value: string | number onChange: (value: string) => void @@ -163,9 +160,6 @@ const ToggleSetting = ({ }) => (
-
- {React.cloneElement(icon, { className: "c-settings-page__icon-path" })} -
{label}
diff --git a/assets/tests/components/__snapshots__/settingsPage.test.tsx.snap b/assets/tests/components/__snapshots__/settingsPage.test.tsx.snap index d44113376..2223d2b67 100644 --- a/assets/tests/components/__snapshots__/settingsPage.test.tsx.snap +++ b/assets/tests/components/__snapshots__/settingsPage.test.tsx.snap @@ -29,22 +29,14 @@ exports[`SettingsPage renders 1`] = `
-
- ", - } - } - /> -
- Vehicle labels on map + Vehicle labels on + + regular + + buses
-
- ", - } - } - /> -
- Vehicle labels on route ladder + Vehicle labels on + + shuttle + + buses
-
- ", - } - } - /> -