@djb25/digit-ui-module-ekyc 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import Create from "./Create";
3
+
4
+ const Update = () => {
5
+ return (
6
+ <Create />
7
+ );
8
+ }
9
+ export default Update;
@@ -2,116 +2,81 @@ import { AppContainer, PrivateRoute, ModuleHeader, ArrowLeft, HomeIcon } from "@
2
2
  import React from "react";
3
3
  import { useTranslation } from "react-i18next";
4
4
  import { Switch, useLocation } from "react-router-dom";
5
+ import Dashboard from "./Dashboard";
5
6
  import Inbox from "./Inbox";
6
- //import Mapping from "./Mapping";
7
+ import Mapping from "./Mapping";
7
8
  import Create from "./Create";
8
- import AadhaarVerification from "./AadhaarVerification";
9
- import AddressDetails from "./AddressDetails";
10
- import PropertyInfo from "./PropertyInfo";
11
- import MeterDetails from "./MeterDetails";
9
+
12
10
  import Review from "./Review";
11
+ import EKYCForm from "./EKYCForm";
13
12
 
14
13
  const EmployeeApp = ({ path }) => {
15
- const { t } = useTranslation();
16
- const location = useLocation();
17
-
18
- sessionStorage.removeItem("revalidateddone");
14
+ const { t } = useTranslation();
15
+ const location = useLocation();
19
16
 
20
- const getBreadcrumbLabel = () => {
21
- const pathname = location.pathname;
22
- if (pathname.includes("/dashboard")) return "ES_COMMON_INBOX";
23
- if (pathname.includes("/create-kyc")) return "EKYC_CREATE_KYC";
24
- if (pathname.includes("/k-details")) return "EKYC_K_DETAILS";
25
- if (pathname.includes("/aadhaar-verification")) return "EKYC_AADHAAR_VERIFICATION";
26
- if (pathname.includes("/address-details")) return "EKYC_ADDRESS_DETAILS";
27
- if (pathname.includes("/property-info")) return "EKYC_PROPERTY_INFO";
28
- if (pathname.includes("/meter-details")) return "EKYC_METER_DETAILS";
29
- if (pathname.includes("/review")) return "EKYC_REVIEW";
30
- return "ES_COMMON_INBOX";
31
- };
17
+ sessionStorage.removeItem("revalidateddone");
32
18
 
33
- const breadcrumbs = [
34
- { icon: HomeIcon, path: "/digit-ui/employee" },
35
- { label: t(getBreadcrumbLabel()) }
36
- ];
19
+ const getBreadcrumbLabel = () => {
20
+ const pathname = location.pathname;
21
+ if (pathname.includes("/dashboard")) return "ES_COMMON_INBOX";
22
+ if (pathname.includes("/create-kyc")) return "EKYC_CREATE_KYC";
23
+ if (pathname.includes("/k-details")) return "EKYC_K_DETAILS";
24
+ if (pathname.includes("/consumer-details")) return "EKYC_CONSUMER_DETAILS";
25
+ if (pathname.includes("/address-details")) return "EKYC_ADDRESS_DETAILS";
26
+ if (pathname.includes("/property-info")) return "EKYC_PROPERTY_INFO";
27
+ if (pathname.includes("/meter-details")) return "EKYC_METER_DETAILS";
28
+ if (pathname.includes("/review")) return "EKYC_REVIEW";
29
+ return "ES_COMMON_INBOX";
30
+ };
37
31
 
38
- return (
39
- <AppContainer>
40
- <div className="ground-container employee-app-container employee-app-homepage-container">
41
- <ModuleHeader
42
- leftContent={
43
- <React.Fragment>
44
- <ArrowLeft className="icon" />
45
- Back
46
- </React.Fragment>
47
- }
48
- onLeftClick={() => window.history.back()}
49
- breadcrumbs={breadcrumbs}
50
- />
32
+ const breadcrumbs = [{ icon: HomeIcon, path: "/digit-ui/employee" }, { label: t(getBreadcrumbLabel()) }];
51
33
 
52
- <Switch>
53
- <PrivateRoute
54
- path={`${path}/dashboard`}
55
- component={() => (
56
- <Inbox
57
- parentRoute={path}
58
- businessService="EKYC"
59
- moduleCode="EKYC"
60
- isInbox={true}
61
- />
62
- )}
63
- />
34
+ const formStepRoutes = ["consumer-details", "address-details", "property-info", "meter-details"];
64
35
 
65
- <PrivateRoute
66
- path={`${path}/create-kyc`}
67
- component={() => <Create />}
68
- />
36
+ return (
37
+ <AppContainer>
38
+ <div className="ground-container employee-app-container form-container">
39
+ <ModuleHeader
40
+ leftContent={
41
+ <React.Fragment>
42
+ <ArrowLeft className="icon" />
43
+ Back
44
+ </React.Fragment>
45
+ }
46
+ onLeftClick={() => window.history.back()}
47
+ breadcrumbs={breadcrumbs}
48
+ />
69
49
 
70
- {/* <PrivateRoute
71
- path={`${path}/mapping`}
72
- component={() => <Mapping />}
73
- /> */}
50
+ <div className="employee-form">
51
+ <div className="employee-form-content">
52
+ <Switch>
53
+ <PrivateRoute
54
+ path={`${path}/dashboard`}
55
+ component={() => <Dashboard parentRoute={path} businessService="EKYC" moduleCode="EKYC" isInbox={true} />}
56
+ />
57
+ <PrivateRoute
58
+ path={`${path}/inbox`}
59
+ component={() => <Inbox parentRoute={path} businessService="EKYC" moduleCode="EKYC" isInbox={true} />}
60
+ />
74
61
 
75
- <PrivateRoute
76
- path={`${path}/aadhaar-verification`}
77
- component={() => <AadhaarVerification />}
78
- />
62
+ <PrivateRoute path={`${path}/create-kyc`} component={() => <Create />} />
79
63
 
80
- <PrivateRoute
81
- path={`${path}/address-details`}
82
- component={() => <AddressDetails />}
83
- />
64
+ <PrivateRoute path={`${path}/mapping`} component={() => <Mapping />} />
84
65
 
85
- <PrivateRoute
86
- path={`${path}/property-info`}
87
- component={() => <PropertyInfo />}
88
- />
66
+ <PrivateRoute path={formStepRoutes.map((route) => `${path}/${route}`)} component={(props) => <EKYCForm {...props} path={path} />} />
89
67
 
90
- <PrivateRoute
91
- path={`${path}/meter-details`}
92
- component={() => <MeterDetails />}
93
- />
94
-
95
- <PrivateRoute
96
- path={`${path}/review`}
97
- component={() => <Review />}
98
- />
68
+ <PrivateRoute path={`${path}/review`} component={() => <Review />} />
99
69
 
100
- <PrivateRoute
101
- path={`${path}/`}
102
- component={() => (
103
- <Inbox
104
- parentRoute={path}
105
- businessService="EKYC"
106
- moduleCode="EKYC"
107
- isInbox={true}
108
- />
109
- )}
110
- />
111
- </Switch>
112
- </div>
113
- </AppContainer>
114
- );
70
+ {/* <PrivateRoute
71
+ path={`${path}/`}
72
+ component={() => <Inbox parentRoute={path} businessService="EKYC" moduleCode="EKYC" isInbox={true} />}
73
+ /> */}
74
+ </Switch>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </AppContainer>
79
+ );
115
80
  };
116
81
 
117
82
  export default EmployeeApp;