diff --git a/src/admin/AdminAppMenu.tsx b/src/admin/AdminAppMenu.tsx index 9974ac9d..6f64b0cd 100644 --- a/src/admin/AdminAppMenu.tsx +++ b/src/admin/AdminAppMenu.tsx @@ -63,18 +63,22 @@ export default function AdminAppMenu({ resolve(); } }), - }, { - label: 'Manage Photos', - ...photosCountTotal && { - annotation: `${photosCountTotal}`, - }, - icon: , - href: PATH_ADMIN_PHOTOS, }]; + if (photosCountTotal) { + items.push({ + label: 'Manage Photos', + ...photosCountTotal && { + annotation: `${photosCountTotal}`, + }, + icon: , + href: PATH_ADMIN_PHOTOS, + }); + } + if (uploadsCount) { items.push({ label: 'Uploads', @@ -99,6 +103,33 @@ export default function AdminAppMenu({ }); } + if (photosCountTotal) { + items.push({ + label: isSelecting + ? 'Exit Select' + : 'Edit Multiple', + icon: isSelecting + ? + : , + href: PATH_GRID_INFERRED, + action: () => { + if (isSelecting) { + setSelectedPhotoIds?.(undefined); + } else { + setSelectedPhotoIds?.([]); + } + if (document.activeElement instanceof HTMLElement) { + document.activeElement.blur(); + } + }, + shouldPreventDefault: false, + }); + } + items.push({ label: showAppInsightsLink ? 'App Insights' @@ -110,29 +141,6 @@ export default function AdminAppMenu({ href: showAppInsightsLink ? PATH_ADMIN_INSIGHTS : PATH_ADMIN_CONFIGURATION, - }, { - label: isSelecting - ? 'Exit Select' - : 'Edit Multiple', - icon: isSelecting - ? - : , - href: PATH_GRID_INFERRED, - action: () => { - if (isSelecting) { - setSelectedPhotoIds?.(undefined); - } else { - setSelectedPhotoIds?.([]); - } - if (document.activeElement instanceof HTMLElement) { - document.activeElement.blur(); - } - }, - shouldPreventDefault: false, }, { label: 'Sign Out', icon: ,