@universal-tennis/ui-shared 0.1.40 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stories/atoms/Map/Map.d.ts +6 -0
- package/dist/stories/atoms/Map/Map.js +8 -0
- package/dist/stories/atoms/Map/Map.js.map +1 -0
- package/dist/stories/atoms/Map/Map.stories.d.ts +6 -0
- package/dist/stories/atoms/Map/Map.stories.js +21 -0
- package/dist/stories/atoms/Map/Map.stories.js.map +1 -0
- package/package.json +1 -1
- package/src/stories/atoms/Map/Map.stories.tsx +25 -0
- package/src/stories/atoms/Map/Map.tsx +23 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function Map({ placeId, height }) {
|
|
3
|
+
const placeParam = placeId && `q=place_id:${placeId}`;
|
|
4
|
+
const placeUrl = `https://www.google.com/maps/embed/v1/place?key=AIzaSyCapzh9VsfXAzC9fAaosZJulONx7H1BFaY&${placeParam}`;
|
|
5
|
+
const mapheight = height || `216px`;
|
|
6
|
+
return (React.createElement("iframe", { width: "100%", height: mapheight, src: placeUrl, title: "Google Maps" }));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=Map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Map/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAC1B,OAAO,EAAE,MAAM,EACN;IACT,MAAM,UAAU,GAAG,OAAO,IAAI,cAAc,OAAO,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAG,0FAA0F,UAAU,EAAE,CAAC;IAExH,MAAM,SAAS,GAAG,MAAM,IAAI,OAAO,CAAC;IACpC,OAAO,CACH,gCACI,KAAK,EAAC,MAAM,EACZ,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAC,aAAa,GACrB,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Map from './Map';
|
|
3
|
+
// Default
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Atoms/Map',
|
|
6
|
+
};
|
|
7
|
+
// Templates
|
|
8
|
+
function MapTemplate(args) {
|
|
9
|
+
return React.createElement(Map, Object.assign({}, args));
|
|
10
|
+
}
|
|
11
|
+
// Stories
|
|
12
|
+
export const Default = MapTemplate.bind({});
|
|
13
|
+
Default.args = {
|
|
14
|
+
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
15
|
+
};
|
|
16
|
+
export const WithCustomHeight = MapTemplate.bind({});
|
|
17
|
+
WithCustomHeight.args = {
|
|
18
|
+
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
19
|
+
height: '320px'
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=Map.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Map.stories.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Map/Map.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,GAAiB,MAAM,OAAO,CAAC;AAEtC,UAAU;AACV,eAAe;IACb,KAAK,EAAE,WAAW;CACnB,CAAC;AAEF,YAAY;AACZ,SAAS,WAAW,CAAC,IAAc;IACjC,OAAO,oBAAC,GAAG,oBAAK,IAAI,EAAI,CAAC;AAC3B,CAAC;AAED,UAAU;AACV,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,OAAO,CAAC,IAAI,GAAG;IACb,OAAO,EAAE,6BAA6B;CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrD,gBAAgB,CAAC,IAAI,GAAG;IACtB,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,OAAO;CAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Map, { MapProps } from './Map';
|
|
4
|
+
|
|
5
|
+
// Default
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Atoms/Map',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// Templates
|
|
11
|
+
function MapTemplate(args: MapProps) {
|
|
12
|
+
return <Map {...args} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Stories
|
|
16
|
+
export const Default = MapTemplate.bind({});
|
|
17
|
+
Default.args = {
|
|
18
|
+
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const WithCustomHeight = MapTemplate.bind({});
|
|
22
|
+
WithCustomHeight.args = {
|
|
23
|
+
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
24
|
+
height: '320px'
|
|
25
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface MapProps {
|
|
4
|
+
placeId: string;
|
|
5
|
+
height: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default function Map({
|
|
9
|
+
placeId, height
|
|
10
|
+
}: MapProps) {
|
|
11
|
+
const placeParam = placeId && `q=place_id:${placeId}`;
|
|
12
|
+
const placeUrl = `https://www.google.com/maps/embed/v1/place?key=AIzaSyCapzh9VsfXAzC9fAaosZJulONx7H1BFaY&${placeParam}`;
|
|
13
|
+
|
|
14
|
+
const mapheight = height || `216px`;
|
|
15
|
+
return (
|
|
16
|
+
<iframe
|
|
17
|
+
width="100%"
|
|
18
|
+
height={mapheight}
|
|
19
|
+
src={placeUrl}
|
|
20
|
+
title="Google Maps"
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|