generated from RENCI/react-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from RENCI/126-move-layer-delete-trash-can-to…
…-the-layer-panel 126 move layer delete trash can to the layer panel
- Loading branch information
Showing
3 changed files
with
37 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<ActionButton | ||
color="danger" | ||
variant="outlined" | ||
onClick={ () => removeLayer(layerId) } | ||
sx={{ | ||
'filter': 'opacity(0.2)', | ||
transition: 'filter 250ms', | ||
'&:hover': { | ||
'filter': 'opacity(1.0)', | ||
}, | ||
}} | ||
> | ||
<RemoveIcon /> | ||
</ActionButton> | ||
); | ||
}; | ||
|
||
DeleteLayerButton.propTypes = { | ||
layerId: PropTypes.string.isRequired | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters