1
- import React , { useState , useEffect , Suspense , lazy } from "react" ;
1
+ import React , { useState , useEffect , lazy } from "react" ;
2
2
import { Routes , Route , BrowserRouter } from "react-router-dom" ;
3
3
import { pdfjs } from "react-pdf" ;
4
4
import Login from "./pages/Login" ;
@@ -9,12 +9,12 @@ import HomeLayout from "./layout/HomeLayout";
9
9
import PageNotFound from "./pages/PageNotFound" ;
10
10
import ValidateRoute from "./primitives/ValidateRoute" ;
11
11
import Validate from "./primitives/Validate" ;
12
- import ManageSign from "./pages/Managesign" ;
13
12
import TemplatePlaceholder from "./pages/TemplatePlaceholder" ;
14
13
import SignYourSelf from "./pages/SignyourselfPdf" ;
15
14
import DraftDocument from "./components/pdf/DraftDocument" ;
16
15
import PlaceHolderSign from "./pages/PlaceHolderSign" ;
17
16
import PdfRequestFiles from "./pages/PdfRequestFiles" ;
17
+ import LazyPage from "./primitives/LazyPage" ;
18
18
const DebugPdf = lazy ( ( ) => import ( "./pages/DebugPdf" ) ) ;
19
19
const ForgetPassword = lazy ( ( ) => import ( "./pages/ForgetPassword" ) ) ;
20
20
const GuestLogin = lazy ( ( ) => import ( "./pages/GuestLogin" ) ) ;
@@ -23,9 +23,10 @@ const Subscriptions = lazy(() => import("./pages/PlanSubscriptions"));
23
23
const ChangePassword = lazy ( ( ) => import ( "./pages/ChangePassword" ) ) ;
24
24
const UserProfile = lazy ( ( ) => import ( "./pages/UserProfile" ) ) ;
25
25
const Signup = lazy ( ( ) => import ( "./pages/Signup" ) ) ;
26
+ const Opensigndrive = lazy ( ( ) => import ( "./pages/Opensigndrive" ) ) ;
27
+ const ManageSign = lazy ( ( ) => import ( "./pages/Managesign" ) ) ;
26
28
const GenerateToken = lazy ( ( ) => import ( "./pages/GenerateToken" ) ) ;
27
29
const Webhook = lazy ( ( ) => import ( "./pages/Webhook" ) ) ;
28
- const Opensigndrive = lazy ( ( ) => import ( "./pages/Opensigndrive" ) ) ;
29
30
pdfjs . GlobalWorkerOptions . workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${ pdfjs . version } /pdf.worker.js` ;
30
31
31
32
const Loader = ( ) => {
@@ -78,83 +79,105 @@ function App() {
78
79
< Loader />
79
80
) : (
80
81
< BrowserRouter >
81
- < Suspense fallback = { < Loader /> } >
82
- < Routes >
83
- < Route element = { < ValidateRoute /> } >
84
- < Route exact path = "/" element = { < Login /> } />
85
- < Route exact path = "/signup" element = { < Signup /> } />
86
- </ Route >
87
- < Route element = { < Validate /> } >
88
- < Route
89
- path = "/load/template/:templateId"
90
- element = { < TemplatePlaceholder /> }
91
- />
92
- < Route
93
- exact
94
- path = "/load/placeholdersign/:docId"
95
- element = { < PlaceHolderSign /> }
96
- />
97
- < Route
98
- exact
99
- path = "/load/recipientSignPdf/:docId/:contactBookId"
100
- element = { < PdfRequestFiles /> }
101
- />
102
- </ Route >
82
+ < Routes >
83
+ < Route element = { < ValidateRoute /> } >
84
+ < Route exact path = "/" element = { < Login /> } />
85
+ < Route path = "/signup" element = { < LazyPage Page = { Signup } /> } />
86
+ </ Route >
87
+ < Route element = { < Validate /> } >
103
88
< Route
104
- path = "/loadmf/signmicroapp/login/:id/:userMail/:contactBookId/:serverUrl "
105
- element = { < GuestLogin /> }
89
+ path = "/load/template/:templateId "
90
+ element = { < TemplatePlaceholder /> }
106
91
/>
107
92
< Route
108
- path = "/login/:id/:userMail/:contactBookId/:serverUrl"
109
- element = { < GuestLogin /> }
93
+ exact
94
+ path = "/load/placeholdersign/:docId"
95
+ element = { < PlaceHolderSign /> }
110
96
/>
111
- < Route path = "/debugpdf" element = { < DebugPdf /> } />
112
- < Route path = "/forgetpassword" element = { < ForgetPassword /> } />
113
- { process . env . REACT_APP_ENABLE_SUBSCRIPTION && (
114
- < >
115
- < Route exact path = "/pgsignup" element = { < Pgsignup /> } />
116
- < Route path = "/subscription" element = { < Subscriptions /> } />
117
- </ >
118
- ) }
119
- < Route element = { < HomeLayout /> } >
120
- < Route path = "/changepassword" element = { < ChangePassword /> } />
121
- < Route path = "/form/:id" element = { < Form /> } />
122
- < Route path = "/report/:id" element = { < Report /> } />
123
- < Route path = "/dashboard/:id" element = { < Dashboard /> } />
124
- < Route path = "/profile" element = { < UserProfile /> } />
125
- < Route path = "/generatetoken" element = { < GenerateToken /> } />
126
- < Route path = "/webhook" element = { < Webhook /> } />
127
- < Route path = "/managesign" element = { < ManageSign /> } />
128
- < Route path = "/opensigndrive" element = { < Opensigndrive /> } />
129
- < Route
130
- path = "/template/:templateId"
131
- element = { < TemplatePlaceholder /> }
132
- />
133
- { /* signyouself route with no rowlevel data using docId from url */ }
134
- < Route path = "/signaturePdf/:docId" element = { < SignYourSelf /> } />
135
- { /* draft document route to handle and navigate route page accordiing to document status */ }
136
- < Route path = "/draftDocument" element = { < DraftDocument /> } />
137
- { /* recipient placeholder set route with no rowlevel data using docId from url*/ }
138
- < Route
139
- path = "/placeHolderSign/:docId"
140
- element = { < PlaceHolderSign /> }
141
- />
142
- { /* for user signature (need your sign route) with row level data */ }
143
- < Route path = "/pdfRequestFiles" element = { < PdfRequestFiles /> } />
144
- { /* for user signature (need your sign route) with no row level data */ }
97
+ < Route
98
+ exact
99
+ path = "/load/recipientSignPdf/:docId/:contactBookId"
100
+ element = { < PdfRequestFiles /> }
101
+ />
102
+ </ Route >
103
+ < Route
104
+ path = "/loadmf/signmicroapp/login/:id/:userMail/:contactBookId/:serverUrl"
105
+ element = { < LazyPage Page = { GuestLogin } /> }
106
+ />
107
+ < Route
108
+ path = "/login/:id/:userMail/:contactBookId/:serverUrl"
109
+ element = { < LazyPage Page = { GuestLogin } /> }
110
+ />
111
+ < Route path = "/debugpdf" element = { < LazyPage Page = { DebugPdf } /> } />
112
+ < Route
113
+ path = "/forgetpassword"
114
+ element = { < LazyPage Page = { ForgetPassword } /> }
115
+ />
116
+ { process . env . REACT_APP_ENABLE_SUBSCRIPTION && (
117
+ < >
145
118
< Route
146
- path = "/pdfRequestFiles/:docId "
147
- element = { < PdfRequestFiles /> }
119
+ path = "/pgsignup "
120
+ element = { < LazyPage Page = { Pgsignup } /> }
148
121
/>
149
- { /* recipient signature route with no rowlevel data using docId from url */ }
150
122
< Route
151
- path = "/recipientSignPdf/:docId/:contactBookId "
152
- element = { < PdfRequestFiles /> }
123
+ path = "/subscription "
124
+ element = { < LazyPage Page = { Subscriptions } /> }
153
125
/>
154
- </ Route >
155
- < Route path = "*" element = { < PageNotFound /> } />
156
- </ Routes >
157
- </ Suspense >
126
+ </ >
127
+ ) }
128
+ < Route element = { < HomeLayout /> } >
129
+ < Route
130
+ path = "/changepassword"
131
+ element = { < LazyPage Page = { ChangePassword } /> }
132
+ />
133
+ < Route path = "/form/:id" element = { < Form /> } />
134
+ < Route path = "/report/:id" element = { < Report /> } />
135
+ < Route path = "/dashboard/:id" element = { < Dashboard /> } />
136
+ < Route
137
+ path = "/profile"
138
+ element = { < LazyPage Page = { UserProfile } /> }
139
+ />
140
+ < Route
141
+ path = "/opensigndrive"
142
+ element = { < LazyPage Page = { Opensigndrive } /> }
143
+ />
144
+ < Route
145
+ path = "/managesign"
146
+ element = { < LazyPage Page = { ManageSign } /> }
147
+ />
148
+ < Route
149
+ path = "/generatetoken"
150
+ element = { < LazyPage Page = { GenerateToken } /> }
151
+ />
152
+ < Route path = "/webhook" element = { < LazyPage Page = { Webhook } /> } />
153
+ < Route
154
+ path = "/template/:templateId"
155
+ element = { < TemplatePlaceholder /> }
156
+ />
157
+ { /* signyouself route with no rowlevel data using docId from url */ }
158
+ < Route path = "/signaturePdf/:docId" element = { < SignYourSelf /> } />
159
+ { /* draft document route to handle and navigate route page accordiing to document status */ }
160
+ < Route path = "/draftDocument" element = { < DraftDocument /> } />
161
+ { /* recipient placeholder set route with no rowlevel data using docId from url*/ }
162
+ < Route
163
+ path = "/placeHolderSign/:docId"
164
+ element = { < PlaceHolderSign /> }
165
+ />
166
+ { /* for user signature (need your sign route) with row level data */ }
167
+ < Route path = "/pdfRequestFiles" element = { < PdfRequestFiles /> } />
168
+ { /* for user signature (need your sign route) with no row level data */ }
169
+ < Route
170
+ path = "/pdfRequestFiles/:docId"
171
+ element = { < PdfRequestFiles /> }
172
+ />
173
+ { /* recipient signature route with no rowlevel data using docId from url */ }
174
+ < Route
175
+ path = "/recipientSignPdf/:docId/:contactBookId"
176
+ element = { < PdfRequestFiles /> }
177
+ />
178
+ </ Route >
179
+ < Route path = "*" element = { < PageNotFound /> } />
180
+ </ Routes >
158
181
</ BrowserRouter >
159
182
) }
160
183
</ div >
0 commit comments