@visns-studio/visns-components 3.2.5 → 3.2.7

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.
@@ -17,8 +17,7 @@ import Login from '../auth/Login';
17
17
  import Reset from '../auth/Reset';
18
18
  import Verify from '../auth/Verify';
19
19
 
20
- import Main from './main';
21
- import logo from '../images/logo.svg';
20
+ // import Main from '../../../../../../resources/js/main';
22
21
 
23
22
  const ProtectedRoute = ({ user, loading, redirectPath = '/login' }) => {
24
23
  return loading ? null : !user.id ? (
@@ -28,7 +27,7 @@ const ProtectedRoute = ({ user, loading, redirectPath = '/login' }) => {
28
27
  );
29
28
  };
30
29
 
31
- const Auth = () => {
30
+ const GenericAuth = ({ logo, Main }) => {
32
31
  const navigate = useNavigate();
33
32
  const location = useLocation();
34
33
  const [userProfile, setUserProfile] = useState({});
@@ -65,6 +64,7 @@ const Auth = () => {
65
64
  path="login"
66
65
  element={
67
66
  <LoginComponent
67
+ logo={logo}
68
68
  setIsAuthenticated={setIsAuthenticated}
69
69
  setUserProfile={setUserProfile}
70
70
  />
@@ -74,6 +74,7 @@ const Auth = () => {
74
74
  path="reset"
75
75
  element={
76
76
  <ResetComponent
77
+ logo={logo}
77
78
  setIsAuthenticated={setIsAuthenticated}
78
79
  />
79
80
  }
@@ -82,6 +83,7 @@ const Auth = () => {
82
83
  path="verify/:code"
83
84
  element={
84
85
  <VerifyComponent
86
+ logo={logo}
85
87
  setIsAuthenticated={setIsAuthenticated}
86
88
  />
87
89
  }
@@ -97,7 +99,7 @@ const Auth = () => {
97
99
  <Route
98
100
  path="/*"
99
101
  element={
100
- <MainComponent
102
+ <Main
101
103
  checkAuthStatus={updateAuthStatus}
102
104
  setUserProfile={setUserProfile}
103
105
  userProfile={userProfile}
@@ -112,39 +114,28 @@ const Auth = () => {
112
114
  position="bottom-center"
113
115
  style={{ width: '600px' }}
114
116
  />
117
+ <Tooltip id="system-tooltip" />
115
118
  </>
116
119
  );
117
120
  };
118
121
 
119
- const LoginComponent = React.memo(({ setIsAuthenticated, setUserProfile }) => (
120
- <Login
121
- logo={logo}
122
- providers={['azure']}
123
- setSystemAuth={setIsAuthenticated}
124
- setUserProfile={setUserProfile}
125
- />
126
- ));
122
+ const LoginComponent = React.memo(
123
+ ({ logo, setIsAuthenticated, setUserProfile }) => (
124
+ <Login
125
+ logo={logo}
126
+ providers={['azure']}
127
+ setSystemAuth={setIsAuthenticated}
128
+ setUserProfile={setUserProfile}
129
+ />
130
+ )
131
+ );
127
132
 
128
- const ResetComponent = React.memo(({ setIsAuthenticated }) => (
133
+ const ResetComponent = React.memo(({ logo, setIsAuthenticated }) => (
129
134
  <Reset logo={logo} setSystemAuth={setIsAuthenticated} />
130
135
  ));
131
136
 
132
- const VerifyComponent = React.memo(({ setIsAuthenticated }) => (
137
+ const VerifyComponent = React.memo(({ logo, setIsAuthenticated }) => (
133
138
  <Verify logo={logo} setSystemAuth={setIsAuthenticated} />
134
139
  ));
135
140
 
136
- const MainComponent = React.memo(
137
- ({ checkAuthStatus, setUserProfile, userProfile, setSystemAuth }) => (
138
- <>
139
- <Main
140
- checkAuthStatus={checkAuthStatus}
141
- setSystemAuth={setSystemAuth}
142
- userProfile={userProfile}
143
- setUserProfile={setUserProfile}
144
- />
145
- <Tooltip id="system-tooltip" />
146
- </>
147
- )
148
- );
149
-
150
- export default Auth;
141
+ export default GenericAuth;
package/package.json CHANGED
@@ -49,7 +49,7 @@
49
49
  "react-dom": "^17.0.1"
50
50
  },
51
51
  "name": "@visns-studio/visns-components",
52
- "version": "3.2.5",
52
+ "version": "3.2.7",
53
53
  "description": "Various packages to assist in the development of our Custom Applications.",
54
54
  "main": "index.js",
55
55
  "scripts": {