Skip to content

Commit 4922ad4

Browse files
committed
Add validation for uploaded geojson
1 parent b2e7ef0 commit 4922ad4

File tree

6 files changed

+314
-126
lines changed

6 files changed

+314
-126
lines changed

manager-dashboard/app/components/AlertBanner/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,36 @@ import React from 'react';
22
import { IoAlertCircleOutline } from 'react-icons/io5';
33
import { _cs } from '@togglecorp/fujs';
44

5+
import Heading from '#components/Heading';
6+
57
import styles from './styles.css';
68

79
interface Props {
810
className?: string;
11+
title?: React.ReactNode;
912
children: React.ReactNode;
1013
}
1114

1215
function AlertBanner(props: Props) {
1316
const {
1417
className,
1518
children,
19+
title,
1620
} = props;
1721

1822
return (
1923
<div className={_cs(styles.banner, className)}>
2024
<div className={styles.bannerIcon}>
2125
<IoAlertCircleOutline />
2226
</div>
23-
{children}
27+
<div className={styles.container}>
28+
{title && (
29+
<Heading>
30+
{title}
31+
</Heading>
32+
)}
33+
{children}
34+
</div>
2435
</div>
2536
);
2637
}

manager-dashboard/app/components/AlertBanner/styles.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@
88
.banner-icon {
99
font-size: var(--font-size-super-large);
1010
}
11-
}
11+
12+
.container {
13+
display: flex;
14+
flex-direction: column;
15+
gap: var(--spacing-small);
16+
}
17+
}

manager-dashboard/app/components/GeoJsonPreview/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ function GeoJsonPreview(props: Props) {
8989
const layer = new Layer(
9090
finalUrl,
9191
{
92+
// NOTE: we have a limit of 22
93+
maxZoom: 22,
9294
// attribution: '',
9395
// subdomains: ['a', 'b', 'c'],
9496
},

0 commit comments

Comments
 (0)