This repository was archived by the owner on Mar 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -6,19 +6,31 @@ import {
66 ExpandableListItemType ,
77 IconButton ,
88} from 'practical-react-components-core'
9- import { HamburgerMenuIcon } from 'practical-react-components-icons'
9+ import {
10+ DownloadIcon ,
11+ HamburgerMenuIcon ,
12+ HomeIcon ,
13+ LogIcon ,
14+ } from 'practical-react-components-icons'
1015
1116import { Components , Component } from './types'
1217
1318const BASE_ITEMS = [
1419 {
1520 name : 'Home' ,
1621 route : '/' ,
22+ icon : HomeIcon ,
23+ } ,
24+ {
25+ name : 'Repository' ,
26+ route : 'https://github.com/AxisCommunications/practical-react-components' ,
27+ icon : DownloadIcon ,
1728 } ,
1829 {
1930 name : 'Changelog' ,
2031 route :
2132 'https://github.com/AxisCommunications/practical-react-components/blob/main/CHANGELOG.md' ,
33+ icon : LogIcon ,
2234 } ,
2335]
2436
@@ -83,7 +95,7 @@ export const Menu: React.FC<MenuProps> = ({ components }) => {
8395 [ ...BASE_ITEMS , ...components ] . map ( c => ( {
8496 id : c . name ,
8597 label : c . name ,
86- icon : ( ) => null ,
98+ icon : ( ) => c . icon ?? null ,
8799 selected : matchPath ( location . pathname , c . route ) !== null ,
88100 onClick : ( ) =>
89101 / ^ h t t p s ? : \/ \/ / . test ( c . route )
Original file line number Diff line number Diff line change 1+ import { IconType } from 'practical-react-components-core'
2+
13export interface Component {
24 readonly name : string
35 readonly route : string
46 readonly menu : string
7+ readonly icon ?: IconType
58 readonly component : React . FC
69}
710
You can’t perform that action at this time.
0 commit comments