-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace street view with directions in VPC (#2277)
* refactor: split DirectionsButton into its own component * feat: replace street view button with directions button in VPP * fix: rename VehicleLocationStreetViewButton
- Loading branch information
Showing
10 changed files
with
58 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.c-directions-button { | ||
@include button-primary; | ||
@include button-icon(1rem); | ||
display: inline-flex; | ||
align-items: center; | ||
gap: 4px; | ||
text-decoration: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from "react" | ||
import { DiamondTurnRightIcon } from "../helpers/icon" | ||
|
||
const directionsUrl = ( | ||
latitude: number, | ||
longitude: number | ||
) => `https://www.google.com/maps/dir/?api=1\ | ||
&destination=${latitude.toString()},${longitude.toString()}\ | ||
&travelmode=driving` | ||
|
||
export const DirectionsButton = ({ | ||
latitude, | ||
longitude, | ||
}: { | ||
latitude: number | ||
longitude: number | ||
}) => ( | ||
<a | ||
className="c-directions-button button-small" | ||
href={directionsUrl(latitude, longitude)} | ||
target="_blank" | ||
rel="noreferrer" | ||
> | ||
<DiamondTurnRightIcon /> | ||
Get directions to bus | ||
</a> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters