@campxdev/shared 0.6.2 → 0.6.4
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/shared",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"main": "./exports.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "react-scripts start",
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
"eject": "react-scripts eject",
|
|
10
10
|
"lint": "eslint ./src/**/*.{js,jsx,ts,tsx,json}",
|
|
11
11
|
"lint:fix": "eslint --fix \"./src/**/*.{js,jsx,ts,tsx,json}\"",
|
|
12
|
-
"format": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,css,md,json}\" --config ./.prettierrc"
|
|
13
|
-
"publish": "./publish.sh"
|
|
12
|
+
"format": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,css,md,json}\" --config ./.prettierrc"
|
|
14
13
|
},
|
|
15
14
|
"browserslist": {
|
|
16
15
|
"production": [
|
|
@@ -24,7 +24,9 @@ export default function Providers({ children }: { children: ReactNode }) {
|
|
|
24
24
|
<MuiThemeProvider>
|
|
25
25
|
<DialogProvider>
|
|
26
26
|
<LoginFormProvider>
|
|
27
|
-
<ConfirmContextProvider>
|
|
27
|
+
<ConfirmContextProvider>
|
|
28
|
+
{isInvalid ? <InvalidClientKey /> : children}
|
|
29
|
+
</ConfirmContextProvider>
|
|
28
30
|
<CssBaseline />
|
|
29
31
|
</LoginFormProvider>
|
|
30
32
|
<ToastContainer />
|
|
@@ -49,7 +51,7 @@ const InvalidClientKey = () => {
|
|
|
49
51
|
<h1>Invalid Tenant Key</h1>
|
|
50
52
|
{!isDevelopment && (
|
|
51
53
|
<a href="https://id.campx.in">
|
|
52
|
-
<p>Login to continue</p>
|
|
54
|
+
<p style={{ textDecoration: 'underline' }}>Login to continue</p>
|
|
53
55
|
</a>
|
|
54
56
|
)}
|
|
55
57
|
</div>
|
package/src/hooks/useAppInit.ts
CHANGED
|
@@ -10,15 +10,15 @@ export default function useAppInit() {
|
|
|
10
10
|
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
if (!isDevelopment) {
|
|
13
|
-
if (!campxTenantKey) {
|
|
14
|
-
return window.location.replace('https://id.campx.in')
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (!urlTenantKey) {
|
|
13
|
+
if (!urlTenantKey && campxTenantKey) {
|
|
18
14
|
return window.location.replace(
|
|
19
15
|
window.location.origin + `/${campxTenantKey}`,
|
|
20
16
|
)
|
|
21
17
|
}
|
|
18
|
+
|
|
19
|
+
if (!urlTenantKey) {
|
|
20
|
+
setIsInvalid(true)
|
|
21
|
+
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
if (window.location.pathname === '/' && isDevelopment) {
|