File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Copyright © 2022 Kaleido, Inc.
2+ //
3+ // SPDX-License-Identifier: Apache-2.0
4+ //
5+ // Licensed under the Apache License, Version 2.0 (the "License");
6+ // you may not use this file except in compliance with the License.
7+ // You may obtain a copy of the License at
8+ //
9+ // http://www.apache.org/licenses/LICENSE-2.0
10+ //
11+ // Unless required by applicable law or agreed to in writing, software
12+ // distributed under the License is distributed on an "AS IS" BASIS,
13+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ // See the License for the specific language governing permissions and
15+ // limitations under the License.
16+
117import { InsertChartOutlined } from '@mui/icons-material' ;
218import React , { useContext } from 'react' ;
319import { useTranslation } from 'react-i18next' ;
Original file line number Diff line number Diff line change @@ -29,8 +29,6 @@ interface Props {
2929 icon ?: JSX . Element ;
3030 rightIcon ?: JSX . Element ;
3131 isRoot ?: boolean ;
32-
33- // NEW:
3432 to ?: string ; // internal route (React Router)
3533 href ?: string ; // external link
3634 action ?: ( ) => void ; // fallback click handler (legacy)
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import MenuBookIcon from '@mui/icons-material/MenuBook';
44import { Drawer , List } from '@mui/material' ;
55import { default as React , useContext } from 'react' ;
66import { useTranslation } from 'react-i18next' ;
7- import { useLocation , useNavigate } from 'react-router-dom' ;
7+ import { useLocation } from 'react-router-dom' ;
88import { ApplicationContext } from '../../contexts/ApplicationContext' ;
99import { FF_NAV_PATHS } from '../../interfaces' ;
1010import { MenuLogo } from '../MenuLogo' ;
@@ -23,7 +23,6 @@ export const Navigation: React.FC = () => {
2323 const { selectedNamespace } = useContext ( ApplicationContext ) ;
2424 const { t } = useTranslation ( ) ;
2525 const { pathname } = useLocation ( ) ;
26- const navigate = useNavigate ( ) ;
2726
2827 const makeDrawerContents = (
2928 < >
Original file line number Diff line number Diff line change @@ -21,11 +21,12 @@ export interface INavItem {
2121 itemIsActive : boolean ;
2222 icon ?: JSX . Element ;
2323
24- // NEW optional props for link-style behavior
24+ // Preferred props for link/navigation behavior
2525 to ?: string ; // internal React Router path
2626 href ?: string ; // external URL
2727
28- // fallback for legacy click handlers
28+ // DEPRECATED: legacy click handler (prefer `to` or `href`)
29+ /** @deprecated use `to` or `href` instead */
2930 action ?: ( ) => void ;
3031}
3132
You can’t perform that action at this time.
0 commit comments