Skip to content

Commit 0be2046

Browse files
committed
updated gatsby example
1 parent e9a9b71 commit 0be2046

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+361
-653
lines changed

.prettierrc

-5
This file was deleted.

packages/react-google-maps-api-gatsby-example/.eslintignore

-6
This file was deleted.

packages/react-google-maps-api-gatsby-example/.eslintrc.js

-113
This file was deleted.

packages/react-google-maps-api-gatsby-example/.prettierrc.js

-9
This file was deleted.

packages/react-google-maps-api-gatsby-example/src/examples/example-bicycling.stories.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from 'react'
2-
import { ComponentStory, ComponentMeta } from '@storybook/react'
3-
import { BicyclingLayer as ExampleComponent} from '@react-google-maps/api'
1+
2+
import type { ComponentStory, ComponentMeta } from '@storybook/react'
3+
import { BicyclingLayer as ExampleComponent } from '@react-google-maps/api'
44

55
import ExampleBicycling from './example-bicycling'
66
import { shapeExampleStyles } from '../components/styles'

packages/react-google-maps-api-gatsby-example/src/examples/example-bicycling.js renamed to packages/react-google-maps-api-gatsby-example/src/examples/example-bicycling.tsx

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react'
1+
import { type CSSProperties, memo } from 'react'
22
import PropTypes from 'prop-types'
33
import { GoogleMap, BicyclingLayer } from '@react-google-maps/api'
44

@@ -8,25 +8,31 @@ const ExampleBicyclingPropTypes = {
88
}).isRequired,
99
}
1010

11-
const center = {
11+
const center: google.maps.LatLngLiteral = {
1212
lat: 0,
1313
lng: -180,
1414
}
1515

16-
const onClick = (...args) => {
16+
function onClick(...args: any[]) {
1717
console.log('onClick args: ', args)
1818
}
1919

20-
const onBicyclingLayerLoad = (bicyclingLayer) => {
20+
function onBicyclingLayerLoad (bicyclingLayer: google.maps.BicyclingLayer) {
2121
// Do something with bicyclingLayer
2222
console.log('bicyclingLayer: ', bicyclingLayer)
2323
}
2424

25-
const onMapLoad = (map) => {
25+
const onMapLoad = (map: google.maps.Map) => {
2626
console.log('map: ', map)
2727
}
2828

29-
function ExampleBicycling({ styles }) {
29+
interface Props {
30+
styles: {
31+
container: CSSProperties | undefined
32+
}
33+
}
34+
35+
function ExampleBicycling({ styles }: Props) {
3036
return (
3137
<div className='map'>
3238
<div className='map-container'>
@@ -47,4 +53,4 @@ function ExampleBicycling({ styles }) {
4753

4854
ExampleBicycling.propTypes = ExampleBicyclingPropTypes
4955

50-
export default React.memo(ExampleBicycling)
56+
export default memo(ExampleBicycling)

packages/react-google-maps-api-gatsby-example/src/examples/example-data.js

-119
This file was deleted.

packages/react-google-maps-api-gatsby-example/src/examples/example-data.stories.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React from 'react'
2-
import { ComponentStory, ComponentMeta } from '@storybook/react'
3-
import { Data as ExampleComponent} from '@react-google-maps/api'
1+
import type { ComponentStory, ComponentMeta } from '@storybook/react'
2+
import { Data as ExampleComponent } from '@react-google-maps/api'
43

54
import ExampleData from './example-data'
65
import { shapeExampleStyles } from '../components/styles'

0 commit comments

Comments
 (0)