1
- import { useState } from "react" ;
2
- import { Menu , Dropdown , Button , Image , Grid } from "antd" ;
3
- import { useSpring , animated } from "react-spring" ;
4
- import { useLocation , Link } from "react-router-dom" ;
5
1
import {
2
+ BookOutlined ,
3
+ CaretDownFilled ,
6
4
GithubOutlined ,
5
+ InfoOutlined ,
7
6
QuestionOutlined ,
8
7
UserOutlined ,
9
- InfoOutlined ,
10
- BookOutlined ,
11
- CaretDownFilled ,
12
8
} from "@ant-design/icons" ;
9
+ import type { MenuProps } from "antd" ;
10
+ import { Button , Dropdown , Grid , Image } from "antd" ;
11
+ import { useState } from "react" ;
12
+ import { Link , useLocation } from "react-router-dom" ;
13
+ import { animated , useSpring } from "react-spring" ;
13
14
import ToggleDarkMode from "./ToggleDarkMode" ;
14
15
15
16
const { useBreakpoint } = Grid ;
@@ -31,50 +32,70 @@ function Navbar({ scrollToFooter }: { scrollToFooter: any }) {
31
32
config : { duration : 1000 } ,
32
33
} ) ;
33
34
34
- const helpMenu = (
35
- < Menu >
36
- < Menu . ItemGroup title = "Info" >
37
- < Menu . Item key = "about" >
38
- < a
39
- href = "https://github.com/accordproject/template-playground/blob/main/README.md"
40
- target = "_blank"
41
- rel = "noopener noreferrer"
42
- >
43
- < QuestionOutlined /> About
44
- </ a >
45
- </ Menu . Item >
46
- < Menu . Item key = "community" >
47
- < a
48
- href = "https://discord.com/invite/Zm99SKhhtA"
49
- target = "_blank"
50
- rel = "noopener noreferrer"
51
- >
52
- < UserOutlined /> Community
53
- </ a >
54
- </ Menu . Item >
55
- < Menu . Item key = "issues" >
56
- < a
57
- href = "https://github.com/accordproject/template-playground/issues"
58
- target = "_blank"
59
- rel = "noopener noreferrer"
60
- >
61
- < InfoOutlined /> Issues
62
- </ a >
63
- </ Menu . Item >
64
- </ Menu . ItemGroup >
65
- < Menu . ItemGroup title = "Documentation" >
66
- < Menu . Item key = "documentation" >
67
- < a
68
- href = "https://github.com/accordproject/template-engine/blob/main/README.md"
69
- target = "_blank"
70
- rel = "noopener noreferrer"
71
- >
72
- < BookOutlined /> Documentation
73
- </ a >
74
- </ Menu . Item >
75
- </ Menu . ItemGroup >
76
- </ Menu >
77
- ) ;
35
+ const helpMenu : MenuProps [ "items" ] = [
36
+ {
37
+ key : "info" ,
38
+ type : "group" ,
39
+ label : "Info" ,
40
+ children : [
41
+ {
42
+ key : "about" ,
43
+ label : (
44
+ < a
45
+ href = "https://github.com/accordproject/template-playground/blob/main/README.md"
46
+ target = "_blank"
47
+ rel = "noopener noreferrer"
48
+ >
49
+ < QuestionOutlined /> About
50
+ </ a >
51
+ ) ,
52
+ } ,
53
+ {
54
+ key : "community" ,
55
+ label : (
56
+ < a
57
+ href = "https://discord.com/invite/Zm99SKhhtA"
58
+ target = "_blank"
59
+ rel = "noopener noreferrer"
60
+ >
61
+ < UserOutlined /> Community
62
+ </ a >
63
+ ) ,
64
+ } ,
65
+ {
66
+ key : "issues" ,
67
+ label : (
68
+ < a
69
+ href = "https://github.com/accordproject/template-playground/issues"
70
+ target = "_blank"
71
+ rel = "noopener noreferrer"
72
+ >
73
+ < InfoOutlined /> Issues
74
+ </ a >
75
+ ) ,
76
+ } ,
77
+ ] ,
78
+ } ,
79
+ {
80
+ key : "documentation" ,
81
+ type : "group" ,
82
+ label : "Documentation" ,
83
+ children : [
84
+ {
85
+ key : "documentation" ,
86
+ label : (
87
+ < a
88
+ href = "https://github.com/accordproject/template-engine/blob/main/README.md"
89
+ target = "_blank"
90
+ rel = "noopener noreferrer"
91
+ >
92
+ < BookOutlined /> Documentation
93
+ </ a >
94
+ ) ,
95
+ } ,
96
+ ] ,
97
+ } ,
98
+ ] ;
78
99
79
100
const menuItemStyle = ( key : string , isLast : boolean ) => ( {
80
101
display : "flex" ,
@@ -148,7 +169,7 @@ function Navbar({ scrollToFooter }: { scrollToFooter: any }) {
148
169
onMouseEnter = { ( ) => setHovered ( "help" ) }
149
170
onMouseLeave = { ( ) => setHovered ( null ) }
150
171
>
151
- < Dropdown overlay = { helpMenu } trigger = { [ "click" ] } >
172
+ < Dropdown menu = { { items : helpMenu } } trigger = { [ "click" ] } >
152
173
< Button
153
174
style = { {
154
175
background : "transparent" ,
@@ -254,4 +275,4 @@ function Navbar({ scrollToFooter }: { scrollToFooter: any }) {
254
275
) ;
255
276
}
256
277
257
- export default Navbar ;
278
+ export default Navbar ;
0 commit comments