feat(navigation): add extensible others menus
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
import { REFERENCES } from "@/data/references";
|
||||
import { VOLUNTEER_COMMUNITY_ITEMS } from "@/data/volunteer-community";
|
||||
import { YOUTUBE_VIDEO_LINKS } from "@/data/youtube-videos";
|
||||
import { NAV_LINKS, SOCIAL_LINKS } from "@/lib/links";
|
||||
import { NAV_DROPDOWN_GROUPS, NAV_LINKS, SOCIAL_LINKS } from "@/lib/links";
|
||||
import { getLocalizedValue } from "@/lib/locale";
|
||||
|
||||
export type CommandPaletteItem = {
|
||||
@@ -62,6 +62,21 @@ export function getCommandPaletteGroups(
|
||||
],
|
||||
}));
|
||||
|
||||
const dropdownGroups: CommandPaletteGroup[] = NAV_DROPDOWN_GROUPS.map(
|
||||
(group) => ({
|
||||
id: `navigation-${group.id}`,
|
||||
heading: tNav.has(group.id) ? tNav(group.id) : group.label,
|
||||
items: group.items.map((item) => ({
|
||||
id: item.id,
|
||||
label: tNav.has(item.id) ? tNav(item.id) : item.label,
|
||||
href: item.href,
|
||||
icon: item.icon,
|
||||
external: item.external,
|
||||
keywords: [group.label, item.label, ...item.keywords],
|
||||
})),
|
||||
}),
|
||||
);
|
||||
|
||||
const blogItems: CommandPaletteItem[] = [
|
||||
{
|
||||
id: "blog-index",
|
||||
@@ -281,6 +296,7 @@ export function getCommandPaletteGroups(
|
||||
heading: locale === "tr" ? "İçerikler" : "Contents",
|
||||
items: contentItems,
|
||||
},
|
||||
...dropdownGroups,
|
||||
{
|
||||
id: "social",
|
||||
heading: "Social",
|
||||
|
||||
@@ -70,6 +70,52 @@ export const SOCIAL_LINKS = [
|
||||
},
|
||||
] as const;
|
||||
|
||||
export const ANIMATION_RESOURCE_LINKS = [
|
||||
{
|
||||
id: "motion",
|
||||
label: "Motion",
|
||||
href: "https://motion.dev/",
|
||||
icon: "mdi:motion-play-outline",
|
||||
},
|
||||
{
|
||||
id: "gsap",
|
||||
label: "GSAP",
|
||||
href: "https://gsap.com/resources/",
|
||||
icon: "mdi:lightning-bolt-outline",
|
||||
},
|
||||
{
|
||||
id: "lottiefiles",
|
||||
label: "LottieFiles",
|
||||
href: "https://lottiefiles.com/",
|
||||
icon: "mdi:movie-open-play-outline",
|
||||
},
|
||||
{
|
||||
id: "rive",
|
||||
label: "Rive",
|
||||
href: "https://rive.app/",
|
||||
icon: "mdi:vector-curve",
|
||||
},
|
||||
] as const;
|
||||
|
||||
export const NAV_DROPDOWN_GROUPS = [
|
||||
{
|
||||
id: "others",
|
||||
label: "Diğerleri",
|
||||
icon: "mdi:dots-horizontal",
|
||||
insertAfter: "gallery",
|
||||
items: [
|
||||
{
|
||||
id: "animationResources",
|
||||
label: "Animasyon Kaynakları",
|
||||
href: "/links?category=resources&query=animation",
|
||||
icon: "mdi:motion-play-outline",
|
||||
external: false,
|
||||
keywords: ["animasyon", "animation", "kaynak", "resource", "motion"],
|
||||
},
|
||||
],
|
||||
},
|
||||
] as const;
|
||||
|
||||
export const TOP_ICON_LINKS = [
|
||||
{
|
||||
id: "ui-kit",
|
||||
@@ -145,6 +191,23 @@ export const LINK_DIRECTORY: LinkDirectoryItem[] = [
|
||||
category: "social" as const,
|
||||
keywords: [item.label, item.href, "sosyal", "profile", "platform"],
|
||||
})),
|
||||
...ANIMATION_RESOURCE_LINKS.map((item) => ({
|
||||
id: item.id,
|
||||
label: item.label,
|
||||
href: item.href,
|
||||
icon: item.icon,
|
||||
external: true,
|
||||
category: "resources" as const,
|
||||
keywords: [
|
||||
item.label,
|
||||
item.href,
|
||||
"animasyon",
|
||||
"animation",
|
||||
"kaynak",
|
||||
"resource",
|
||||
"motion",
|
||||
],
|
||||
})),
|
||||
...TOP_ICON_LINKS.map((item) => ({
|
||||
id: item.id,
|
||||
label: item.label,
|
||||
|
||||
Reference in New Issue
Block a user