Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31dc72b1c8 | ||
|
|
10600b48c4 |
@@ -30,7 +30,7 @@ export default async function SiteLayout({ children, params }: SiteLayoutProps)
|
|||||||
getSiteSettings(),
|
getSiteSettings(),
|
||||||
]);
|
]);
|
||||||
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
const localeKey = resolveLocale(await getLocale().catch(() => siteSettings.defaultLocale), siteSettings.defaultLocale);
|
||||||
// Server-side decision only. The header receives just this boolean and uses
|
// Server-side decision only. The dock receives just this boolean and uses
|
||||||
// it purely to show/hide the Admin shortcut link — it grants no access by
|
// it purely to show/hide the Admin shortcut link — it grants no access by
|
||||||
// itself. Every admin page/action re-checks the session independently, so
|
// itself. Every admin page/action re-checks the session independently, so
|
||||||
// this value is not a security boundary, only a UI convenience.
|
// this value is not a security boundary, only a UI convenience.
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { ShieldCheck } from "lucide-react";
|
||||||
|
import { useLocale } from "next-intl";
|
||||||
|
|
||||||
|
import { buildAdminUrl } from "@/lib/admin-routing";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
export function FloatingAdminButton() {
|
||||||
|
const locale = useLocale();
|
||||||
|
const isRtl = locale === "ar";
|
||||||
|
|
||||||
|
return (
|
||||||
|
<a
|
||||||
|
href={buildAdminUrl("/")}
|
||||||
|
aria-label="Admin"
|
||||||
|
className={cn(
|
||||||
|
"fixed bottom-5 z-50 flex h-11 w-11 items-center justify-center rounded-full border border-border/70 bg-background/90 text-foreground/70 shadow-lg backdrop-blur-chrome transition-all hover:scale-105 hover:bg-accent hover:text-foreground hover:shadow-xl",
|
||||||
|
isRtl ? "left-5" : "right-5",
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<ShieldCheck className="h-5 w-5" />
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user