@taruvi/navkit 0.0.26 → 0.0.28
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 +2 -2
- package/src/App.tsx +1 -1
- package/src/NavkitContext.tsx +2 -2
- package/src/components/AppLauncher/AppLauncher.tsx +2 -8
- package/src/components/Profile/Profile.styles.ts +3 -3
- package/src/components/Profile/ProfileMenu.tsx +2 -5
- package/src/types.ts +3 -4
- package/tsconfig.app.json +5 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taruvi/navkit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"main": "src/App.tsx",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
"vite": "^7.1.7"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@taruvi/sdk": "^1.
|
|
49
|
+
"@taruvi/sdk": "^1.3.4-beta.0"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/src/App.tsx
CHANGED
|
@@ -43,6 +43,7 @@ const NavkitContent = () => {
|
|
|
43
43
|
</Box>
|
|
44
44
|
<Box component={"div"} sx={styles.rightSection}>
|
|
45
45
|
<Shortcuts showChat={setShowChat} onMenuToggle={() => setShowShortcutsMenu(!showShortcutsMenu)} />
|
|
46
|
+
{isUserAuthenticated && userData && <Profile userData={userData} onClick={() => setShowProfileMenu(!showProfileMenu)} />}
|
|
46
47
|
<Box
|
|
47
48
|
onClick={() => {
|
|
48
49
|
if (isUserAuthenticated) {
|
|
@@ -69,7 +70,6 @@ const NavkitContent = () => {
|
|
|
69
70
|
<Box component="img" src={taruviLogo} sx={styles.appLauncherLogo} />
|
|
70
71
|
)}
|
|
71
72
|
</Box>
|
|
72
|
-
{isUserAuthenticated && userData && <Profile userData={userData} onClick={() => setShowProfileMenu(!showProfileMenu)} />}
|
|
73
73
|
</Box>
|
|
74
74
|
</Toolbar>
|
|
75
75
|
</AppBar>
|
package/src/NavkitContext.tsx
CHANGED
|
@@ -97,9 +97,9 @@ export const NavkitProvider = ({ children, client, onThemeChange }: NavkitProvid
|
|
|
97
97
|
// App settings not available, continue without app settings
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
siteSettings.current = fetchedSettings
|
|
100
|
+
siteSettings.current = fetchedSettings?.data ?? fetchedSettings
|
|
101
101
|
if (isUserAuthenticated) {
|
|
102
|
-
const userDataResponse = await
|
|
102
|
+
const userDataResponse = await auth.getCurrentUser()
|
|
103
103
|
setUserData(userDataResponse?.data || null)
|
|
104
104
|
|
|
105
105
|
// Fetch user apps using username from userData
|
|
@@ -3,7 +3,7 @@ import type { AppData } from "../../types"
|
|
|
3
3
|
import Search from "../Search/Search"
|
|
4
4
|
import { Card, Box, Grid, Typography } from "@mui/material"
|
|
5
5
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
|
6
|
-
import { findIconDefinition,
|
|
6
|
+
import { findIconDefinition, type IconName } from "@fortawesome/fontawesome-svg-core"
|
|
7
7
|
import { useNavigation } from "../../NavkitContext"
|
|
8
8
|
import { getAppLauncherStyles } from "./AppLauncher.styles"
|
|
9
9
|
|
|
@@ -37,7 +37,7 @@ const AppLauncher = () => {
|
|
|
37
37
|
return (
|
|
38
38
|
<Card sx={styles.container}>
|
|
39
39
|
<Search appsList={appsList} onSearchChange={handleSearchChange} />
|
|
40
|
-
{filteredApps && filteredApps.length > 0
|
|
40
|
+
{filteredApps && filteredApps.length > 0 && (
|
|
41
41
|
<Box sx={styles.scrollContainer}>
|
|
42
42
|
<Grid container spacing={0}>
|
|
43
43
|
{filteredApps.map((app) => {
|
|
@@ -83,12 +83,6 @@ const AppLauncher = () => {
|
|
|
83
83
|
})}
|
|
84
84
|
</Grid>
|
|
85
85
|
</Box>
|
|
86
|
-
) : (
|
|
87
|
-
<Box sx={{ display: 'flex', justifyContent: 'center', alignItems: 'center', padding: '40px 16px' }}>
|
|
88
|
-
<Typography sx={{ color: styles.appName?.color || '#9e9e9e', fontSize: '0.875rem' }}>
|
|
89
|
-
No apps available
|
|
90
|
-
</Typography>
|
|
91
|
-
</Box>
|
|
92
86
|
)}
|
|
93
87
|
</Card>
|
|
94
88
|
)
|
|
@@ -31,7 +31,7 @@ export const profileStyles = {
|
|
|
31
31
|
position: 'absolute' as const,
|
|
32
32
|
top: 60,
|
|
33
33
|
right: 0,
|
|
34
|
-
width:
|
|
34
|
+
width: 200,
|
|
35
35
|
borderRadius: borderRadius.default,
|
|
36
36
|
boxShadow: shadows.dropdown,
|
|
37
37
|
backgroundColor: colours.bg.white,
|
|
@@ -70,7 +70,7 @@ export const getProfileStyles = (mode: ThemeMode) => {
|
|
|
70
70
|
display: 'flex',
|
|
71
71
|
alignItems: 'center',
|
|
72
72
|
gap: spacing.sm,
|
|
73
|
-
|
|
73
|
+
ml: spacing.md,
|
|
74
74
|
cursor: 'pointer',
|
|
75
75
|
},
|
|
76
76
|
avatar: {
|
|
@@ -92,7 +92,7 @@ export const getProfileStyles = (mode: ThemeMode) => {
|
|
|
92
92
|
position: 'absolute' as const,
|
|
93
93
|
top: 60,
|
|
94
94
|
right: 0,
|
|
95
|
-
width:
|
|
95
|
+
width: 200,
|
|
96
96
|
borderRadius: borderRadius.default,
|
|
97
97
|
boxShadow: themeShadows.dropdown,
|
|
98
98
|
backgroundColor: colors.bg.white,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Box, Card, Divider, MenuItem, Typography } from '@mui/material'
|
|
2
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
3
3
|
import DarkModeOutlined from '@mui/icons-material/DarkModeOutlined'
|
|
4
4
|
import LightModeOutlined from '@mui/icons-material/LightModeOutlined'
|
|
@@ -19,10 +19,7 @@ const ProfileMenu = () => {
|
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<Card sx={styles.menu}>
|
|
22
|
-
<Box sx={{ px: 2, py: 1.5
|
|
23
|
-
{userData?.icon_url && (
|
|
24
|
-
<Avatar src={userData.icon_url} sx={{ width: 32, height: 32, maxWidth: 32, borderRadius: '50%' }} />
|
|
25
|
-
)}
|
|
22
|
+
<Box sx={{ px: 2, py: 1.5 }}>
|
|
26
23
|
<Typography sx={{ fontWeight: 600, color: styles.menuItemText.color }}>
|
|
27
24
|
{userData?.full_name}
|
|
28
25
|
</Typography>
|
package/src/types.ts
CHANGED
|
@@ -25,17 +25,16 @@ export interface UserData {
|
|
|
25
25
|
last_name?: string
|
|
26
26
|
full_name?: string
|
|
27
27
|
pfp?: string
|
|
28
|
-
icon_url?: string
|
|
29
28
|
is_active?: boolean
|
|
30
29
|
is_staff?: boolean
|
|
31
30
|
is_superuser?: boolean
|
|
32
31
|
is_deleted?: boolean
|
|
33
32
|
date_joined?: string
|
|
34
33
|
last_login?: string
|
|
35
|
-
groups?: string[]
|
|
36
|
-
user_permissions?: string[]
|
|
34
|
+
groups?: { id: number; name: string }[]
|
|
35
|
+
user_permissions?: { id: number; name: string; codename: string; content_type: string }[]
|
|
37
36
|
attributes?: Record<string, unknown>
|
|
38
|
-
missing_attributes?:
|
|
37
|
+
missing_attributes?: string[]
|
|
39
38
|
roles?: UserRole[]
|
|
40
39
|
}
|
|
41
40
|
|
package/tsconfig.app.json
CHANGED
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
|
|
19
19
|
/* Linting */
|
|
20
20
|
"strict": true,
|
|
21
|
-
"noUnusedLocals":
|
|
22
|
-
"noUnusedParameters":
|
|
23
|
-
"erasableSyntaxOnly":
|
|
21
|
+
"noUnusedLocals": false,
|
|
22
|
+
"noUnusedParameters": false,
|
|
23
|
+
"erasableSyntaxOnly": false,
|
|
24
24
|
"noFallthroughCasesInSwitch": true,
|
|
25
25
|
"noUncheckedSideEffectImports": true
|
|
26
26
|
},
|
|
27
|
-
"include": ["src"]
|
|
27
|
+
"include": ["src"],
|
|
28
|
+
"exclude": ["node_modules"]
|
|
28
29
|
}
|