From 1197fc37cfa3938f2a39ea5d906f0075b5721ff0 Mon Sep 17 00:00:00 2001 From: miaawong Date: Mon, 14 Oct 2024 15:24:26 -0400 Subject: [PATCH] fix lint --- web/src/Root.tsx | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/web/src/Root.tsx b/web/src/Root.tsx index 63c45cf434..209d15f2d2 100644 --- a/web/src/Root.tsx +++ b/web/src/Root.tsx @@ -1,10 +1,4 @@ -import React, { - createContext, - useEffect, - useMemo, - useReducer, - useState, -} from "react"; +import React, { createContext, useEffect, useReducer, useState } from "react"; import { createBrowserHistory } from "history"; import { Navigate, Route, Routes, useNavigate } from "react-router-dom"; import { Helmet } from "react-helmet"; @@ -84,6 +78,15 @@ const ThemeContext = createContext({ clearThemeState: () => {}, }); +type NavbarConfigGroup = { + name: string; + title: string; + items: string[]; + hidden: boolean; + hasError: boolean; + when: string; +}; + type AppBranding = { css?: string[]; fontFaces?: string[]; @@ -462,8 +465,10 @@ const Root = () => { const navigate = useNavigate(); const [currentStep, setCurrentStep] = useState(0); - const [navbarConfigGroups, setNavbarConfigGroups] = useState([]); - const [activeGroups, setActiveGroups] = useState([]); + const [navbarConfigGroups, setNavbarConfigGroups] = useState< + NavbarConfigGroup[] + >([]); + const [activeGroups, setActiveGroups] = useState([]); const getStepProps = (step: number) => { if (step < currentStep) { @@ -498,7 +503,15 @@ const Root = () => { }; const NavGroup = React.memo( - ({ group, isActive, i }: { group: any; isActive: boolean; i: number }) => { + ({ + group, + isActive, + i, + }: { + group: NavbarConfigGroup; + isActive: boolean; + i: number; + }) => { return (