@universal-tennis/ui-shared 0.1.42 → 0.1.43
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 +3 -2
- package/dist/stories/atoms/Map/Map.js +4 -3
- package/dist/stories/atoms/Map/Map.js.map +1 -1
- package/dist/stories/atoms/Map/Map.stories.d.ts +4 -1
- package/dist/stories/atoms/Map/Map.stories.js +17 -2
- package/dist/stories/atoms/Map/Map.stories.js.map +1 -1
- package/package.json +1 -1
- package/src/stories/atoms/Map/Map.stories.tsx +20 -2
- package/src/stories/atoms/Map/Map.tsx +7 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface MapProps {
|
|
3
3
|
placeId: string;
|
|
4
|
-
height: string;
|
|
4
|
+
height: string | number;
|
|
5
|
+
width: string | number;
|
|
5
6
|
}
|
|
6
|
-
export default function Map({ placeId, height }: MapProps): JSX.Element;
|
|
7
|
+
export default function Map({ placeId, height, width }: MapProps): JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export default function Map({ placeId, height }) {
|
|
2
|
+
export default function Map({ placeId, height, width }) {
|
|
3
3
|
const placeParam = placeId && `q=place_id:${placeId}`;
|
|
4
4
|
const placeUrl = `https://www.google.com/maps/embed/v1/place?key=AIzaSyCapzh9VsfXAzC9fAaosZJulONx7H1BFaY&${placeParam}`;
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const mapHeight = height || `216px`;
|
|
6
|
+
const mapWidth = width || `100%`;
|
|
7
|
+
return (React.createElement("iframe", { width: mapWidth, height: mapHeight, src: placeUrl, title: "Google Maps" }));
|
|
7
8
|
}
|
|
8
9
|
//# sourceMappingURL=Map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Map/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Map.js","sourceRoot":"","sources":["../../../../src/stories/atoms/Map/Map.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAC1B,OAAO,EAAE,MAAM,EAAE,KAAK,EACb;IACT,MAAM,UAAU,GAAG,OAAO,IAAI,cAAc,OAAO,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAG,0FAA0F,UAAU,EAAE,CAAC;IACxH,MAAM,SAAS,GAAG,MAAM,IAAI,OAAO,CAAC;IACpC,MAAM,QAAQ,GAAG,KAAK,IAAI,MAAM,CAAC;IAEjC,OAAO,CACH,gCACI,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAC,aAAa,GACrB,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -3,4 +3,7 @@ declare const _default: {
|
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: any;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const WithCustomStringHeight: any;
|
|
7
|
+
export declare const WithCustomNumberHeight: any;
|
|
8
|
+
export declare const WithCustomStringWidth: any;
|
|
9
|
+
export declare const WithCustomNumberWidth: any;
|
|
@@ -13,9 +13,24 @@ export const Default = MapTemplate.bind({});
|
|
|
13
13
|
Default.args = {
|
|
14
14
|
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
15
15
|
};
|
|
16
|
-
export const
|
|
17
|
-
|
|
16
|
+
export const WithCustomStringHeight = MapTemplate.bind({});
|
|
17
|
+
WithCustomStringHeight.args = {
|
|
18
18
|
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
19
19
|
height: '320px'
|
|
20
20
|
};
|
|
21
|
+
export const WithCustomNumberHeight = MapTemplate.bind({});
|
|
22
|
+
WithCustomNumberHeight.args = {
|
|
23
|
+
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
24
|
+
height: 320
|
|
25
|
+
};
|
|
26
|
+
export const WithCustomStringWidth = MapTemplate.bind({});
|
|
27
|
+
WithCustomStringWidth.args = {
|
|
28
|
+
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
29
|
+
width: '620px'
|
|
30
|
+
};
|
|
31
|
+
export const WithCustomNumberWidth = MapTemplate.bind({});
|
|
32
|
+
WithCustomNumberWidth.args = {
|
|
33
|
+
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
34
|
+
width: 620
|
|
35
|
+
};
|
|
21
36
|
//# sourceMappingURL=Map.stories.js.map
|
|
@@ -1 +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,
|
|
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,sBAAsB,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3D,sBAAsB,CAAC,IAAI,GAAG;IAC5B,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,OAAO;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3D,sBAAsB,CAAC,IAAI,GAAG;IAC5B,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,GAAG;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1D,qBAAqB,CAAC,IAAI,GAAG;IAC3B,OAAO,EAAE,6BAA6B;IACtC,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1D,qBAAqB,CAAC,IAAI,GAAG;IAC3B,OAAO,EAAE,6BAA6B;IACtC,KAAK,EAAE,GAAG;CACX,CAAC"}
|
package/package.json
CHANGED
|
@@ -18,8 +18,26 @@ Default.args = {
|
|
|
18
18
|
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export const
|
|
22
|
-
|
|
21
|
+
export const WithCustomStringHeight = MapTemplate.bind({});
|
|
22
|
+
WithCustomStringHeight.args = {
|
|
23
23
|
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
24
24
|
height: '320px'
|
|
25
25
|
};
|
|
26
|
+
|
|
27
|
+
export const WithCustomNumberHeight = MapTemplate.bind({});
|
|
28
|
+
WithCustomNumberHeight.args = {
|
|
29
|
+
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
30
|
+
height: 320
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const WithCustomStringWidth = MapTemplate.bind({});
|
|
34
|
+
WithCustomStringWidth.args = {
|
|
35
|
+
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
36
|
+
width: '620px'
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const WithCustomNumberWidth = MapTemplate.bind({});
|
|
40
|
+
WithCustomNumberWidth.args = {
|
|
41
|
+
placeId: 'ChIJj6tQBWXIxokRXeXk9xqsgMo',
|
|
42
|
+
width: 620
|
|
43
|
+
};
|
|
@@ -2,20 +2,22 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface MapProps {
|
|
4
4
|
placeId: string;
|
|
5
|
-
height: string;
|
|
5
|
+
height: string | number;
|
|
6
|
+
width: string | number;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
export default function Map({
|
|
9
|
-
placeId, height
|
|
10
|
+
placeId, height, width
|
|
10
11
|
}: MapProps) {
|
|
11
12
|
const placeParam = placeId && `q=place_id:${placeId}`;
|
|
12
13
|
const placeUrl = `https://www.google.com/maps/embed/v1/place?key=AIzaSyCapzh9VsfXAzC9fAaosZJulONx7H1BFaY&${placeParam}`;
|
|
14
|
+
const mapHeight = height || `216px`;
|
|
15
|
+
const mapWidth = width || `100%`;
|
|
13
16
|
|
|
14
|
-
const mapheight = height || `216px`;
|
|
15
17
|
return (
|
|
16
18
|
<iframe
|
|
17
|
-
width=
|
|
18
|
-
height={
|
|
19
|
+
width={mapWidth}
|
|
20
|
+
height={mapHeight}
|
|
19
21
|
src={placeUrl}
|
|
20
22
|
title="Google Maps"
|
|
21
23
|
/>
|