@visns-studio/visns-components 3.2.8 → 3.3.1
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.
|
@@ -18,8 +18,6 @@ import Login from '../auth/Login';
|
|
|
18
18
|
import Reset from '../auth/Reset';
|
|
19
19
|
import Verify from '../auth/Verify';
|
|
20
20
|
|
|
21
|
-
// import Main from '../../../../../../resources/js/main';
|
|
22
|
-
|
|
23
21
|
const ProtectedRoute = ({ user, loading, redirectPath = '/login' }) => {
|
|
24
22
|
return loading ? null : !user.id ? (
|
|
25
23
|
<Navigate to={redirectPath} replace />
|
|
@@ -28,7 +26,13 @@ const ProtectedRoute = ({ user, loading, redirectPath = '/login' }) => {
|
|
|
28
26
|
);
|
|
29
27
|
};
|
|
30
28
|
|
|
31
|
-
const GenericAuth = ({
|
|
29
|
+
const GenericAuth = ({
|
|
30
|
+
logo,
|
|
31
|
+
headerLogo,
|
|
32
|
+
providers,
|
|
33
|
+
navigation,
|
|
34
|
+
routeConfig,
|
|
35
|
+
}) => {
|
|
32
36
|
const navigate = useNavigate();
|
|
33
37
|
const location = useLocation();
|
|
34
38
|
const [userProfile, setUserProfile] = useState({});
|
|
@@ -66,6 +70,7 @@ const GenericAuth = ({ logo, navigation, routeConfig }) => {
|
|
|
66
70
|
element={
|
|
67
71
|
<LoginComponent
|
|
68
72
|
logo={logo}
|
|
73
|
+
providers={providers}
|
|
69
74
|
setIsAuthenticated={setIsAuthenticated}
|
|
70
75
|
setUserProfile={setUserProfile}
|
|
71
76
|
/>
|
|
@@ -101,7 +106,7 @@ const GenericAuth = ({ logo, navigation, routeConfig }) => {
|
|
|
101
106
|
path="/*"
|
|
102
107
|
element={
|
|
103
108
|
<GenericMain
|
|
104
|
-
logo={
|
|
109
|
+
logo={headerLogo}
|
|
105
110
|
navigation={navigation}
|
|
106
111
|
routeConfig={routeConfig}
|
|
107
112
|
setUserProfile={setUserProfile}
|
|
@@ -123,10 +128,10 @@ const GenericAuth = ({ logo, navigation, routeConfig }) => {
|
|
|
123
128
|
};
|
|
124
129
|
|
|
125
130
|
const LoginComponent = React.memo(
|
|
126
|
-
({ logo, setIsAuthenticated, setUserProfile }) => (
|
|
131
|
+
({ logo, providers, setIsAuthenticated, setUserProfile }) => (
|
|
127
132
|
<Login
|
|
128
133
|
logo={logo}
|
|
129
|
-
providers={
|
|
134
|
+
providers={providers}
|
|
130
135
|
setSystemAuth={setIsAuthenticated}
|
|
131
136
|
setUserProfile={setUserProfile}
|
|
132
137
|
/>
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Routes, Route } from 'react-router-dom';
|
|
3
|
-
|
|
2
|
+
import { Routes, Route, Navigate } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
import Call from '../Call';
|
|
5
|
+
import Loader from '../Loader';
|
|
6
|
+
import Navigation from '../Navigation';
|
|
4
7
|
|
|
5
8
|
const GenericMain = ({
|
|
6
9
|
logo,
|
|
@@ -52,7 +55,14 @@ const GenericMain = ({
|
|
|
52
55
|
<main className="content">
|
|
53
56
|
<div className="content-main" id="app">
|
|
54
57
|
<div className="padding">
|
|
55
|
-
<Routes>
|
|
58
|
+
<Routes>
|
|
59
|
+
{renderRoutes(routeConfig)}
|
|
60
|
+
{/* Add a wildcard route for handling unknown paths */}
|
|
61
|
+
<Route
|
|
62
|
+
path="*"
|
|
63
|
+
element={<Navigate to="/" replace />}
|
|
64
|
+
/>
|
|
65
|
+
</Routes>
|
|
56
66
|
</div>
|
|
57
67
|
<Call incomingCallData={incomingCallData} />
|
|
58
68
|
<Loader />
|
package/package.json
CHANGED