-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new settings option for shuttle vehicle labels #192
Conversation
c2cf6be
to
ebf07ad
Compare
Codecov Report
@@ Coverage Diff @@
## master #192 +/- ##
==========================================
+ Coverage 95.75% 95.76% +<.01%
==========================================
Files 116 116
Lines 2452 2481 +29
Branches 255 266 +11
==========================================
+ Hits 2348 2376 +28
- Misses 102 103 +1
Partials 2 2
Continue to review full report at Codecov.
|
ebf07ad
to
8c9a680
Compare
assets/src/settings.ts
Outdated
// special handling code in usePersistedStateReducer. -- MSS 2019-09-11 | ||
vehicleLabel: VehicleLabelSetting | undefined | ||
ladderVehicleLabel: VehicleLabelSetting | ||
mapVehicleLabel: VehicleLabelSetting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think shuttleVehicleLabel
might be a better name? We don't have this field because we draw some vehicles on a map. We have this field because shuttle have non-unique runs.
assets/src/helpers/icon.tsx
Outdated
@@ -20,6 +22,34 @@ export const collapseIcon = (): JSX.Element => renderSvg("", collapseIconSvg) | |||
|
|||
export const expandIcon = (): JSX.Element => renderSvg("", expandIconSvg) | |||
|
|||
export const ladderIcon = (className: string = ""): JSX.Element => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to set the .m-tab-bar__icon
class on a parent element or to apply styles to a parent's CSS instead of needing to pass the class in, so that the icon can be a constant?
In the settings page, I think if the fill was put on .c-page__section-row-icon
, then you wouldn't need to pass the .c-page__section-row-icon-path
class in.
assets/src/helpers/icon.tsx
Outdated
className={className} | ||
d="m32.73 39.86v-12.08a4.37 4.37 0 0 1 0-7.56v-12.08a4.36 4.36 0 1 1 4.36 0v12.08a4.37 4.37 0 0 1 0 7.56v12.08a4.36 4.36 0 1 1 -4.36 0zm-17.46 0a4.36 4.36 0 1 1 -4.36 0v-12.08a4.37 4.37 0 0 1 0-7.56v-12.08a4.36 4.36 0 1 1 4.36 0v12.08a4.37 4.37 0 0 1 0 7.56z" | ||
/> | ||
</svg> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the svgs be moved to separate .svg
files to match the other icons loaded by this file?
@@ -100,7 +101,7 @@ const Header = ({ | |||
<VehicleIcon | |||
size={Size.Large} | |||
orientation={Orientation.Up} | |||
label={vehicleLabel(vehicle, settings.vehicleLabel)} | |||
label={vehicleLabel(vehicle, vehicleLabelSetting(settings, vehicle))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the caller needs to make two calls, to vehicleLabelSettings
and vehicleLabel
. Could we get by with just one call to a vehicleLabel(vehicle, settings)
that checks which setting to use?
Ideally, the setting to use would depend on the page you're on, not the vehicle you're looking at, but since you should only see a shuttle on the shuttle page and only see non-shuttles on the ladder, I think it'd be okay to always determine the label based on the vehicle?
e01f511
to
41831b1
Compare
@skyqrose Ready for another look, I think I've addressed everything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
assets/static/images/icon-ladder.svg
Outdated
d="m32.73 39.86v-12.08a4.37 4.37 0 0 1 0-7.56v-12.08a4.36 4.36 0 1 1 4.36 0v12.08a4.37 4.37 0 0 1 0 7.56v12.08a4.36 4.36 0 1 1 -4.36 0zm-17.46 0a4.36 4.36 0 1 1 -4.36 0v-12.08a4.37 4.37 0 0 1 0-7.56v-12.08a4.36 4.36 0 1 1 4.36 0v12.08a4.37 4.37 0 0 1 0 7.56z" | ||
/> | ||
</svg> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whitespace is a little weird in this file. There's a trailing line, and all lines except the 1st line (in both .svg files) are indented one extra space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah weird. Fixed thanks.
Render icons more like others.
a3c53bc
to
0119004
Compare
Got a thumbs up from Ingrid. |
Asana ticket: Add a new settings option for shuttle vehicle labels (vs. route ladder vehicle labels)