Skip to content

Commit

Permalink
layer disclaimer
Browse files Browse the repository at this point in the history
  • Loading branch information
mluena committed May 6, 2024
1 parent 4d00d31 commit 1da61d8
Show file tree
Hide file tree
Showing 18 changed files with 301 additions and 1,794 deletions.
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
},
"dependencies": {
"@artsy/fresnel": "6.1.0",
"@deck.gl/core": "^8.9.6",
"@dnd-kit/core": "^6.0.8",
"@dnd-kit/modifiers": "^6.0.1",
"@dnd-kit/sortable": "^7.0.2",
Expand Down Expand Up @@ -88,18 +87,14 @@
},
"devDependencies": {
"@playwright/test": "^1.41.0",
"@transifex/cli": "6.0.2",
"@transifex/native": "6.0.2",
"@transifex/react": "6.0.2",
"@types/geojson": "7946.0.10",
"@types/google.analytics": "0.0.42",
"@types/mapbox-gl": "2.7.11",
"@types/node": "18.15.0",
"@types/node": "20.12.7",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"@typescript-eslint/eslint-plugin": "5.48.2",
"assert": "2.0.0",
"autoprefixer": "10.4.14",
"eslint": "8.32.0",
"eslint-config-next": "13.1.2",
"eslint-config-prettier": "8.6.0",
Expand All @@ -108,9 +103,7 @@
"prettier": "2.8.3",
"prettier-plugin-tailwindcss": "0.2.1",
"react-icons": "4.11.0",
"start-server-and-test": "1.12.1",
"svg-sprite-loader": "6.0.11",
"svgo": "3.0.2",
"svgo-loader": "3.0.3",
"typescript": "4.9.4"
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/contextual/contextual-basemaps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const BasemapsMapSettings = () => {
);

return (
<div className="relative flex flex-col text-sm text-black/85">
<RadioGroup onValueChange={handleClick} defaultValue={defaultActive}>
<div className="relative flex flex-col text-sm leading-4 text-black/85">
<RadioGroup onValueChange={handleClick} defaultValue={defaultActive} className="space-y-2">
<div className="flex space-x-4">
<RadioGroupItem
option={{ value: 'no-layer', label: 'No layer' }}
Expand Down
12 changes: 9 additions & 3 deletions src/components/map/drawing-tool/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type DrawControlProps = ConstructorParameters<typeof MapboxDraw>[0] & {
customPolygon?: GeoJSON.FeatureCollection;
onSetCustomPolygon?: (customPolygon) => void;
styles?: typeof DRAWING_STYLES;
onError?: (message: string, error: Error) => void;
};

const DEFAULT_PROPS: Partial<DrawControlProps> = {
Expand Down Expand Up @@ -49,7 +50,7 @@ export const DrawControl = (props: DrawControlProps) => {
}
);

const { onSetCustomPolygon, customPolygon } = props;
const { onSetCustomPolygon, customPolygon, onError } = props;

useEffect(() => {
if (!customPolygon) {
Expand All @@ -61,13 +62,18 @@ export const DrawControl = (props: DrawControlProps) => {
if (!drawRef) return null;

if (customPolygon) {
drawRef.add(customPolygon);
try {
drawRef.add(customPolygon);
} catch (error) {
console.error('Error adding custom polygon:', error);
onError?.('Error adding custom polygon:', error);
}

if (onSetCustomPolygon) {
onSetCustomPolygon(customPolygon);
}
}
}, [onSetCustomPolygon, customPolygon, drawRef]);
}, [onSetCustomPolygon, customPolygon, drawRef, onError]);

return null;
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/radio-group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface RadioGroupDemoProps extends RadioGroupProps {
}

const RadioGroup = ({ options, children, ...props }: RadioGroupDemoProps) => (
<RadioGroupPrimitive.Root className="space-y flex flex-col" {...props}>
<RadioGroupPrimitive.Root className="flex flex-col" {...props}>
{!!options
? options.map((option) => (
<div key={option.value}>
Expand Down
6 changes: 3 additions & 3 deletions src/components/suggested-layers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ const SuggestedLayers = ({
// };

return (
<div className="flex flex-col space-y-4 rounded-xl bg-black bg-opacity-[4%] p-3">
<div className="flex flex-col space-y-5 rounded-xl bg-black bg-opacity-[4%] p-3">
<div className="flex items-center justify-between">
<div className="flex items-center space-x-2">
<div className="flex items-center space-x-4">
{!!thumbSource && (
<div className="relative h-[42px] w-[42px] shrink-0 rounded-2xl">
<Image
Expand All @@ -62,7 +62,7 @@ const SuggestedLayers = ({
{color && (
<div className="h-[42px] w-[42px] rounded-2xl" style={{ backgroundColor: color }} />
)}
<p className="text-sm">{description}</p>
<p className="text-sm font-light">{description}</p>
</div>
<div className="flex items-start space-x-2">
<SwitchWrapper id={id}>
Expand Down
Loading

0 comments on commit 1da61d8

Please sign in to comment.