feat(navigation): add extensible others menus
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { LinksContent } from "@/components/links-content";
|
import { LinksContent } from "@/components/links-content";
|
||||||
|
|
||||||
|
type LinksPageProps = {
|
||||||
|
searchParams?: Promise<{
|
||||||
|
category?: string | string[];
|
||||||
|
query?: string | string[];
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Links",
|
title: "Links",
|
||||||
description:
|
description:
|
||||||
@@ -31,6 +38,20 @@ export const metadata: Metadata = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function LinksPage() {
|
function firstParam(value?: string | string[]) {
|
||||||
return <LinksContent />;
|
return Array.isArray(value) ? value[0] : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function LinksPage({ searchParams }: LinksPageProps) {
|
||||||
|
const resolvedSearchParams = searchParams ? await searchParams : undefined;
|
||||||
|
const initialCategory = firstParam(resolvedSearchParams?.category);
|
||||||
|
const initialQuery = firstParam(resolvedSearchParams?.query);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<LinksContent
|
||||||
|
key={`${initialCategory ?? "all"}-${initialQuery ?? ""}`}
|
||||||
|
initialCategory={initialCategory}
|
||||||
|
initialQuery={initialQuery}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ import {
|
|||||||
|
|
||||||
type CategoryFilter = "all" | LinkDirectoryCategory;
|
type CategoryFilter = "all" | LinkDirectoryCategory;
|
||||||
|
|
||||||
|
type LinksContentProps = {
|
||||||
|
initialCategory?: string;
|
||||||
|
initialQuery?: string;
|
||||||
|
};
|
||||||
|
|
||||||
const CATEGORY_ORDER = {
|
const CATEGORY_ORDER = {
|
||||||
resources: 0,
|
resources: 0,
|
||||||
navigation: 1,
|
navigation: 1,
|
||||||
@@ -58,13 +63,26 @@ function formatHref(href: string) {
|
|||||||
return href.replace(/^https?:\/\//, "").replace(/\/$/, "");
|
return href.replace(/^https?:\/\//, "").replace(/\/$/, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function LinksContent() {
|
function parseCategoryFilter(value?: string): CategoryFilter {
|
||||||
|
if (value === "navigation" || value === "social" || value === "resources") {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "all";
|
||||||
|
}
|
||||||
|
|
||||||
|
export function LinksContent({
|
||||||
|
initialCategory,
|
||||||
|
initialQuery = "",
|
||||||
|
}: LinksContentProps) {
|
||||||
const t = useTranslations("Links");
|
const t = useTranslations("Links");
|
||||||
const tNav = useTranslations("Nav");
|
const tNav = useTranslations("Nav");
|
||||||
const locale = useLocale();
|
const locale = useLocale();
|
||||||
|
|
||||||
const [activeCategory, setActiveCategory] = useState<CategoryFilter>("all");
|
const [activeCategory, setActiveCategory] = useState<CategoryFilter>(() =>
|
||||||
const [query, setQuery] = useState("");
|
parseCategoryFilter(initialCategory),
|
||||||
|
);
|
||||||
|
const [query, setQuery] = useState(initialQuery);
|
||||||
|
|
||||||
const filterItems = useMemo(() => [
|
const filterItems = useMemo(() => [
|
||||||
{ id: "all" as const, label: t("allCategories") },
|
{ id: "all" as const, label: t("allCategories") },
|
||||||
|
|||||||
+186
-15
@@ -5,7 +5,7 @@ import dynamic from "next/dynamic";
|
|||||||
import { Link, usePathname } from "@/i18n/routing";
|
import { Link, usePathname } from "@/i18n/routing";
|
||||||
import { useLocale, useTranslations } from "next-intl";
|
import { useLocale, useTranslations } from "next-intl";
|
||||||
import { LanguageSwitcher } from "@/components/language-switcher";
|
import { LanguageSwitcher } from "@/components/language-switcher";
|
||||||
import { useState } from "react";
|
import { Fragment, useState } from "react";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
ButtonIcon,
|
ButtonIcon,
|
||||||
@@ -35,7 +35,13 @@ import {
|
|||||||
} from "poyraz-ui/molecules";
|
} from "poyraz-ui/molecules";
|
||||||
import { NavbarTopBar, NavbarTopBarSection } from "poyraz-ui/organisms";
|
import { NavbarTopBar, NavbarTopBarSection } from "poyraz-ui/organisms";
|
||||||
import { useKeyboardShortcutLabel } from "@/lib/use-keyboard-shortcut-label";
|
import { useKeyboardShortcutLabel } from "@/lib/use-keyboard-shortcut-label";
|
||||||
import { getResumeHref, NAV_LINKS, SOCIAL_LINKS, TOP_ICON_LINKS } from "@/lib/links";
|
import {
|
||||||
|
getResumeHref,
|
||||||
|
NAV_DROPDOWN_GROUPS,
|
||||||
|
NAV_LINKS,
|
||||||
|
SOCIAL_LINKS,
|
||||||
|
TOP_ICON_LINKS,
|
||||||
|
} from "@/lib/links";
|
||||||
import type { ThemeMode } from "@/components/app-shell";
|
import type { ThemeMode } from "@/components/app-shell";
|
||||||
|
|
||||||
const SearchCommand = dynamic(
|
const SearchCommand = dynamic(
|
||||||
@@ -88,6 +94,8 @@ type SiteNavbarProps = ThemeToggleProps;
|
|||||||
export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const [searchOpen, setSearchOpen] = useState(false);
|
const [searchOpen, setSearchOpen] = useState(false);
|
||||||
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
||||||
|
const [mobileMenuGroupId, setMobileMenuGroupId] = useState<string | null>(null);
|
||||||
const shortcut = useKeyboardShortcutLabel();
|
const shortcut = useKeyboardShortcutLabel();
|
||||||
const t = useTranslations("Nav");
|
const t = useTranslations("Nav");
|
||||||
const locale = useLocale();
|
const locale = useLocale();
|
||||||
@@ -98,14 +106,22 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const activeTab = NAV_LINKS.find((item) => isActiveLink(item.href))?.id;
|
const activeTab = NAV_LINKS.find((item) => isActiveLink(item.href))?.id;
|
||||||
|
const activeMobileMenuGroup = NAV_DROPDOWN_GROUPS.find(
|
||||||
|
(group) => group.id === mobileMenuGroupId,
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleMobileMenuOpenChange = (open: boolean) => {
|
||||||
|
setMobileMenuOpen(open);
|
||||||
|
if (!open) setMobileMenuGroupId(null);
|
||||||
|
};
|
||||||
const languageLabel = locale === "tr" ? "Switch to English" : "Türkçe'ye geç";
|
const languageLabel = locale === "tr" ? "Switch to English" : "Türkçe'ye geç";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-3">
|
<div className="min-w-0 space-y-3">
|
||||||
<TooltipProvider delayDuration={180}>
|
<TooltipProvider delayDuration={180}>
|
||||||
<NavbarTopBar
|
<NavbarTopBar
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
className="border-0 bg-transparent p-0 shadow-none"
|
className="border-0 bg-transparent p-0 shadow-none [&>div]:max-w-none [&>div]:px-0"
|
||||||
>
|
>
|
||||||
<NavbarTopBarSection align="end" className="gap-2">
|
<NavbarTopBarSection align="end" className="gap-2">
|
||||||
{TOP_ICON_LINKS.map((item) => {
|
{TOP_ICON_LINKS.map((item) => {
|
||||||
@@ -161,11 +177,11 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
</NavbarTopBar>
|
</NavbarTopBar>
|
||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
|
|
||||||
<header className="flex items-center justify-between gap-3 border-b border-border pb-4">
|
<header className="flex min-w-0 items-center justify-between gap-3 border-b border-border pb-4">
|
||||||
<Link
|
<Link
|
||||||
href="/"
|
href="/"
|
||||||
aria-label="Ana sayfaya git"
|
aria-label="Ana sayfaya git"
|
||||||
className="inline-flex items-center"
|
className="inline-flex shrink-0 items-center"
|
||||||
>
|
>
|
||||||
<Logo
|
<Logo
|
||||||
src="/logo/logo.png"
|
src="/logo/logo.png"
|
||||||
@@ -179,8 +195,8 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<div className="hidden items-center gap-3 md:flex">
|
<div className="hidden min-w-0 flex-1 items-center justify-end gap-2 min-[840px]:flex">
|
||||||
<Tabs value={activeTab ?? ""} className="w-auto">
|
<Tabs value={activeTab ?? ""} className="w-auto shrink-0">
|
||||||
<TabsList
|
<TabsList
|
||||||
variant="line"
|
variant="line"
|
||||||
radius="sm"
|
radius="sm"
|
||||||
@@ -188,7 +204,8 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
aria-label="Ana navigasyon"
|
aria-label="Ana navigasyon"
|
||||||
>
|
>
|
||||||
{NAV_LINKS.map((item, index) => (
|
{NAV_LINKS.map((item, index) => (
|
||||||
<div key={item.id} className="flex items-center gap-1.5">
|
<Fragment key={item.id}>
|
||||||
|
<div className="flex items-center gap-1.5">
|
||||||
{index > 0 && (
|
{index > 0 && (
|
||||||
<Separator
|
<Separator
|
||||||
orientation="vertical"
|
orientation="vertical"
|
||||||
@@ -206,13 +223,75 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
<Link href={item.href}>{t(item.id)}</Link>
|
<Link href={item.href}>{t(item.id)}</Link>
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{NAV_DROPDOWN_GROUPS.filter(
|
||||||
|
(group) => group.insertAfter === item.id,
|
||||||
|
).map((group) => (
|
||||||
|
<div key={group.id} className="flex items-center gap-1.5">
|
||||||
|
<Separator
|
||||||
|
orientation="vertical"
|
||||||
|
className="h-4 bg-border/70"
|
||||||
|
decorative
|
||||||
|
/>
|
||||||
|
<DropdownMenu interaction="click">
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className={`${getNavLinkClass(
|
||||||
|
group.items.some(
|
||||||
|
(groupItem) =>
|
||||||
|
!groupItem.external &&
|
||||||
|
isActiveLink(groupItem.href.split("?")[0]),
|
||||||
|
),
|
||||||
|
)} h-9 cursor-pointer items-center gap-1 px-2.5`}
|
||||||
|
>
|
||||||
|
<span>{t(group.id)}</span>
|
||||||
|
<Icon icon="mdi:chevron-down" width={14} height={14} />
|
||||||
|
</button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent
|
||||||
|
align="end"
|
||||||
|
surface="solid"
|
||||||
|
radius="md"
|
||||||
|
itemSize="md"
|
||||||
|
itemRadius="sm"
|
||||||
|
className="w-56 bg-popover"
|
||||||
|
>
|
||||||
|
{group.items.map((groupItem) => (
|
||||||
|
<DropdownMenuItem key={groupItem.id} asChild>
|
||||||
|
{groupItem.external ? (
|
||||||
|
<a
|
||||||
|
href={groupItem.href}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="flex items-center gap-2"
|
||||||
|
>
|
||||||
|
<Icon icon={groupItem.icon} width={16} height={16} />
|
||||||
|
<span>{t(groupItem.id)}</span>
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<Link
|
||||||
|
href={groupItem.href}
|
||||||
|
className="flex items-center gap-2"
|
||||||
|
>
|
||||||
|
<Icon icon={groupItem.icon} width={16} height={16} />
|
||||||
|
<span>{t(groupItem.id)}</span>
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
|
</DropdownMenuItem>
|
||||||
|
))}
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</Fragment>
|
||||||
))}
|
))}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
<Separator
|
<Separator
|
||||||
orientation="vertical"
|
orientation="vertical"
|
||||||
className="h-5 bg-border"
|
className="h-5 shrink-0 bg-border"
|
||||||
decorative
|
decorative
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
@@ -221,7 +300,7 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
radius="sm"
|
radius="sm"
|
||||||
effect="shine"
|
effect="shine"
|
||||||
onClick={() => setSearchOpen(true)}
|
onClick={() => setSearchOpen(true)}
|
||||||
className={`h-9 w-44 cursor-pointer justify-between px-3 text-sm sm:w-52 ${slowShineClassName}`}
|
className={`h-9 w-auto cursor-pointer px-3 text-sm ${slowShineClassName}`}
|
||||||
aria-label={t("search")}
|
aria-label={t("search")}
|
||||||
>
|
>
|
||||||
<ButtonIcon>
|
<ButtonIcon>
|
||||||
@@ -273,7 +352,7 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-2 md:hidden">
|
<div className="flex items-center gap-2 min-[840px]:hidden">
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
@@ -287,7 +366,7 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
<Icon icon="mdi:magnify" width={16} height={16} />
|
<Icon icon="mdi:magnify" width={16} height={16} />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Sheet>
|
<Sheet open={mobileMenuOpen} onOpenChange={handleMobileMenuOpenChange}>
|
||||||
<SheetTrigger asChild>
|
<SheetTrigger asChild>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -303,8 +382,76 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
</Button>
|
</Button>
|
||||||
</SheetTrigger>
|
</SheetTrigger>
|
||||||
<SheetContent side="right" className="w-72 p-4">
|
<SheetContent side="right" className="w-72 p-4">
|
||||||
<SheetTitle className="sr-only">{t("mobileMenu")}</SheetTitle>
|
{activeMobileMenuGroup ? (
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
|
<div className="flex min-h-9 items-center gap-2 pr-9">
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="secondary"
|
||||||
|
size="icon-sm"
|
||||||
|
radius="sm"
|
||||||
|
effect="shine"
|
||||||
|
className={`shrink-0 cursor-pointer ${slowShineClassName}`}
|
||||||
|
aria-label={t("backToMenu")}
|
||||||
|
onClick={() => setMobileMenuGroupId(null)}
|
||||||
|
>
|
||||||
|
<Icon icon="mdi:chevron-left" width={18} height={18} />
|
||||||
|
</Button>
|
||||||
|
<SheetTitle className="truncate text-base font-medium">
|
||||||
|
{t(activeMobileMenuGroup.id)}
|
||||||
|
</SheetTitle>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Separator className="bg-border" decorative />
|
||||||
|
|
||||||
|
<nav aria-label={t(activeMobileMenuGroup.id)}>
|
||||||
|
<ul className="space-y-1">
|
||||||
|
{activeMobileMenuGroup.items.map((groupItem) => (
|
||||||
|
<li key={groupItem.id}>
|
||||||
|
{groupItem.external ? (
|
||||||
|
<SheetClose asChild>
|
||||||
|
<a
|
||||||
|
href={groupItem.href}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer"
|
||||||
|
className="flex min-h-10 w-full items-center gap-3 rounded-sm px-2 py-2 text-sm text-foreground/70 transition-colors hover:bg-muted hover:text-foreground"
|
||||||
|
>
|
||||||
|
<Icon icon={groupItem.icon} width={18} height={18} />
|
||||||
|
<span>{t(groupItem.id)}</span>
|
||||||
|
<Icon
|
||||||
|
icon="mdi:open-in-new"
|
||||||
|
width={14}
|
||||||
|
height={14}
|
||||||
|
className="ml-auto text-muted-foreground"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
</SheetClose>
|
||||||
|
) : (
|
||||||
|
<SheetClose asChild>
|
||||||
|
<Link
|
||||||
|
href={groupItem.href}
|
||||||
|
className="flex min-h-10 w-full items-center gap-3 rounded-sm px-2 py-2 text-sm text-foreground/70 transition-colors hover:bg-muted hover:text-foreground"
|
||||||
|
>
|
||||||
|
<Icon icon={groupItem.icon} width={18} height={18} />
|
||||||
|
<span>{t(groupItem.id)}</span>
|
||||||
|
<Icon
|
||||||
|
icon="mdi:chevron-right"
|
||||||
|
width={16}
|
||||||
|
height={16}
|
||||||
|
className="ml-auto text-muted-foreground"
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
</SheetClose>
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="flex flex-col gap-4">
|
||||||
|
<SheetTitle className="sr-only">{t("mobileMenu")}</SheetTitle>
|
||||||
|
|
||||||
<SheetClose asChild>
|
<SheetClose asChild>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -330,7 +477,8 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
<nav aria-label="Mobil navigasyon">
|
<nav aria-label="Mobil navigasyon">
|
||||||
<ul className="space-y-2">
|
<ul className="space-y-2">
|
||||||
{NAV_LINKS.map((item) => (
|
{NAV_LINKS.map((item) => (
|
||||||
<li key={item.id}>
|
<Fragment key={item.id}>
|
||||||
|
<li>
|
||||||
<SheetClose asChild>
|
<SheetClose asChild>
|
||||||
<Link
|
<Link
|
||||||
href={item.href}
|
href={item.href}
|
||||||
@@ -340,6 +488,28 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
</Link>
|
</Link>
|
||||||
</SheetClose>
|
</SheetClose>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
{NAV_DROPDOWN_GROUPS.filter(
|
||||||
|
(group) => group.insertAfter === item.id,
|
||||||
|
).map((group) => (
|
||||||
|
<li key={group.id}>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className={`${getNavLinkClass(
|
||||||
|
group.items.some(
|
||||||
|
(groupItem) =>
|
||||||
|
!groupItem.external &&
|
||||||
|
isActiveLink(groupItem.href.split("?")[0]),
|
||||||
|
),
|
||||||
|
)} w-full cursor-pointer items-center justify-between gap-3 text-left`}
|
||||||
|
onClick={() => setMobileMenuGroupId(group.id)}
|
||||||
|
>
|
||||||
|
<span>{t(group.id)}</span>
|
||||||
|
<Icon icon="mdi:chevron-right" width={16} height={16} />
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</Fragment>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -361,6 +531,7 @@ export function SiteNavbar({ theme, onThemeChange }: SiteNavbarProps) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</SheetContent>
|
</SheetContent>
|
||||||
</Sheet>
|
</Sheet>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
import { REFERENCES } from "@/data/references";
|
import { REFERENCES } from "@/data/references";
|
||||||
import { VOLUNTEER_COMMUNITY_ITEMS } from "@/data/volunteer-community";
|
import { VOLUNTEER_COMMUNITY_ITEMS } from "@/data/volunteer-community";
|
||||||
import { YOUTUBE_VIDEO_LINKS } from "@/data/youtube-videos";
|
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";
|
import { getLocalizedValue } from "@/lib/locale";
|
||||||
|
|
||||||
export type CommandPaletteItem = {
|
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[] = [
|
const blogItems: CommandPaletteItem[] = [
|
||||||
{
|
{
|
||||||
id: "blog-index",
|
id: "blog-index",
|
||||||
@@ -281,6 +296,7 @@ export function getCommandPaletteGroups(
|
|||||||
heading: locale === "tr" ? "İçerikler" : "Contents",
|
heading: locale === "tr" ? "İçerikler" : "Contents",
|
||||||
items: contentItems,
|
items: contentItems,
|
||||||
},
|
},
|
||||||
|
...dropdownGroups,
|
||||||
{
|
{
|
||||||
id: "social",
|
id: "social",
|
||||||
heading: "Social",
|
heading: "Social",
|
||||||
|
|||||||
@@ -70,6 +70,52 @@ export const SOCIAL_LINKS = [
|
|||||||
},
|
},
|
||||||
] as const;
|
] 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 = [
|
export const TOP_ICON_LINKS = [
|
||||||
{
|
{
|
||||||
id: "ui-kit",
|
id: "ui-kit",
|
||||||
@@ -145,6 +191,23 @@ export const LINK_DIRECTORY: LinkDirectoryItem[] = [
|
|||||||
category: "social" as const,
|
category: "social" as const,
|
||||||
keywords: [item.label, item.href, "sosyal", "profile", "platform"],
|
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) => ({
|
...TOP_ICON_LINKS.map((item) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
label: item.label,
|
label: item.label,
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
"search": "Search",
|
"search": "Search",
|
||||||
"social": "Social",
|
"social": "Social",
|
||||||
"socialLinks": "Social Links",
|
"socialLinks": "Social Links",
|
||||||
|
"others": "Others",
|
||||||
|
"animationResources": "Animation Resources",
|
||||||
|
"backToMenu": "Back to menu",
|
||||||
"menu": "Menu",
|
"menu": "Menu",
|
||||||
"mobileMenu": "Mobile Menu",
|
"mobileMenu": "Mobile Menu",
|
||||||
"resume": "Resume"
|
"resume": "Resume"
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
"search": "Ara",
|
"search": "Ara",
|
||||||
"social": "Sosyal",
|
"social": "Sosyal",
|
||||||
"socialLinks": "Sosyal Bağlantılar",
|
"socialLinks": "Sosyal Bağlantılar",
|
||||||
|
"others": "Diğerleri",
|
||||||
|
"animationResources": "Animasyon Kaynakları",
|
||||||
|
"backToMenu": "Menüye dön",
|
||||||
"menu": "Menü",
|
"menu": "Menü",
|
||||||
"mobileMenu": "Mobil Menü",
|
"mobileMenu": "Mobil Menü",
|
||||||
"resume": "Özgeçmiş"
|
"resume": "Özgeçmiş"
|
||||||
|
|||||||
Reference in New Issue
Block a user