@taruvi/navkit 0.0.28 → 0.0.30

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": "@taruvi/navkit",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "main": "src/App.tsx",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/App.styles.ts CHANGED
@@ -7,13 +7,17 @@ export const appStyles = {
7
7
  },
8
8
  toolbar: {
9
9
  backgroundColor: colours.bg.white,
10
+ justifyContent: 'space-between',
10
11
  },
11
12
  leftSection: {
12
13
  display: 'flex',
13
- flexGrow: 1,
14
14
  alignItems: 'center',
15
15
  justifyContent: 'start',
16
16
  gap: '10px',
17
+ width: 'fit-content',
18
+ cursor: 'pointer',
19
+ textDecoration: 'none',
20
+ color: 'inherit',
17
21
  },
18
22
  logo: {
19
23
  maxHeight: '40px',
@@ -74,14 +78,17 @@ export const getAppStyles = (mode: ThemeMode) => {
74
78
  toolbar: {
75
79
  backgroundColor: '#004369',
76
80
  boxShadow: ' 0px 0px 10px 2px rgba(0, 0, 0, 0.3)',
77
- borderBottom: '2px solid #1565c0',
81
+ justifyContent: 'space-between',
78
82
  },
79
83
  leftSection: {
80
84
  display: 'flex',
81
- flexGrow: 1,
82
85
  alignItems: 'center',
83
86
  justifyContent: 'start',
84
87
  gap: '10px',
88
+ width: 'fit-content',
89
+ cursor: 'pointer',
90
+ textDecoration: 'none',
91
+ color: 'inherit',
85
92
  },
86
93
  logo: {
87
94
  maxHeight: '40px',
package/src/App.tsx CHANGED
@@ -33,7 +33,7 @@ const NavkitContent = () => {
33
33
  )}
34
34
  <AppBar position="static" sx={styles.appBar}>
35
35
  <Toolbar sx={styles.toolbar}>
36
- <Box component={"div"} sx={styles.leftSection} onClick={() => (window.location.href = "/")}>
36
+ <Box component={"a"} href="/" sx={styles.leftSection}>
37
37
  {appSettings?.icon ? <Box component="img" src={appSettings?.icon} sx={styles.logo} /> : <></>}
38
38
  {appSettings?.displayName &&
39
39
  <Typography sx={styles.appName}>
@@ -45,22 +45,22 @@ const NavkitContent = () => {
45
45
  <Shortcuts showChat={setShowChat} onMenuToggle={() => setShowShortcutsMenu(!showShortcutsMenu)} />
46
46
  {isUserAuthenticated && userData && <Profile userData={userData} onClick={() => setShowProfileMenu(!showProfileMenu)} />}
47
47
  <Box
48
- onClick={() => {
49
- if (isUserAuthenticated) {
50
- setShowAppLauncher(!showAppLauncher);
51
- }
52
- }}
53
- onMouseEnter={() => {
54
- if (isUserAuthenticated) {
55
- setIsAppLauncherHovered(true);
56
- }
57
- }}
58
- onMouseLeave={() => setIsAppLauncherHovered(false)}
59
- sx={{
60
- ...styles.appLauncherContainer,
61
- cursor: isUserAuthenticated ? "pointer" : "default",
62
- }}
63
- >
48
+ onClick={() => {
49
+ if (isUserAuthenticated) {
50
+ setShowAppLauncher(!showAppLauncher);
51
+ }
52
+ }}
53
+ onMouseEnter={() => {
54
+ if (isUserAuthenticated) {
55
+ setIsAppLauncherHovered(true);
56
+ }
57
+ }}
58
+ onMouseLeave={() => setIsAppLauncherHovered(false)}
59
+ sx={{
60
+ ...styles.appLauncherContainer,
61
+ cursor: isUserAuthenticated ? "pointer" : "default",
62
+ }}
63
+ >
64
64
  {(isAppLauncherHovered || showAppLauncher) && isUserAuthenticated ? (
65
65
  <Box sx={styles.appLauncherHover}>
66
66
  <FontAwesomeIcon icon={["fas", "th"]} style={styles.appLauncherIcon} />
@@ -74,18 +74,19 @@ const NavkitContent = () => {
74
74
  </Toolbar>
75
75
  </AppBar>
76
76
 
77
- {showAppLauncher && isUserAuthenticated && (
77
+ {showProfileMenu && (
78
78
  <Box>
79
- <AppLauncher />
79
+ <ProfileMenu />
80
80
  </Box>
81
81
  )}
82
82
 
83
- {showProfileMenu && (
83
+ {showAppLauncher && isUserAuthenticated && (
84
84
  <Box>
85
- <ProfileMenu />
85
+ <AppLauncher />
86
86
  </Box>
87
87
  )}
88
88
 
89
+
89
90
  {showShortcutsMenu && (
90
91
  <Box>
91
92
  <ShortcutsMenu showChat={setShowChat} />
@@ -38,16 +38,17 @@ const Shortcuts = (props: ShortcutsProps) => {
38
38
  />
39
39
  </Link>
40
40
  ))}
41
- {siteSettings.showChat && isUserAuthenticated && <Link
42
- key={"chat"}
43
- onClick={() => showChat?.(true)}
44
- sx={shortcutsStyles.shortcut}
45
- >
46
- <FontAwesomeIcon
47
- icon={["far", "comment"] as any}
48
- style={shortcutsStyles.iconStyle}
49
- />
50
- </Link>
41
+ {siteSettings.showChat && isUserAuthenticated &&
42
+ <Link
43
+ key={"chat"}
44
+ onClick={() => showChat?.(true)}
45
+ sx={shortcutsStyles.shortcut}
46
+ >
47
+ <FontAwesomeIcon
48
+ icon={["far", "comment"] as any}
49
+ style={shortcutsStyles.iconStyle}
50
+ />
51
+ </Link>
51
52
  }
52
53
  </Box>
53
54