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(-) 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