Skip to content

Commit 5a05d34

Browse files
committed
Update the styling of map container
- Add isChromatic to update animation parameters
1 parent b2cb5bd commit 5a05d34

17 files changed

+24
-16
lines changed

storybook/.storybook/preview-head.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
window.global = window;
33
</script>
44
<style>
5+
html, body, #root {
6+
height: 100%
7+
}
58
* {
69
box-sizing: border-box;
710
}

storybook/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@mapbox/mapbox-gl-draw": "^1.4.3",
1818
"@togglecorp/fujs": "^2.0.0",
1919
"@togglecorp/re-map": "^0.3.0",
20+
"chromatic": "^9.0.0",
2021
"immer": "^10.0.3",
2122
"maplibre-gl": "^3.5.2",
2223
"react": "^18.2.0",

storybook/stories/BubbleMap.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ export function Default() {
7272

7373
export default {
7474
title: 'Type/Bubble Map',
75-
parameters: { delay: 500 },
75+
parameters: { delay: 1000 },
7676
};

storybook/stories/ChoroplethMap.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,5 @@ export function Default() {
187187

188188
export default {
189189
title: 'Type/Choropleth Map',
190-
parameters: { delay: 500 },
190+
parameters: { delay: 1000 },
191191
};

storybook/stories/FitBounds.stories.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import isChromatic from 'chromatic/isChromatic';
23
import Map, {
34
MapContainer,
45
MapBounds,
@@ -27,13 +28,13 @@ export function Default() {
2728
<MapBounds
2829
bounds={bounds}
2930
padding={10}
30-
duration={1000}
31+
duration={isChromatic() ? 0 : 1000}
3132
/>
3233
</Map>
3334
);
3435
}
3536

3637
export default {
3738
title: 'Basic/Fit Bounds',
38-
parameters: { delay: 500 },
39+
parameters: { delay: 1000 },
3940
};

storybook/stories/FlyToLocation.stories.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import isChromatic from 'chromatic/isChromatic';
23
import Map, {
34
MapContainer,
45
MapCenter,
@@ -25,7 +26,7 @@ export function Default() {
2526
]}
2627
centerOptions={{
2728
zoom: 4,
28-
duration: 1000,
29+
duration: isChromatic() ? 0 : 1000,
2930
}}
3031
/>
3132
</Map>
@@ -34,5 +35,5 @@ export function Default() {
3435

3536
export default {
3637
title: 'Basic/Fly to Location',
37-
parameters: { delay: 500 },
38+
parameters: { delay: 1000 },
3839
};

storybook/stories/GeoJSONMap.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ export function Default() {
7676

7777
export default {
7878
title: 'Source/GeoJSON Source',
79-
parameters: { delay: 500 },
79+
parameters: { delay: 1000 },
8080
};

storybook/stories/MbtilesMap.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ export function Default() {
1010

1111
export default {
1212
title: 'Source/Mbtiles Source',
13-
parameters: { delay: 500 },
1413
};

storybook/stories/PmtilesMap.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ export function Default() {
1010

1111
export default {
1212
title: 'Source/Pmtiles Source',
13-
parameters: { delay: 500 },
1413
};

storybook/stories/SimpleMap.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ export function Default() {
2424

2525
export default {
2626
title: 'Basic/Simple Map',
27-
parameters: { delay: 500 },
27+
parameters: { delay: 1000 },
2828
};

0 commit comments

Comments
 (0)