Skip to content

Commit 55aa9cc

Browse files
authored
Merge pull request #62 from ubilabs/chore/prettier
Chore/prettier
2 parents 838a485 + 99a67ff commit 55aa9cc

File tree

7 files changed

+31
-33
lines changed

7 files changed

+31
-33
lines changed

.pretiierrc renamed to .prettierrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"singleQuote": true,
77
"trailingComma": "none",
88
"bracketSpacing": false,
9-
"jsxBracketSameLine": true,
9+
"bracketSameLine": true,
1010
"arrowParens": "avoid",
1111
"parser": "typescript"
12-
}
12+
}

examples/google-map-with-markers/components/map-markers/map-markers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const MapMarkers: VoidFunctionComponent = (): null => {
5858
if (map) {
5959
const initialBounds = new google.maps.LatLngBounds();
6060

61-
const museumMarkers: Array<google.maps.Marker> = museums.map((museum) => {
61+
const museumMarkers: Array<google.maps.Marker> = museums.map(museum => {
6262
const {position, name} = museum;
6363

6464
const markerOptions: google.maps.MarkerOptions = {

src/google-map.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ export default class GoogleMap {
5454
language || defaultLanguage
5555
}&region=${region || defaultRegion}${
5656
libraries ? `&libraries=${libraries.join(',')}` : ''
57-
}${
58-
version ? `&v=${version}` : ''
59-
}${
57+
}${version ? `&v=${version}` : ''}${
6058
authReferrerPolicy ? `&auth_referrer_policy=${authReferrerPolicy}` : ''
6159
}`
6260
);
@@ -97,7 +95,7 @@ export default class GoogleMap {
9795
if (this.map) {
9896
document
9997
.querySelectorAll('script[src^="https://maps.googleapis.com"]')
100-
.forEach((script) => {
98+
.forEach(script => {
10199
script.remove();
102100
});
103101
if (window.google && window.google.maps) {

src/hooks/autocomplete.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ const useAutocomplete = (
1919
const placeChangedHandler = useRef(onPlaceChanged);
2020
const {map} = useGoogleMap();
2121

22-
const [
23-
autocomplete,
24-
setAutocomplete
25-
] = useState<google.maps.places.Autocomplete | null>(null);
22+
const [autocomplete, setAutocomplete] =
23+
useState<google.maps.places.Autocomplete | null>(null);
2624

2725
// Initializes the Google Maps Places Autocomplete
2826
useEffect(() => {

src/hooks/directions.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,29 @@ const useDirections = (props: DirectionsProps = {}): DirectionsHookReturns => {
3030
const {map, loading} = useGoogleMap();
3131

3232
// Creates a Directions Service instance
33-
const directionsService = useMemo<google.maps.DirectionsService | null>(() => {
34-
// Wait for map to be initialized
35-
if (!map || loading) {
36-
return null;
37-
}
33+
const directionsService =
34+
useMemo<google.maps.DirectionsService | null>(() => {
35+
// Wait for map to be initialized
36+
if (!map || loading) {
37+
return null;
38+
}
3839

39-
return new google.maps.DirectionsService();
40-
}, [map, loading]);
40+
return new google.maps.DirectionsService();
41+
}, [map, loading]);
4142

4243
// Creates a Directions Renderer instance
43-
const directionsRenderer = useMemo<google.maps.DirectionsRenderer | null>(() => {
44-
// Wait for map to be initialized
45-
if (!map || !renderOnMap) {
46-
return null;
47-
}
48-
49-
const renderer = new google.maps.DirectionsRenderer(renderOptions);
50-
renderer.setMap(map);
51-
52-
return renderer;
53-
}, [map, renderOnMap]);
44+
const directionsRenderer =
45+
useMemo<google.maps.DirectionsRenderer | null>(() => {
46+
// Wait for map to be initialized
47+
if (!map || !renderOnMap) {
48+
return null;
49+
}
50+
51+
const renderer = new google.maps.DirectionsRenderer(renderOptions);
52+
renderer.setMap(map);
53+
54+
return renderer;
55+
}, [map, renderOnMap]);
5456

5557
// Updates the directions renderer options
5658
useEffect(() => {

src/map-provider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export const GoogleMapContext = React.createContext<GoogleMapContextType>({
2828
/**
2929
* The global Google Map provider
3030
*/
31-
const GoogleMapProvider: React.FunctionComponent<PropsWithChildren<GoogleMapProviderProps>> = (
32-
props
33-
) => {
31+
const GoogleMapProvider: React.FunctionComponent<
32+
PropsWithChildren<GoogleMapProviderProps>
33+
> = props => {
3434
const {
3535
children,
3636
googleMapsAPIKey,

src/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ declare module 'googlemaps';
22

33
/* eslint-disable init-declarations */
44
declare module '*.module.css' {
5-
const classes: { [key: string]: string };
5+
const classes: {[key: string]: string};
66
export default classes;
77
}

0 commit comments

Comments
 (0)