1
- import React from "react" ;
2
- import { Switch , Route } from "react-router-dom" ;
3
- import { Link } from "react-router-dom" ;
4
- import { Layout , Menu , Icon } from "antd" ;
1
+ import React from "react"
2
+ import { Switch , Route } from "react-router-dom"
3
+ import { Link } from "react-router-dom"
4
+ import { Layout , Menu , Icon } from "antd"
5
5
6
- import logo from "./static/listmonk.svg" ;
6
+ import logo from "./static/listmonk.svg"
7
7
8
8
// Views.
9
- import Dashboard from "./Dashboard" ;
10
- import Lists from "./Lists" ;
11
- import Subscribers from "./Subscribers" ;
12
- import Subscriber from "./Subscriber" ;
13
- import Templates from "./Templates" ;
14
- import Import from "./Import" ;
15
- import Campaigns from "./Campaigns" ;
16
- import Campaign from "./Campaign" ;
17
- import Media from "./Media" ;
9
+ import Dashboard from "./Dashboard"
10
+ import Lists from "./Lists"
11
+ import Forms from "./Forms"
12
+ import Subscribers from "./Subscribers"
13
+ import Subscriber from "./Subscriber"
14
+ import Templates from "./Templates"
15
+ import Import from "./Import"
16
+ import Campaigns from "./Campaigns"
17
+ import Campaign from "./Campaign"
18
+ import Media from "./Media"
18
19
19
- const { Content, Footer, Sider } = Layout ;
20
- const SubMenu = Menu . SubMenu ;
21
- const year = new Date ( ) . getUTCFullYear ( ) ;
20
+ const { Content, Footer, Sider } = Layout
21
+ const SubMenu = Menu . SubMenu
22
+ const year = new Date ( ) . getUTCFullYear ( )
22
23
23
24
class Base extends React . Component {
24
25
state = {
25
26
basePath : "/" + window . location . pathname . split ( "/" ) [ 1 ] ,
26
27
error : null ,
27
28
collapsed : false
28
- } ;
29
+ }
29
30
30
31
onCollapse = collapsed => {
31
- this . setState ( { collapsed } ) ;
32
- } ;
32
+ this . setState ( { collapsed } )
33
+ }
33
34
34
35
componentDidMount ( ) {
35
36
// For small screen devices collapse the menu by default.
36
37
if ( window . screen . width < 768 ) {
37
- this . setState ( { collapsed : true } ) ;
38
+ this . setState ( { collapsed : true } )
38
39
}
39
- } ;
40
+ }
40
41
41
42
render ( ) {
42
43
return (
@@ -65,12 +66,28 @@ class Base extends React.Component {
65
66
< span > Dashboard</ span >
66
67
</ Link >
67
68
</ Menu . Item >
68
- < Menu . Item key = "/lists" >
69
- < Link to = "/lists" >
70
- < Icon type = "bars" />
71
- < span > Lists</ span >
72
- </ Link >
73
- </ Menu . Item >
69
+ < SubMenu
70
+ key = "/lists"
71
+ title = {
72
+ < span >
73
+ < Icon type = "bars" />
74
+ < span > Lists</ span >
75
+ </ span >
76
+ }
77
+ >
78
+ < Menu . Item key = "/lists" >
79
+ < Link to = "/lists" >
80
+ < Icon type = "bars" />
81
+ < span > All lists</ span >
82
+ </ Link >
83
+ </ Menu . Item >
84
+ < Menu . Item key = "/lists/forms" >
85
+ < Link to = "/lists/forms" >
86
+ < Icon type = "form" />
87
+ < span > Forms</ span >
88
+ </ Link >
89
+ </ Menu . Item >
90
+ </ SubMenu >
74
91
< SubMenu
75
92
key = "/subscribers"
76
93
title = {
@@ -146,6 +163,14 @@ class Base extends React.Component {
146
163
< Lists { ...{ ...this . props , route : props } } />
147
164
) }
148
165
/>
166
+ < Route
167
+ exact
168
+ key = "/lists/forms"
169
+ path = "/lists/forms"
170
+ render = { props => (
171
+ < Forms { ...{ ...this . props , route : props } } />
172
+ ) }
173
+ />
149
174
< Route
150
175
exact
151
176
key = "/subscribers"
@@ -230,8 +255,8 @@ class Base extends React.Component {
230
255
>
231
256
listmonk
232
257
</ a > { " " }
233
- © 2019 { year !== 2019 ? " - " + year : "" } .
234
- Version { process . env . REACT_APP_VERSION } —{ " " }
258
+ © 2019 { year !== 2019 ? " - " + year : "" } . Version { " " }
259
+ { process . env . REACT_APP_VERSION } —{ " " }
235
260
< a
236
261
href = "https://listmonk.app/docs"
237
262
target = "_blank"
@@ -243,8 +268,8 @@ class Base extends React.Component {
243
268
</ Footer >
244
269
</ Layout >
245
270
</ Layout >
246
- ) ;
271
+ )
247
272
}
248
273
}
249
274
250
- export default Base ;
275
+ export default Base
0 commit comments