Skip to content

Commit

Permalink
Merge pull request #621 from ibi-group/support-0-step-length
Browse files Browse the repository at this point in the history
Support Step Length 0
  • Loading branch information
miles-grant-ibigroup authored Jul 19, 2023
2 parents c10eb19 + b551fb0 commit 53fcde6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 78 deletions.
99 changes: 24 additions & 75 deletions __snapshots__/storybook.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23043,7 +23043,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux E Scooter Rental Transit Itine
>
street transit link
</span>
0
</span>
</div>
</li>
Expand Down Expand Up @@ -64469,7 +64468,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Walk Only Itinerary 1`] = `
"absoluteDirection": "NORTHWEST",
"area": false,
"bogusName": true,
"distance": 47.236999999999995,
"distance": 0,
"elevation": Array [
Object {
"first": 0,
Expand Down Expand Up @@ -64514,7 +64513,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Walk Only Itinerary 1`] = `
"absoluteDirection": "WEST",
"area": false,
"bogusName": true,
"distance": 3.287,
"distance": null,
"elevation": Array [
Object {
"first": 0,
Expand Down Expand Up @@ -64568,7 +64567,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Walk Only Itinerary 2`] = `
color: #333;
}

.c38 {
.c37 {
color: #f44256;
}

Expand Down Expand Up @@ -64770,12 +64769,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Walk Only Itinerary 2`] = `
font-weight: 500;
}

.c37 {
font-weight: 200;
opacity: 0.8975;
padding-left: 1ch;
}

.c1 {
font-size: 16px;
}
Expand Down Expand Up @@ -65069,11 +65062,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Walk Only Itinerary 2`] = `
>
Unnamed Path
</span>
<span
className="c37"
>
155 feet
</span>
</span>
</div>
</li>
Expand Down Expand Up @@ -65102,11 +65090,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Walk Only Itinerary 2`] = `
>
Unnamed Path
</span>
<span
className="c37"
>
11 feet
</span>
</span>
</div>
</li>
Expand Down Expand Up @@ -65144,7 +65127,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Walk Only Itinerary 2`] = `
</svg>
<svg
aria-hidden="true"
className="c8 c38 c12"
className="c8 c37 c12"
fill="currentColor"
focusable="false"
height={20}
Expand Down Expand Up @@ -106841,7 +106824,6 @@ exports[`Storyshots ItineraryBody/otp-ui E Scooter Rental Transit Itinerary 2`]
>
street transit link
</span>
0
</span>
</div>
</li>
Expand Down Expand Up @@ -149905,7 +149887,7 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 1`] = `
"absoluteDirection": "NORTHWEST",
"area": false,
"bogusName": true,
"distance": 47.236999999999995,
"distance": 0,
"elevation": Array [
Object {
"first": 0,
Expand Down Expand Up @@ -149950,7 +149932,7 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 1`] = `
"absoluteDirection": "WEST",
"area": false,
"bogusName": true,
"distance": 3.287,
"distance": null,
"elevation": Array [
Object {
"first": 0,
Expand Down Expand Up @@ -150000,11 +149982,11 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 2`] = `
overflow: hidden;
}

.c34 {
.c33 {
color: #f44256;
}

.c29 {
.c28 {
border-top-style: solid;
border-top-width: 0;
padding-top: 0;
Expand All @@ -150021,13 +150003,13 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 2`] = `
text-decoration: none;
}

.c31 {
.c30 {
color: #008;
cursor: pointer;
margin-left: 5px;
}

.c31:hover {
.c30:hover {
-webkit-text-decoration: underline;
text-decoration: underline;
}
Expand Down Expand Up @@ -150061,7 +150043,7 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 2`] = `
margin: 0 0.125em;
}

.c33 {
.c32 {
text-align: center;
}

Expand Down Expand Up @@ -150176,19 +150158,19 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 2`] = `
font-size: 0.9em;
}

.c32 {
.c31 {
padding: 3px 10px 3px 10px;
border: 0;
margin-top: -15px;
width: 35px;
height: 35px;
}

.c32:hover {
.c31:hover {
cursor: pointer;
}

.c30 {
.c29 {
-webkit-flex: 0 0 25px;
-ms-flex: 0 0 25px;
flex: 0 0 25px;
Expand Down Expand Up @@ -150291,12 +150273,6 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 2`] = `
font-weight: 500;
}

.c28 {
font-weight: 200;
opacity: 0.8975;
padding-left: 1ch;
}

<ol
className="c0"
>
Expand Down Expand Up @@ -150477,11 +150453,6 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 2`] = `
>
Unnamed Path
</span>
<span
className="c28"
>
155 feet
</span>
</span>
</div>
</li>
Expand Down Expand Up @@ -150510,11 +150481,6 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 2`] = `
>
Unnamed Path
</span>
<span
className="c28"
>
11 feet
</span>
</span>
</div>
</li>
Expand All @@ -150525,11 +150491,11 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 2`] = `
</div>
</div>
<div
className="c29 c30"
className="c28 c29"
>
<a
aria-label="View on map"
className="c31 c32"
className="c30 c31"
onClick={[Function]}
title="View on map"
>
Expand Down Expand Up @@ -150563,11 +150529,11 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 2`] = `
className="c5"
>
<div
className="c33"
className="c32"
>
<svg
aria-hidden="true"
className="c22 c34"
className="c22 c33"
fill="currentColor"
focusable="false"
height={25}
Expand Down Expand Up @@ -150609,11 +150575,11 @@ exports[`Storyshots ItineraryBody/otp-ui Walk Only Itinerary 2`] = `
className="c11"
/>
<div
className="c29 c30"
className="c28 c29"
>
<a
aria-label="View on map"
className="c31 c32"
className="c30 c31"
onClick={[Function]}
title="View on map"
>
Expand Down Expand Up @@ -202365,7 +202331,6 @@ exports[`Storyshots PrintableItinerary E Scooter Rental Transit Itinerary 2`] =
>
street transit link
</span>
0
</span>
</div>
</div>
Expand Down Expand Up @@ -210882,7 +210847,7 @@ exports[`Storyshots PrintableItinerary Walk Only Itinerary 1`] = `
"absoluteDirection": "NORTHWEST",
"area": false,
"bogusName": true,
"distance": 47.236999999999995,
"distance": 0,
"elevation": Array [
Object {
"first": 0,
Expand Down Expand Up @@ -210927,7 +210892,7 @@ exports[`Storyshots PrintableItinerary Walk Only Itinerary 1`] = `
"absoluteDirection": "WEST",
"area": false,
"bogusName": true,
"distance": 3.287,
"distance": null,
"elevation": Array [
Object {
"first": 0,
Expand Down Expand Up @@ -210979,12 +210944,6 @@ exports[`Storyshots PrintableItinerary Walk Only Itinerary 2`] = `
font-weight: 500;
}

.c13 {
font-weight: 200;
opacity: 0.8975;
padding-left: 1ch;
}

.c0 {
margin-bottom: 10px;
border-top: 1px solid grey;
Expand Down Expand Up @@ -211117,11 +211076,6 @@ exports[`Storyshots PrintableItinerary Walk Only Itinerary 2`] = `
>
Unnamed Path
</span>
<span
className="c13"
>
155 feet
</span>
</span>
</div>
<div
Expand All @@ -211137,11 +211091,6 @@ exports[`Storyshots PrintableItinerary Walk Only Itinerary 2`] = `
>
Unnamed Path
</span>
<span
className="c13"
>
11 feet
</span>
</span>
</div>
</div>
Expand Down Expand Up @@ -248444,7 +248393,7 @@ exports[`Storyshots TripDetails Walk Only Itinerary 1`] = `
"absoluteDirection": "NORTHWEST",
"area": false,
"bogusName": true,
"distance": 47.236999999999995,
"distance": 0,
"elevation": Array [
Object {
"first": 0,
Expand Down Expand Up @@ -248489,7 +248438,7 @@ exports[`Storyshots TripDetails Walk Only Itinerary 1`] = `
"absoluteDirection": "WEST",
"area": false,
"bogusName": true,
"distance": 3.287,
"distance": null,
"elevation": Array [
Object {
"first": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"intermediateStops": [],
"steps": [
{
"distance": 47.236999999999995,
"distance": 0,
"relativeDirection": "DEPART",
"streetName": "path",
"absoluteDirection": "NORTHWEST",
Expand Down Expand Up @@ -97,7 +97,7 @@
]
},
{
"distance": 3.287,
"distance": null,
"relativeDirection": "LEFT",
"streetName": "path",
"absoluteDirection": "WEST",
Expand Down
2 changes: 1 addition & 1 deletion packages/itinerary-body/src/defaults/access-leg-step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function AccessLegStep({
<span className={className} style={style}>
{stepContent}
{/* TODO: Implement metric vs imperial (up until now it's just imperial). */}
{step?.distance && (
{step?.distance > 0 && (
<S.StepLength>
{humanizeDistanceString(step.distance, false, intl)}
</S.StepLength>
Expand Down

0 comments on commit 53fcde6

Please sign in to comment.