From 2ff09498b33c7b2e0d8318cc85e09da5025e0024 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 22 Jul 2023 23:01:10 -0500 Subject: track active tab --- src/web/src/components/System/Files/index.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/System/Files/index.js b/src/web/src/components/System/Files/index.js index b5ab465b..07e91a96 100644 --- a/src/web/src/components/System/Files/index.js +++ b/src/web/src/components/System/Files/index.js @@ -1,26 +1,34 @@ -import React from 'react'; +import React, { useState } from 'react'; import { Tab } from 'semantic-ui-react'; +import './Files.css'; import Explorer from './Explorer'; const Files = () => { + const [tab, setTab] = useState('downloads'); + const panes = [ { route: 'downloads', menuItem: 'Downloads', - render: () => , + render: () => , }, { route: 'incomplete', menuItem: 'Incomplete', - render: () => , + render: () => , }, ]; + const onTabChange = (e, { activeIndex }) => { + setTab(panes[activeIndex].route); + }; + return (
); -- cgit v1.2.3