@djb25/digit-ui-module-ekyc 1.0.7 → 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,103 +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";
7
+ import Mapping from "./Mapping";
6
8
  import Create from "./Create";
7
- import AadhaarVerification from "./AadhaarVerification";
8
- import AddressDetails from "./AddressDetails";
9
- import PropertyInfo from "./PropertyInfo";
9
+
10
10
  import Review from "./Review";
11
+ import EKYCForm from "./EKYCForm";
11
12
 
12
13
  const EmployeeApp = ({ path }) => {
13
- const { t } = useTranslation();
14
- const location = useLocation();
14
+ const { t } = useTranslation();
15
+ const location = useLocation();
16
+
17
+ sessionStorage.removeItem("revalidateddone");
15
18
 
16
- sessionStorage.removeItem("revalidateddone");
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
+ };
17
31
 
18
- const getBreadcrumbLabel = () => {
19
- const pathname = location.pathname;
20
- if (pathname.includes("/dashboard")) return "ES_COMMON_INBOX";
21
- if (pathname.includes("/create-kyc")) return "EKYC_CREATE_KYC";
22
- if (pathname.includes("/k-details")) return "EKYC_K_DETAILS";
23
- if (pathname.includes("/aadhaar-verification")) return "EKYC_AADHAAR_VERIFICATION";
24
- if (pathname.includes("/address-details")) return "EKYC_ADDRESS_DETAILS";
25
- if (pathname.includes("/property-info")) return "EKYC_PROPERTY_INFO";
26
- if (pathname.includes("/review")) return "EKYC_REVIEW";
27
- return "ES_COMMON_INBOX";
28
- };
32
+ const breadcrumbs = [{ icon: HomeIcon, path: "/digit-ui/employee" }, { label: t(getBreadcrumbLabel()) }];
29
33
 
30
- const breadcrumbs = [
31
- { icon: HomeIcon, path: "/digit-ui/employee" },
32
- { label: t(getBreadcrumbLabel()) }
33
- ];
34
+ const formStepRoutes = ["consumer-details", "address-details", "property-info", "meter-details"];
34
35
 
35
- return (
36
- <AppContainer>
37
- <div className="ground-container employee-app-container">
38
- <ModuleHeader
39
- leftContent={
40
- <React.Fragment>
41
- <ArrowLeft className="icon" />
42
- Back
43
- </React.Fragment>
44
- }
45
- onLeftClick={() => window.history.back()}
46
- breadcrumbs={breadcrumbs}
47
- />
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
+ />
48
49
 
49
- <Switch>
50
- <PrivateRoute
51
- path={`${path}/dashboard`}
52
- component={() => (
53
- <Inbox
54
- parentRoute={path}
55
- businessService="EKYC"
56
- moduleCode="EKYC"
57
- isInbox={true}
58
- />
59
- )}
60
- />
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
+ />
61
61
 
62
- <PrivateRoute
63
- path={`${path}/create-kyc`}
64
- component={() => <Create />}
65
- />
62
+ <PrivateRoute path={`${path}/create-kyc`} component={() => <Create />} />
66
63
 
67
- <PrivateRoute
68
- path={`${path}/aadhaar-verification`}
69
- component={() => <AadhaarVerification />}
70
- />
64
+ <PrivateRoute path={`${path}/mapping`} component={() => <Mapping />} />
71
65
 
72
- <PrivateRoute
73
- path={`${path}/address-details`}
74
- component={() => <AddressDetails />}
75
- />
66
+ <PrivateRoute path={formStepRoutes.map((route) => `${path}/${route}`)} component={(props) => <EKYCForm {...props} path={path} />} />
76
67
 
77
- <PrivateRoute
78
- path={`${path}/property-info`}
79
- component={() => <PropertyInfo />}
80
- />
81
-
82
- <PrivateRoute
83
- path={`${path}/review`}
84
- component={() => <Review />}
85
- />
68
+ <PrivateRoute path={`${path}/review`} component={() => <Review />} />
86
69
 
87
- <PrivateRoute
88
- path={`${path}/`}
89
- component={() => (
90
- <Inbox
91
- parentRoute={path}
92
- businessService="EKYC"
93
- moduleCode="EKYC"
94
- isInbox={true}
95
- />
96
- )}
97
- />
98
- </Switch>
99
- </div>
100
- </AppContainer>
101
- );
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
+ );
102
80
  };
103
81
 
104
82
  export default EmployeeApp;