diff --git a/src/components/trays/layers/delete-layer-button.js b/src/components/trays/layers/delete-layer-button.js new file mode 100644 index 00000000..6349f07e --- /dev/null +++ b/src/components/trays/layers/delete-layer-button.js @@ -0,0 +1,33 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +import { + DeleteForever as RemoveIcon, +} from '@mui/icons-material'; +import { useLayers } from '@context'; +import { ActionButton } from '@components/buttons'; + +export const DeleteLayerButton = ({ layerId }) => { + const { removeLayer } = useLayers(); + + return ( + removeLayer(layerId) } + sx={{ + 'filter': 'opacity(0.2)', + transition: 'filter 250ms', + '&:hover': { + 'filter': 'opacity(1.0)', + }, + }} + > + + + ); +}; + +DeleteLayerButton.propTypes = { + layerId: PropTypes.string.isRequired +}; diff --git a/src/components/trays/layers/layer-card-actions.js b/src/components/trays/layers/layer-card-actions.js index 104ca844..09d0a3d7 100644 --- a/src/components/trays/layers/layer-card-actions.js +++ b/src/components/trays/layers/layer-card-actions.js @@ -2,7 +2,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Box, - Divider, FormControl, FormLabel, ListItemDecorator, @@ -14,16 +13,14 @@ import { Stack, } from '@mui/joy'; import { - DeleteForever as RemoveIcon, FormatPaint as AppearanceIcon, DataObject as MetadataIcon, } from '@mui/icons-material'; import { useLayers, useSettings } from '@context'; -import { ActionButton } from '@components/buttons'; export const LayerActions = ({ layer }) => { const { darkMode } = useSettings(); - const { removeLayer, setLayerOpacity } = useLayers(); + const { setLayerOpacity } = useLayers(); return ( @@ -45,19 +42,6 @@ export const LayerActions = ({ layer }) => { Metadata - - - - removeLayer(layer.id) } - sx={{ - borderRadius: 0, - borderBottom: '1px solid var(--joy-palette-divider)', - }} - > - - { const { @@ -66,7 +67,7 @@ export const LayerCard = ({ index, layer }) => { - + {layer.properties.product_name} { onChange={ () => toggleLayerVisibility(layer.id) } className="action-button" /> +