Skip to content

Commit 82564e2

Browse files
committed
[dashboard] Adjust ContextMenu background style (hover, active)
1 parent dc30085 commit 82564e2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

components/dashboard/src/Menu.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export default function Menu() {
159159
<span className="text-gray-800 dark:text-gray-100 text-base font-semibold">{userFullName}</span>
160160
<span className="">Personal Account</span>
161161
</div>,
162+
active: !team,
162163
separator: true,
163164
link: '/',
164165
},
@@ -171,6 +172,7 @@ export default function Menu() {
171172
: '...'
172173
}</span>
173174
</div>,
175+
active: team && team.id === t.id,
174176
separator: true,
175177
link: `/${t.slug}`,
176178
})).sort((a, b) => a.title.toLowerCase() > b.title.toLowerCase() ? 1 : -1),

components/dashboard/src/components/ContextMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function ContextMenu(props: ContextMenuProps) {
8484
<div className={`mt-2 z-50 bg-white dark:bg-gray-900 absolute flex flex-col border border-gray-200 dark:border-gray-800 rounded-lg truncated ${props.classes || 'w-48 right-0'}`}>
8585
{props.menuEntries.map((e, index) => {
8686
const clickable = e.href || e.onClick || e.link;
87-
const entry = <div className={`px-4 flex py-3 ${clickable ? 'hover:bg-gray-200 dark:hover:bg-gray-800' : ''} text-sm leading-1 ${e.customFontStyle || font} ${e.separator ? ' border-b border-gray-200 dark:border-gray-800' : ''}`} title={e.title}>
87+
const entry = <div className={`px-4 flex py-3 ${clickable ? 'hover:bg-gray-100 dark:hover:bg-gray-700' : ''} ${e.active ? 'bg-gray-50 dark:bg-gray-800' : ''} ${index === 0 ? 'rounded-t-lg' : ''} ${index === props.menuEntries.length - 1 ? 'rounded-b-lg' : ''} text-sm leading-1 ${e.customFontStyle || font} ${e.separator ? ' border-b border-gray-200 dark:border-gray-800' : ''}`} title={e.title}>
8888
{e.customContent || <><div className="truncate w-52">{e.title}</div><div className="flex-1"></div>{e.active ? <div className="pl-1 font-semibold">&#x2713;</div> : null}</>}
8989
</div>
9090
const key = `entry-${menuId}-${index}-${e.title}`;

0 commit comments

Comments
 (0)