eb424d8c04
Mobile:
- Recipes search bar full-width on mobile instead of capped narrow
- Cook mode ingredients panel stacks above the step instead of
squeezing it into a narrow column
- Version history Compare/Restore buttons wrap onto their own row
- Recipe edit ingredient fields wrap instead of forcing horizontal
scroll on narrow viewports
i18n: translates remaining hardcoded strings across recipes
filter/sort, adapt-recipe and AI variations dialogs, the full
settings section (sidebar + 6 sub-pages + BYOK/model-prefs/
API-keys/webhooks managers), explore tab, collections (new/fork/
share dialogs), meal planning (planner, AI generation phases, new
shopping list, shared-plan view), photo import, recipe bulk-select
toolbar, and recipe action-button tooltips. Also fixes the recipes
page subtitle, which wasn't just unworded but missing its {count}
interpolation entirely — it always rendered as the bare word
"results" regardless of how many recipes existed.
Feature: adds a ShareRecipeButton that copies the public /r/{id}
link to the clipboard, with a notice when the recipe isn't Public
yet.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
49 lines
1.7 KiB
TypeScript
49 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { usePathname } from "next/navigation";
|
|
import { useTranslations } from "next-intl";
|
|
import { User, Shield, Bot, Bell, Apple, Key, Webhook } from "lucide-react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
const NAV_ITEMS = [
|
|
{ href: "/settings", key: "profile", icon: User, exact: true },
|
|
{ href: "/settings/security", key: "security", icon: Shield, exact: false },
|
|
{ href: "/settings/ai", key: "aiModels", icon: Bot, exact: false },
|
|
{ href: "/settings/notifications", key: "notifications", icon: Bell, exact: false },
|
|
{ href: "/settings/nutrition", key: "nutrition", icon: Apple, exact: false },
|
|
{ href: "/settings/api-keys", key: "apiKeys", icon: Key, exact: false },
|
|
{ href: "/settings/webhooks", key: "webhooks", icon: Webhook, exact: false },
|
|
] as const;
|
|
|
|
export function SettingsSidebar() {
|
|
const pathname = usePathname();
|
|
const t = useTranslations("settings");
|
|
|
|
return (
|
|
<nav className="w-48 shrink-0 sticky top-6">
|
|
<ul className="space-y-0.5">
|
|
{NAV_ITEMS.map(({ href, key, icon: Icon, exact }) => {
|
|
const active = exact ? pathname === href : pathname.startsWith(href);
|
|
return (
|
|
<li key={href}>
|
|
<Link
|
|
href={href}
|
|
className={cn(
|
|
"flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-colors",
|
|
active
|
|
? "bg-accent text-accent-foreground font-medium"
|
|
: "text-muted-foreground hover:text-foreground hover:bg-accent/50"
|
|
)}
|
|
>
|
|
<Icon className="h-4 w-4 shrink-0" />
|
|
{t(key)}
|
|
</Link>
|
|
</li>
|
|
);
|
|
})}
|
|
</ul>
|
|
</nav>
|
|
);
|
|
}
|