feat: add visual theme indicators and fix logo colors for dev/staging environments
This commit is contained in:
@@ -10,6 +10,9 @@ interface SecuirdLogoProps {
|
||||
* Secuird Logo - Abstract gate/doorway mark
|
||||
* Represents controlled entry and policy enforcement
|
||||
* Two vertical pillars forming a gateway with negative space
|
||||
*
|
||||
* Uses inline styles for theme colors to ensure they work correctly
|
||||
* across all theme configurations (default, dev, preprod)
|
||||
*/
|
||||
export function SecuirdLogo({
|
||||
size = "md",
|
||||
@@ -22,31 +25,38 @@ export function SecuirdLogo({
|
||||
lg: "w-12 h-12",
|
||||
};
|
||||
|
||||
const bgClasses = {
|
||||
default: "bg-primary",
|
||||
light: "bg-sidebar-primary",
|
||||
// Use inline styles for theme colors to ensure they work at runtime
|
||||
const getBgStyle = () => {
|
||||
if (variant === "light") {
|
||||
return {
|
||||
backgroundColor: "hsl(var(--theme-sidebar-primary, 173 65% 36%))",
|
||||
color: "hsl(var(--theme-sidebar-primary-foreground, 0 0% 100%))"
|
||||
};
|
||||
}
|
||||
return {
|
||||
backgroundColor: "hsl(var(--theme-primary, 173 65% 36%))",
|
||||
color: "hsl(var(--theme-primary-foreground, 0 0% 100%))"
|
||||
};
|
||||
};
|
||||
|
||||
const iconColor = variant === "light"
|
||||
? "text-sidebar-primary-foreground"
|
||||
: "text-primary-foreground";
|
||||
|
||||
const bgStyle = getBgStyle();
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"rounded-lg flex items-center justify-center flex-shrink-0",
|
||||
sizeClasses[size],
|
||||
bgClasses[variant],
|
||||
className
|
||||
)}
|
||||
style={bgStyle}
|
||||
>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
className={cn(
|
||||
iconColor,
|
||||
size === "sm" ? "w-4 h-4" : size === "md" ? "w-5 h-5" : "w-6 h-6"
|
||||
)}
|
||||
style={{ color: bgStyle.color }}
|
||||
>
|
||||
{/* Abstract gate - two pillars with archway */}
|
||||
<path
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import { config } from "@/config";
|
||||
|
||||
interface ThemeIndicatorProps {
|
||||
showBanner?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Visual theme indicator - shows environment name and color
|
||||
* Appears as a banner in dev/preprod modes
|
||||
*/
|
||||
export function ThemeIndicator({ showBanner = true, className }: ThemeIndicatorProps) {
|
||||
const theme = config.theme.name;
|
||||
const appName = config.app.name;
|
||||
|
||||
// Only show for non-default themes
|
||||
if (theme === "default") {
|
||||
return null;
|
||||
}
|
||||
|
||||
const themeLabels: Record<string, string> = {
|
||||
dev: "Development Environment",
|
||||
preprod: "Staging / Pre-Production",
|
||||
};
|
||||
|
||||
const themeLabel = themeLabels[theme] || theme;
|
||||
|
||||
if (showBanner) {
|
||||
return (
|
||||
<div className="env-banner">
|
||||
{themeLabel} — {appName}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<span className={`theme-badge ${className || ""}`}>
|
||||
<span className="env-indicator" />
|
||||
{themeLabel}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
@@ -3,11 +3,13 @@ import { SidebarProvider } from "@/components/ui/sidebar";
|
||||
import { AppSidebar } from "@/components/navigation/AppSidebar";
|
||||
import { TopBar } from "@/components/navigation/TopBar";
|
||||
import ApiDevTools from "@/components/dev/ApiDevTools";
|
||||
import { ThemeIndicator } from "@/components/branding/ThemeIndicator";
|
||||
|
||||
export default function AuthenticatedLayout() {
|
||||
return (
|
||||
<SidebarProvider>
|
||||
<div className="min-h-screen flex w-full bg-background">
|
||||
<ThemeIndicator />
|
||||
<div className="min-h-screen flex w-full bg-background pt-8">
|
||||
<AppSidebar />
|
||||
<div className="flex-1 flex flex-col min-w-0">
|
||||
<TopBar />
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { Link, Outlet, useLocation } from "react-router-dom";
|
||||
import { SecuirdLogo as GatehouseLogo } from "@/components/branding/SecuirdLogo";
|
||||
import { ThemeIndicator } from "@/components/branding/ThemeIndicator";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { config } from "@/config";
|
||||
import { cn } from "@/lib/utils";
|
||||
import {
|
||||
Shield,
|
||||
Key,
|
||||
CreditCard,
|
||||
Play,
|
||||
Lock,
|
||||
Menu,
|
||||
X
|
||||
Shield,
|
||||
Key,
|
||||
CreditCard,
|
||||
Play,
|
||||
Lock,
|
||||
Menu,
|
||||
X
|
||||
} from "lucide-react";
|
||||
import { useState } from "react";
|
||||
|
||||
@@ -29,8 +30,11 @@ const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-background flex flex-col">
|
||||
{/* Theme indicator banner for dev/staging */}
|
||||
<ThemeIndicator />
|
||||
|
||||
{/* Header */}
|
||||
<header className="sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
||||
<header className="sticky top-8 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 marketing-header">
|
||||
<nav className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||
<div className="flex h-16 items-center justify-between">
|
||||
{/* Logo */}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
import { Outlet, Link } from "react-router-dom";
|
||||
import { SecuirdLogo } from "@/components/branding/SecuirdLogo";
|
||||
import { ThemeIndicator } from "@/components/branding/ThemeIndicator";
|
||||
import { config } from "@/config";
|
||||
|
||||
export default function PublicLayout() {
|
||||
return (
|
||||
<div className="min-h-screen bg-background flex flex-col">
|
||||
{/* Theme indicator banner for dev/staging */}
|
||||
<ThemeIndicator />
|
||||
|
||||
{/* Subtle gradient background */}
|
||||
<div className="fixed inset-0 bg-gradient-to-br from-background via-background to-secondary/30 pointer-events-none" />
|
||||
|
||||
{/* Header */}
|
||||
<header className="relative z-10 w-full py-6 px-4">
|
||||
{/* Header with theme-colored border */}
|
||||
<header className="relative z-10 w-full py-6 px-4 marketing-header">
|
||||
<div className="max-w-md mx-auto">
|
||||
<Link to="/" className="flex items-center gap-2.5 justify-center">
|
||||
<SecuirdLogo size="md" />
|
||||
|
||||
Reference in New Issue
Block a user