From 0643532d5a5adeebf712fb7e0fecf5181baf8e77 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 28 Oct 2020 13:42:44 +0100 Subject: Use built-in Sass support from Create React App This change updates the frontend to use the built-in Sass support provided by Create React App to simplify the development pipeline. --- frontend/src/components/app/sidebars/Sidebar.js | 2 +- .../src/components/app/sidebars/topology/rack/MachineListComponent.js | 2 +- .../src/components/app/sidebars/topology/rack/RackSidebarComponent.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'frontend/src/components/app/sidebars') diff --git a/frontend/src/components/app/sidebars/Sidebar.js b/frontend/src/components/app/sidebars/Sidebar.js index e1760d5e..f7368f54 100644 --- a/frontend/src/components/app/sidebars/Sidebar.js +++ b/frontend/src/components/app/sidebars/Sidebar.js @@ -1,7 +1,7 @@ import PropTypes from 'prop-types' import classNames from 'classnames' import React from 'react' -import './Sidebar.css' +import './Sidebar.sass' class Sidebar extends React.Component { static propTypes = { diff --git a/frontend/src/components/app/sidebars/topology/rack/MachineListComponent.js b/frontend/src/components/app/sidebars/topology/rack/MachineListComponent.js index aa7a4f8f..12be26bd 100644 --- a/frontend/src/components/app/sidebars/topology/rack/MachineListComponent.js +++ b/frontend/src/components/app/sidebars/topology/rack/MachineListComponent.js @@ -1,7 +1,7 @@ import React from 'react' import EmptySlotContainer from '../../../../../containers/app/sidebars/topology/rack/EmptySlotContainer' import MachineContainer from '../../../../../containers/app/sidebars/topology/rack/MachineContainer' -import './MachineListComponent.css' +import './MachineListComponent.sass' const MachineListComponent = ({ machineIds }) => { return ( diff --git a/frontend/src/components/app/sidebars/topology/rack/RackSidebarComponent.js b/frontend/src/components/app/sidebars/topology/rack/RackSidebarComponent.js index d7127114..ca41bf57 100644 --- a/frontend/src/components/app/sidebars/topology/rack/RackSidebarComponent.js +++ b/frontend/src/components/app/sidebars/topology/rack/RackSidebarComponent.js @@ -3,7 +3,7 @@ import BackToRoomContainer from '../../../../../containers/app/sidebars/topology import DeleteRackContainer from '../../../../../containers/app/sidebars/topology/rack/DeleteRackContainer' import MachineListContainer from '../../../../../containers/app/sidebars/topology/rack/MachineListContainer' import RackNameContainer from '../../../../../containers/app/sidebars/topology/rack/RackNameContainer' -import './RackSidebarComponent.css' +import './RackSidebarComponent.sass' import AddPrefabContainer from '../../../../../containers/app/sidebars/topology/rack/AddPrefabContainer' const RackSidebarComponent = () => { -- cgit v1.2.3 From d6c06be32c5e6c9381a1105b5484152d91ebebbb Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 28 Oct 2020 16:54:39 +0100 Subject: Convert UnitTabs to Reactstrap --- .../sidebars/topology/machine/UnitTabsComponent.js | 116 +++++++++++++-------- 1 file changed, 72 insertions(+), 44 deletions(-) (limited to 'frontend/src/components/app/sidebars') diff --git a/frontend/src/components/app/sidebars/topology/machine/UnitTabsComponent.js b/frontend/src/components/app/sidebars/topology/machine/UnitTabsComponent.js index c03b826f..569166d8 100644 --- a/frontend/src/components/app/sidebars/topology/machine/UnitTabsComponent.js +++ b/frontend/src/components/app/sidebars/topology/machine/UnitTabsComponent.js @@ -1,50 +1,78 @@ -import React from 'react' +import React, { useState } from 'react' +import { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap' import UnitAddContainer from '../../../../../containers/app/sidebars/topology/machine/UnitAddContainer' import UnitListContainer from '../../../../../containers/app/sidebars/topology/machine/UnitListContainer' -const UnitTabsComponent = () => ( -
- -
-
- - -
-
- - -
-
- - -
-
- - -
+const UnitTabsComponent = () => { + const [activeTab, setActiveTab] = useState('cpu-units') + const toggle = (tab) => { + if (activeTab !== tab) setActiveTab(tab) + } + + return ( +
+ + + + + + + + + + + + + + + + + + +
-
-) + ) +} export default UnitTabsComponent -- cgit v1.2.3