@taruvi/navkit 0.0.7 → 0.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.
- package/package.json +1 -1
- package/src/App.tsx +3 -2
- package/src/NavkitContext.tsx +1 -2
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import { Box, Modal, Card } from "@mui/material"
|
|
|
8
8
|
import { appStyles } from "./App.styles"
|
|
9
9
|
import { NavkitProvider, useNavigation } from "./NavkitContext"
|
|
10
10
|
import defaultLogo from "./assets/taruvi-logo.png"
|
|
11
|
+
import type { Client } from "@taruvi/sdk"
|
|
11
12
|
|
|
12
13
|
const NavkitContent = () => {
|
|
13
14
|
const { isUserAuthenticated, siteSettings, userData, appsList, jwtToken } = useNavigation()
|
|
@@ -31,7 +32,7 @@ const NavkitContent = () => {
|
|
|
31
32
|
<AppBar position="static" sx={appStyles.appBar}>
|
|
32
33
|
<Toolbar sx={appStyles.toolbar}>
|
|
33
34
|
<Box component={"div"} sx={appStyles.leftSection}>
|
|
34
|
-
{isUserAuthenticated &&
|
|
35
|
+
{isUserAuthenticated && appsList.length > 0 &&
|
|
35
36
|
<IconButton onClick={() => setShowAppLauncher(!showAppLauncher)}>
|
|
36
37
|
<FontAwesomeIcon icon={["fas", "th"]} style={appStyles.iconStyle} />
|
|
37
38
|
</IconButton>
|
|
@@ -100,7 +101,7 @@ const NavkitContent = () => {
|
|
|
100
101
|
)
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
const Navkit = ({ client }: { client:
|
|
104
|
+
const Navkit = ({ client }: { client: Client }) => {
|
|
104
105
|
return (
|
|
105
106
|
<NavkitProvider client={client}>
|
|
106
107
|
<NavkitContent />
|
package/src/NavkitContext.tsx
CHANGED
|
@@ -29,7 +29,6 @@ export const NavkitProvider = ({ children, client }: NavkitProviderProps) => {
|
|
|
29
29
|
const checkIfDesk = async () => {
|
|
30
30
|
const fetchedSettings = await settings?.current?.get?.()
|
|
31
31
|
const frontendUrl = fetchedSettings?.data?.frontendUrl
|
|
32
|
-
// const frontendUrl = "http://localhost:5173/desk"
|
|
33
32
|
if (!frontendUrl) return false
|
|
34
33
|
return window.location.href.includes(frontendUrl || '')
|
|
35
34
|
}
|
|
@@ -74,7 +73,7 @@ export const NavkitProvider = ({ children, client }: NavkitProviderProps) => {
|
|
|
74
73
|
const transformedApps: AppData[] = (appsResponse?.data || []).map?.((app: any) => ({
|
|
75
74
|
id: app.slug,
|
|
76
75
|
appname: app.display_name || app.name,
|
|
77
|
-
icon: app.icon,
|
|
76
|
+
icon: app.icon || "fa-question",
|
|
78
77
|
url: app.url
|
|
79
78
|
}))
|
|
80
79
|
startTransition(() => {
|