Show current page in cmd-k menu
This commit is contained in:
parent
4e4942efbc
commit
a11560b437
@ -35,6 +35,10 @@ import {
|
|||||||
pathForTag,
|
pathForTag,
|
||||||
pathForYear,
|
pathForYear,
|
||||||
PREFIX_RECENTS,
|
PREFIX_RECENTS,
|
||||||
|
isPathFull,
|
||||||
|
isPathGrid,
|
||||||
|
isPathAbout,
|
||||||
|
isPathRoot,
|
||||||
} from '../app/path';
|
} from '../app/path';
|
||||||
import Modal from '../components/Modal';
|
import Modal from '../components/Modal';
|
||||||
import { clsx } from 'clsx/lite';
|
import { clsx } from 'clsx/lite';
|
||||||
@ -574,6 +578,9 @@ export default function CommandKClient({
|
|||||||
? appText.nav.full
|
? appText.nav.full
|
||||||
: `${appText.nav.full} (${appText.nav.home})`,
|
: `${appText.nav.full} (${appText.nav.home})`,
|
||||||
path: PATH_FULL_INFERRED,
|
path: PATH_FULL_INFERRED,
|
||||||
|
annotation: renderCheck(GRID_HOMEPAGE_ENABLED
|
||||||
|
? isPathFull(pathname)
|
||||||
|
: isPathRoot(pathname)),
|
||||||
};
|
};
|
||||||
|
|
||||||
const pageGrid: CommandKItem = {
|
const pageGrid: CommandKItem = {
|
||||||
@ -581,6 +588,9 @@ export default function CommandKClient({
|
|||||||
? `${appText.nav.grid} (${appText.nav.home})`
|
? `${appText.nav.grid} (${appText.nav.home})`
|
||||||
: appText.nav.grid,
|
: appText.nav.grid,
|
||||||
path: PATH_GRID_INFERRED,
|
path: PATH_GRID_INFERRED,
|
||||||
|
annotation: renderCheck(GRID_HOMEPAGE_ENABLED
|
||||||
|
? isPathRoot(pathname)
|
||||||
|
: isPathGrid(pathname)),
|
||||||
};
|
};
|
||||||
|
|
||||||
const pageItems: CommandKItem[] = GRID_HOMEPAGE_ENABLED
|
const pageItems: CommandKItem[] = GRID_HOMEPAGE_ENABLED
|
||||||
@ -591,6 +601,7 @@ export default function CommandKClient({
|
|||||||
pageItems.push({
|
pageItems.push({
|
||||||
label: appText.nav.about,
|
label: appText.nav.about,
|
||||||
path: PATH_ABOUT,
|
path: PATH_ABOUT,
|
||||||
|
annotation: renderCheck(isPathAbout(pathname)),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user