summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-13 17:42:53 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-05-17 17:06:50 +0200
commit1edbae1a0224e30bafb98638f419e1f967a9286f (patch)
tree2047c5a684379dfd395891e9447199f6001cef9b /opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room
parent1891a6f3963d3ddeae0ea093f9a7e3608a97b4d7 (diff)
ui: Move modal state outside of Redux
This change updates the frontend so that the modal state is not stored inside Redux but instead is stored using the useState hook. This simplifies the design of the modal components.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room')
-rw-r--r--opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/EditRoomComponent.js22
-rw-r--r--opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/RoomNameComponent.js6
2 files changed, 0 insertions, 28 deletions
diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/EditRoomComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/EditRoomComponent.js
deleted file mode 100644
index 857a646f..00000000
--- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/EditRoomComponent.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import classNames from 'classnames'
-import React from 'react'
-
-const EditRoomComponent = ({ onEdit, onFinish, isEditing, isInRackConstructionMode }) =>
- isEditing ? (
- <div className="btn btn-info btn-block" onClick={onFinish}>
- <span className="fa fa-check mr-2" />
- Finish editing room
- </div>
- ) : (
- <div
- className={classNames('btn btn-outline-info btn-block', {
- disabled: isInRackConstructionMode,
- })}
- onClick={() => (isInRackConstructionMode ? undefined : onEdit())}
- >
- <span className="fa fa-pencil mr-2" />
- Edit the tiles of this room
- </div>
- )
-
-export default EditRoomComponent
diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/RoomNameComponent.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/RoomNameComponent.js
deleted file mode 100644
index d637828e..00000000
--- a/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/room/RoomNameComponent.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import React from 'react'
-import NameComponent from '../NameComponent'
-
-const RoomNameComponent = ({ roomName, onEdit }) => <NameComponent name={roomName} onEdit={onEdit} />
-
-export default RoomNameComponent