Refine admin menus
This commit is contained in:
parent
a2271bbf33
commit
3d08d457dc
@ -68,6 +68,17 @@ export default function AdminAppMenu({
|
|||||||
}),
|
}),
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
if (uploadsCount) {
|
||||||
|
items.push({
|
||||||
|
label: 'Uploads',
|
||||||
|
annotation: `${uploadsCount}`,
|
||||||
|
icon: <IconFolder
|
||||||
|
size={16}
|
||||||
|
className="translate-y-[0.5px]"
|
||||||
|
/>,
|
||||||
|
href: PATH_ADMIN_UPLOADS,
|
||||||
|
});
|
||||||
|
}
|
||||||
if (photosCountTotal) {
|
if (photosCountTotal) {
|
||||||
items.push({
|
items.push({
|
||||||
label: 'Manage Photos',
|
label: 'Manage Photos',
|
||||||
@ -81,19 +92,6 @@ export default function AdminAppMenu({
|
|||||||
href: PATH_ADMIN_PHOTOS,
|
href: PATH_ADMIN_PHOTOS,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uploadsCount) {
|
|
||||||
items.push({
|
|
||||||
label: 'Uploads',
|
|
||||||
annotation: `${uploadsCount}`,
|
|
||||||
icon: <IconFolder
|
|
||||||
size={16}
|
|
||||||
className="translate-y-[0.5px]"
|
|
||||||
/>,
|
|
||||||
href: PATH_ADMIN_UPLOADS,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tagsCount) {
|
if (tagsCount) {
|
||||||
items.push({
|
items.push({
|
||||||
label: 'Manage Tags',
|
label: 'Manage Tags',
|
||||||
@ -105,7 +103,6 @@ export default function AdminAppMenu({
|
|||||||
href: PATH_ADMIN_TAGS,
|
href: PATH_ADMIN_TAGS,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipesCount) {
|
if (recipesCount) {
|
||||||
items.push({
|
items.push({
|
||||||
label: 'Manage Recipes',
|
label: 'Manage Recipes',
|
||||||
@ -117,7 +114,6 @@ export default function AdminAppMenu({
|
|||||||
href: PATH_ADMIN_RECIPES,
|
href: PATH_ADMIN_RECIPES,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (photosCountTotal) {
|
if (photosCountTotal) {
|
||||||
items.push({
|
items.push({
|
||||||
label: isSelecting
|
label: isSelecting
|
||||||
|
|||||||
@ -58,7 +58,9 @@ export default function AdminBatchEditPanelClient({
|
|||||||
const renderPhotoCTA = selectedPhotoIds?.length === 0
|
const renderPhotoCTA = selectedPhotoIds?.length === 0
|
||||||
? <>
|
? <>
|
||||||
<FaArrowDown />
|
<FaArrowDown />
|
||||||
Select photos below
|
<ResponsiveText shortText="Select below">
|
||||||
|
Select photos below
|
||||||
|
</ResponsiveText>
|
||||||
</>
|
</>
|
||||||
: <ResponsiveText shortText={photosText}>
|
: <ResponsiveText shortText={photosText}>
|
||||||
{photosText} selected
|
{photosText} selected
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import {
|
|||||||
PATH_ADMIN_CONFIGURATION,
|
PATH_ADMIN_CONFIGURATION,
|
||||||
PATH_ADMIN_INSIGHTS,
|
PATH_ADMIN_INSIGHTS,
|
||||||
PATH_ADMIN_PHOTOS,
|
PATH_ADMIN_PHOTOS,
|
||||||
|
PATH_ADMIN_RECIPES,
|
||||||
PATH_ADMIN_TAGS,
|
PATH_ADMIN_TAGS,
|
||||||
PATH_ADMIN_UPLOADS,
|
PATH_ADMIN_UPLOADS,
|
||||||
PATH_FEED_INFERRED,
|
PATH_FEED_INFERRED,
|
||||||
@ -126,6 +127,7 @@ export default function CommandKClient({
|
|||||||
photosCountHidden,
|
photosCountHidden,
|
||||||
uploadsCount,
|
uploadsCount,
|
||||||
tagsCount,
|
tagsCount,
|
||||||
|
recipesCount,
|
||||||
selectedPhotoIds,
|
selectedPhotoIds,
|
||||||
setSelectedPhotoIds,
|
setSelectedPhotoIds,
|
||||||
insightsIndicatorStatus,
|
insightsIndicatorStatus,
|
||||||
@ -425,18 +427,18 @@ export default function CommandKClient({
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (isUserSignedIn) {
|
if (isUserSignedIn) {
|
||||||
|
if (uploadsCount) {
|
||||||
|
adminSection.items.push({
|
||||||
|
label: `Uploads (${uploadsCount})`,
|
||||||
|
annotation: <IconLock narrow />,
|
||||||
|
path: PATH_ADMIN_UPLOADS,
|
||||||
|
});
|
||||||
|
}
|
||||||
adminSection.items.push({
|
adminSection.items.push({
|
||||||
label: 'Manage Photos',
|
label: 'Manage Photos',
|
||||||
annotation: <IconLock narrow />,
|
annotation: <IconLock narrow />,
|
||||||
path: PATH_ADMIN_PHOTOS,
|
path: PATH_ADMIN_PHOTOS,
|
||||||
});
|
});
|
||||||
if (uploadsCount) {
|
|
||||||
adminSection.items.push({
|
|
||||||
label: 'Manage Uploads',
|
|
||||||
annotation: <IconLock narrow />,
|
|
||||||
path: PATH_ADMIN_UPLOADS,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (tagsCount) {
|
if (tagsCount) {
|
||||||
adminSection.items.push({
|
adminSection.items.push({
|
||||||
label: 'Manage Tags',
|
label: 'Manage Tags',
|
||||||
@ -444,7 +446,25 @@ export default function CommandKClient({
|
|||||||
path: PATH_ADMIN_TAGS,
|
path: PATH_ADMIN_TAGS,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (recipesCount) {
|
||||||
|
adminSection.items.push({
|
||||||
|
label: 'Manage Recipes',
|
||||||
|
annotation: <IconLock narrow />,
|
||||||
|
path: PATH_ADMIN_RECIPES,
|
||||||
|
});
|
||||||
|
}
|
||||||
adminSection.items.push({
|
adminSection.items.push({
|
||||||
|
label: selectedPhotoIds === undefined
|
||||||
|
? 'Batch Edit Photos ...'
|
||||||
|
: 'Exit Batch Edit',
|
||||||
|
annotation: <IconLock narrow />,
|
||||||
|
path: selectedPhotoIds === undefined
|
||||||
|
? PATH_GRID_INFERRED
|
||||||
|
: undefined,
|
||||||
|
action: selectedPhotoIds === undefined
|
||||||
|
? () => setSelectedPhotoIds?.([])
|
||||||
|
: () => setSelectedPhotoIds?.(undefined),
|
||||||
|
}, {
|
||||||
label: <span className="flex items-center gap-3">
|
label: <span className="flex items-center gap-3">
|
||||||
App Insights
|
App Insights
|
||||||
{insightsIndicatorStatus &&
|
{insightsIndicatorStatus &&
|
||||||
@ -457,17 +477,6 @@ export default function CommandKClient({
|
|||||||
label: 'App Config',
|
label: 'App Config',
|
||||||
annotation: <IconLock narrow />,
|
annotation: <IconLock narrow />,
|
||||||
path: PATH_ADMIN_CONFIGURATION,
|
path: PATH_ADMIN_CONFIGURATION,
|
||||||
}, {
|
|
||||||
label: selectedPhotoIds === undefined
|
|
||||||
? 'Select Multiple Photos'
|
|
||||||
: 'Exit Select Multiple Photos',
|
|
||||||
annotation: <IconLock narrow />,
|
|
||||||
path: selectedPhotoIds === undefined
|
|
||||||
? PATH_GRID_INFERRED
|
|
||||||
: undefined,
|
|
||||||
action: selectedPhotoIds === undefined
|
|
||||||
? () => setSelectedPhotoIds?.([])
|
|
||||||
: () => setSelectedPhotoIds?.(undefined),
|
|
||||||
});
|
});
|
||||||
if (showDebugTools) {
|
if (showDebugTools) {
|
||||||
adminSection.items.push({
|
adminSection.items.push({
|
||||||
@ -537,7 +546,7 @@ export default function CommandKClient({
|
|||||||
/>
|
/>
|
||||||
{isLoading && !isPending &&
|
{isLoading && !isPending &&
|
||||||
<span className={clsx(
|
<span className={clsx(
|
||||||
'absolute top-2 right-0 w-10',
|
'absolute top-[9px] right-0 w-10',
|
||||||
'flex items-center justify-center translate-y-[2px]',
|
'flex items-center justify-center translate-y-[2px]',
|
||||||
)}>
|
)}>
|
||||||
<Spinner size={16} />
|
<Spinner size={16} />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user