From eb7d429ec8a1a5c781569af47db56394215edd8f Mon Sep 17 00:00:00 2001 From: Claire Dagan Date: Thu, 19 Sep 2024 11:32:55 +0200 Subject: [PATCH] [Tech] add NavBar Props --- frontend/src/components/NavBar.tsx | 10 ++++++++-- .../features/Dashboard/components/DashboardsNavBar.tsx | 2 +- frontend/src/features/missions/MissionsNavBar.tsx | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/NavBar.tsx b/frontend/src/components/NavBar.tsx index 9455a6f21..8e941dda9 100644 --- a/frontend/src/components/NavBar.tsx +++ b/frontend/src/components/NavBar.tsx @@ -3,14 +3,20 @@ import { Accent, Icon, IconButton } from '@mtes-mct/monitor-ui' import ResponsiveNav from '@rsuite/responsive-nav' import styled from 'styled-components' -export function NavBar({ children, onClose, onSelect }) { +type NavBarProps = { + children: React.ReactNode[] + name: string + onClose: (eventKey: string | number | undefined) => void + onSelect: (eventKey: string | number | undefined) => void +} +export function NavBar({ children, name, onClose, onSelect }: NavBarProps) { const currentPath = useAppSelector(state => state.sideWindow.currentPath) return ( } onItemRemove={onClose} diff --git a/frontend/src/features/Dashboard/components/DashboardsNavBar.tsx b/frontend/src/features/Dashboard/components/DashboardsNavBar.tsx index 9453626b2..edf1418ce 100644 --- a/frontend/src/features/Dashboard/components/DashboardsNavBar.tsx +++ b/frontend/src/features/Dashboard/components/DashboardsNavBar.tsx @@ -28,7 +28,7 @@ export function DashboardsNavBar() { const closeDashboard = () => {} return ( - + {tabs.map((item, index) => ( + {tabs.map((item, index) => ( {item.label}