Skip to content
Snippets Groups Projects

Resolve MIN-90 "Feat/ adding layerimage"

All threads resolved!
Merged Miłosz Grocholewski requested to merge feat/MIN-90-adding-layerimage into development
All threads resolved!
9 files
+ 124
64
Compare changes
  • Side-by-side
  • Inline
Files
9
@@ -5,7 +5,6 @@ import {
layersForCurrentModelSelector,
layersVisibilityForCurrentModelSelector,
} from '@/redux/layers/layers.selectors';
import { Switch } from '@/shared/Switch';
import { setLayerVisibility } from '@/redux/layers/layers.slice';
import { currentModelIdSelector } from '@/redux/models/models.selectors';
import { Button } from '@/shared/Button';
@@ -15,6 +14,7 @@ import { useState } from 'react';
import { getLayersForModel, removeLayer } from '@/redux/layers/layers.thunks';
import { showToast } from '@/utils/showToast';
import { SerializedError } from '@reduxjs/toolkit';
import { LayersDrawerLayerActions } from '@/components/Map/Drawer/LayersDrawer/LayersDrawerLayerActions.component';
export const LayersDrawer = (): JSX.Element => {
const layersForCurrentModel = useAppSelector(layersForCurrentModelSelector);
@@ -83,28 +83,20 @@ export const LayersDrawer = (): JSX.Element => {
className="flex items-center justify-between gap-3 border-b py-4"
>
<h1 className="truncate">{layer.details.name}</h1>
<div className="flex items-center gap-2">
<Switch
isChecked={layersVisibilityForCurrentModel[layer.details.id]}
onToggle={value =>
dispatch(
setLayerVisibility({
modelId: currentModelId,
visible: value,
layerId: layer.details.id,
}),
)
}
/>
<Button onClick={() => editLayer(layer.details.id)}>Edit</Button>
<Button
onClick={() => onRemoveLayer(layer.details.id)}
color="error"
variantStyles="remove"
>
Remove
</Button>
</div>
<LayersDrawerLayerActions
isChecked={layersVisibilityForCurrentModel[layer.details.id]}
editLayer={() => editLayer(layer.details.id)}
removeLayer={() => onRemoveLayer(layer.details.id)}
toggleVisibility={value =>
dispatch(
setLayerVisibility({
modelId: currentModelId,
visible: value,
layerId: layer.details.id,
}),
)
}
/>
</div>
))}
</div>
Loading