Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
anamontiaga committed Feb 19, 2024
1 parent c7168f7 commit da72796
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion client/src/components/map/legend/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export interface LegendProps extends PropsWithChildren {
}

export interface LegendItemProps extends LegendItemEvents {
id: number;
id: string;
name?: string;
className?: string;

Expand Down
10 changes: 5 additions & 5 deletions client/src/containers/map/legend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const MapLegends = ({ className = '' }) => {

const handleChangeOrder = useCallback(
(order: string[]) => {
const newLayers: number[] = order.reduce((prev: number[], curr) => {
const id = layers.find((layer) => layer === Number(curr));
const newLayers: string[] = order.reduce((prev: string[], curr) => {
const id = layers.find((layer) => layer === curr);
return !!id ? [...prev, id] : prev;
}, []);

Expand All @@ -27,7 +27,7 @@ const MapLegends = ({ className = '' }) => {
);

const handleChangeOpacity = useCallback(
(id: number, opacity: number) =>
(id: string, opacity: number) =>
setLayersSettings((prev) => ({
...prev,
[id]: {
Expand All @@ -40,7 +40,7 @@ const MapLegends = ({ className = '' }) => {
);

const handleChangeVisibility = useCallback(
(id: number, visibility: boolean) =>
(id: string, visibility: boolean) =>
setLayersSettings((prev) => ({
...prev,
[id]: {
Expand All @@ -53,7 +53,7 @@ const MapLegends = ({ className = '' }) => {
);

const handleChangeExpand = useCallback(
(id: number, expand: boolean) =>
(id: string, expand: boolean) =>
setLayersSettings((prev) => ({
...prev,
[id]: {
Expand Down
4 changes: 2 additions & 2 deletions client/src/containers/map/legend/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const getSettingsManager = (data: LayerTyped = {} as LayerTyped): SettingsManage

const MapLegendItem = ({ id, ...props }: MapLegendItemProps) => {
const layersSettings = useAtomValue(layersSettingsAtom);

const { data, isError, isFetched, isFetching, isPlaceholderData } = useGetLayersId(id);
// TODO: change strapi schema id to string
const { data, isError, isFetched, isFetching, isPlaceholderData } = useGetLayersId(Number(id));

const attributes = data?.data?.attributes as LayerTyped;
const legend_config = attributes?.legend_config;
Expand Down
6 changes: 3 additions & 3 deletions client/src/containers/map/popup/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { LayerTyped } from '@/types/layers';
import ContentLoader from '@/components/ui/loader';

export interface PopupItemProps {
id: number;
id: string;
}
const PopupItem = ({ id }: PopupItemProps) => {
const [rendered, setRendered] = useState(false);
Expand All @@ -25,8 +25,8 @@ const PopupItem = ({ id }: PopupItemProps) => {

const popup = useAtomValue(popupAtom);
const layersInteractiveIds = useAtomValue(layersInteractiveIdsAtom);

const { data, isFetching, isFetched, isError, isPlaceholderData } = useGetLayersId(id);
// TODO: change strapi schema id to string
const { data, isFetching, isFetched, isError, isPlaceholderData } = useGetLayersId(Number(id));

const attributes = data?.data?.attributes as LayerTyped;
const source = attributes.config.source;
Expand Down

0 comments on commit da72796

Please sign in to comment.