Improve the demo feature of the project
This commit is contained in:
@@ -516,6 +516,16 @@ export const Sidebar = forwardRef<SidebarRef, SidebarProps>(({
|
||||
const isHovered = hoveredItem === item.id;
|
||||
const ItemIcon = item.icon;
|
||||
|
||||
// Add tour data attributes for main navigation sections
|
||||
const getTourAttribute = (itemPath: string) => {
|
||||
if (itemPath === '/app/database') return 'sidebar-database';
|
||||
if (itemPath === '/app/operations') return 'sidebar-operations';
|
||||
if (itemPath === '/app/analytics') return 'sidebar-analytics';
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const tourAttr = getTourAttribute(item.path);
|
||||
|
||||
const itemContent = (
|
||||
<div
|
||||
className={clsx(
|
||||
@@ -635,7 +645,7 @@ export const Sidebar = forwardRef<SidebarRef, SidebarProps>(({
|
||||
);
|
||||
|
||||
return (
|
||||
<li key={item.id} className="relative">
|
||||
<li key={item.id} className="relative" data-tour={tourAttr}>
|
||||
{isCollapsed && !hasChildren && ItemIcon ? (
|
||||
<Tooltip content={item.label} side="right">
|
||||
{button}
|
||||
|
||||
Reference in New Issue
Block a user