summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/containers/modals/EditRackNameModal.js
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-web/opendc-web-ui/src/containers/modals/EditRackNameModal.js')
-rw-r--r--opendc-web/opendc-web-ui/src/containers/modals/EditRackNameModal.js37
1 files changed, 0 insertions, 37 deletions
diff --git a/opendc-web/opendc-web-ui/src/containers/modals/EditRackNameModal.js b/opendc-web/opendc-web-ui/src/containers/modals/EditRackNameModal.js
deleted file mode 100644
index edb57217..00000000
--- a/opendc-web/opendc-web-ui/src/containers/modals/EditRackNameModal.js
+++ /dev/null
@@ -1,37 +0,0 @@
-import React from 'react'
-import { useDispatch, useSelector } from 'react-redux'
-import { closeEditRackNameModal } from '../../actions/modals/topology'
-import { editRackName } from '../../actions/topology/rack'
-import TextInputModal from '../../components/modals/TextInputModal'
-
-const EditRackNameModal = (props) => {
- const { visible, previousName } = useSelector((state) => {
- return {
- visible: state.modals.editRackNameModalVisible,
- previousName:
- state.interactionLevel.mode === 'RACK'
- ? state.objects.rack[state.objects.tile[state.interactionLevel.tileId].rackId].name
- : '',
- }
- })
-
- const dispatch = useDispatch()
- const callback = (name) => {
- if (name) {
- dispatch(editRackName(name))
- }
- dispatch(closeEditRackNameModal())
- }
- return (
- <TextInputModal
- title="Edit rack name"
- label="Rack name"
- show={visible}
- initialValue={previousName}
- callback={callback}
- {...props}
- />
- )
-}
-
-export default EditRackNameModal