Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
anamontiaga committed Feb 27, 2024
1 parent cc76abe commit 2750ec2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions client/src/containers/datasets/layers/projects/hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { CircleLayer } from 'mapbox-gl';

import { Settings } from '@/components/map/legend/types';
import { LayerSettings } from '@/types/layers';

export function useLayers({
settings: { opacity = 1, visibility = 'visible' },
}: {
settings: Settings;
settings: { opacity: LayerSettings['opacity']; visibility: LayerSettings['visibility'] };
}) {
return [
{
Expand Down
8 changes: 4 additions & 4 deletions client/src/containers/map/layer-manager/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import { layersInteractiveAtom, layersInteractiveIdsAtom } from '@/store';

import { useGetLayersId } from '@/types/generated/layer';
import { Config, LayerTyped } from '@/types/layers';
import type { Settings } from '@/types/layers';
import type { LayerSettings } from '@/types/layers';

import DeckJsonLayer from '@/components/map/layers/deck-json-layer';
import MapboxLayer from '@/components/map/layers/mapbox-layer';

interface LayerManagerItemProps {
id: string;
beforeId: string;
settings: Settings;
settings: { opacity: LayerSettings['opacity']; visibility: LayerSettings['visibility'] };
}

const LayerManagerItem = ({ id, beforeId, settings }: LayerManagerItemProps) => {
Expand Down Expand Up @@ -75,7 +75,7 @@ const LayerManagerItem = ({ id, beforeId, settings }: LayerManagerItemProps) =>
config,
params_config,
settings,
} as any);
});

if (!c) return null;

Expand All @@ -98,7 +98,7 @@ const LayerManagerItem = ({ id, beforeId, settings }: LayerManagerItemProps) =>
config,
params_config,
settings,
} as any);
});

return <DeckJsonLayer id={`${id}-layer`} beforeId={beforeId} config={c} settings={settings} />;
}
Expand Down
7 changes: 1 addition & 6 deletions client/src/types/layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ export interface LayerSettings {
id: LayerId;
}

export interface Settings {
opacity: number;
visibility: 'none' | 'visible';
}

export type ParamsConfig = Record<string, ParamsConfigValue>[];

export type LegendConfig = {
Expand Down Expand Up @@ -62,7 +57,7 @@ export type LayerProps = {
onAdd?: (props: Config) => void;
onRemove?: (props: Config) => void;
beforeId: string;
settings: Settings;
settings: { opacity: LayerSettings['opacity']; visibility: LayerSettings['visibility'] };
};

export type LayerTyped = Layer & {
Expand Down

0 comments on commit 2750ec2

Please sign in to comment.