oneslash-design-system 1.1.18 → 1.1.19

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.
@@ -15,19 +15,17 @@ interface MenuItemProps {
15
15
  onClick?: any;
16
16
  }
17
17
 
18
- export default function MenuItem({
19
- href = '#',
20
- iconName,
18
+ export default function MenuItem({
19
+ href = '#',
20
+ iconName,
21
21
  userHandle,
22
22
  userImgUrl,
23
- label,
24
- isSelected,
25
- onClick, }
26
- : MenuItemProps) {
23
+ label,
24
+ isSelected,
25
+ onClick,
26
+ }: MenuItemProps) {
27
+ const [IconLeft, setIconLeft] = useState<IconType | null>(null);
27
28
 
28
- const [IconLeft, setIconLeft] = useState<IconType | null>(null);
29
-
30
- // Import icon dynamically
31
29
  const loadIcon = useCallback(async (iconName?: string) => {
32
30
  if (!iconName) return null;
33
31
  try {
@@ -49,27 +47,30 @@ export default function MenuItem({
49
47
  fetchIcon();
50
48
  }, [iconName, loadIcon]);
51
49
 
52
-
53
50
  return (
54
51
  <NextLink href={href}>
55
- <div
52
+ <div
56
53
  className={`
57
54
  flex items-center space-x-2 p-2 rounded-[8px] cursor-pointer justify-start
58
- ${isSelected
59
- ? 'bg-light-background-accent200 dark:bg-dark-background-accent200 hover:bg-light-background-accent300 dark:hover:bg-dark-background-accent300'
55
+ ${isSelected
56
+ ? 'bg-light-background-accent200 dark:bg-dark-background-accent200 hover:bg-light-background-accent300 dark:hover:bg-dark-background-accent300'
60
57
  : 'hover:bg-light-background-accent100 hover:dark:bg-dark-background-accent100'}
61
58
  `}
62
59
  style={{ width: '100%' }}
63
60
  onClick={onClick}
64
61
  >
65
- {/* render userImage. render dynamic icon if userImage is not available */}
62
+ {/* Render UserImage or dynamic icon */}
66
63
  {userImgUrl || userHandle ? (
67
- <UserImage userHandle={userHandle || ''} userImgUrl={userImgUrl || ''} />
68
- ) : (
69
- IconLeft && <IconLeft className="w-6 h-6" />
70
- )}
64
+ <UserImage userHandle={userHandle || ''} userImgUrl={userImgUrl || ''} />
65
+ ) : (
66
+ IconLeft && (
67
+ <IconLeft
68
+ className="w-6 h-6 text-light-text-secondary dark:text-dark-text-secondary"
69
+ />
70
+ )
71
+ )}
71
72
 
72
- {/* label */}
73
+ {/* Label */}
73
74
  <span className="whitespace-nowrap text-body1 px-2 text-light-text-primary dark:text-dark-text-primary">
74
75
  {label}
75
76
  </span>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oneslash-design-system",
3
3
  "description": "A design system for the Oneslash projects",
4
- "version": "1.1.18",
4
+ "version": "1.1.19",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",