App reorganization
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { memo } from "react";
|
||||
import { usePathname } from "next/navigation";
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
// Code split Footer - below the fold, can be lazy loaded
|
||||
const Footer = dynamic(() => import("./Footer"), {
|
||||
loading: () => (
|
||||
<footer className="bg-[var(--color-surface-default-primary)] w-full min-h-[200px]" />
|
||||
),
|
||||
ssr: true, // Keep SSR for SEO
|
||||
});
|
||||
|
||||
/**
|
||||
* Conditionally renders Footer based on pathname.
|
||||
* Hides footer for /create/* and /login (full-screen flows; no site chrome).
|
||||
*/
|
||||
const ConditionalFooter = memo(() => {
|
||||
const pathname = usePathname();
|
||||
const isCreateFlow = pathname?.startsWith("/create");
|
||||
const isLogin = pathname === "/login";
|
||||
|
||||
if (isCreateFlow || isLogin) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <Footer />;
|
||||
});
|
||||
|
||||
ConditionalFooter.displayName = "ConditionalFooter";
|
||||
|
||||
export default ConditionalFooter;
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { memo } from "react";
|
||||
import { useTranslation } from "../../contexts/MessagesContext";
|
||||
import { normalizeMenuBarSize } from "../../../lib/propNormalization";
|
||||
|
||||
export type MenuBarSizeValue =
|
||||
| "X Small"
|
||||
@@ -23,7 +22,7 @@ interface MenuBarProps extends React.HTMLAttributes<HTMLElement> {
|
||||
|
||||
const MenuBar = memo<MenuBarProps>(
|
||||
({ children, className = "", size: sizeProp = "X Small", ...props }) => {
|
||||
const size = normalizeMenuBarSize(sizeProp);
|
||||
const size = sizeProp ?? "X Small";
|
||||
const t = useTranslation("menuBar");
|
||||
|
||||
// Size styles based on Figma specifications
|
||||
|
||||
@@ -3,11 +3,6 @@
|
||||
import { memo } from "react";
|
||||
import MenuBarItemView from "./MenuBarItem.view";
|
||||
import type { MenuBarItemProps } from "./MenuBarItem.types";
|
||||
import {
|
||||
normalizeMenuBarItemState,
|
||||
normalizeMenuBarItemMode,
|
||||
normalizeMenuBarItemSize,
|
||||
} from "../../../../lib/propNormalization";
|
||||
|
||||
const MenuBarItemContainer = memo<MenuBarItemProps>(
|
||||
({
|
||||
@@ -24,9 +19,9 @@ const MenuBarItemContainer = memo<MenuBarItemProps>(
|
||||
ariaLabel,
|
||||
...props
|
||||
}) => {
|
||||
const state = normalizeMenuBarItemState(stateProp, "default");
|
||||
const mode = normalizeMenuBarItemMode(modeProp, "default");
|
||||
const size = normalizeMenuBarItemSize(sizeProp, "X Small");
|
||||
const state = stateProp ?? "default";
|
||||
const mode = modeProp ?? "default";
|
||||
const size = sizeProp ?? "X Small";
|
||||
|
||||
// Size styles based on Figma specifications
|
||||
const sizeStyles: Record<
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
import { memo } from "react";
|
||||
import NavigationItemView from "./NavigationItem.view";
|
||||
import type { NavigationItemProps } from "./NavigationItem.types";
|
||||
import {
|
||||
normalizeNavigationItemVariant,
|
||||
normalizeNavigationItemSize,
|
||||
} from "../../../../lib/propNormalization";
|
||||
|
||||
const NavigationItemContainer = memo<NavigationItemProps>(
|
||||
({
|
||||
@@ -19,9 +15,8 @@ const NavigationItemContainer = memo<NavigationItemProps>(
|
||||
isActive = false,
|
||||
...props
|
||||
}) => {
|
||||
// Normalize props to handle both PascalCase (Figma) and lowercase (codebase)
|
||||
const variant = normalizeNavigationItemVariant(variantProp);
|
||||
const size = normalizeNavigationItemSize(sizeProp);
|
||||
const variant = variantProp;
|
||||
const size = sizeProp;
|
||||
// Variant styles
|
||||
const variantStyles: Record<string, string> = {
|
||||
default:
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
export type NavigationItemVariantValue = "default" | "Default";
|
||||
export type NavigationItemSizeValue =
|
||||
| "default"
|
||||
| "xsmall"
|
||||
| "Default"
|
||||
| "XSmall";
|
||||
export type NavigationItemVariantValue = "default";
|
||||
export type NavigationItemSizeValue = "default" | "xsmall";
|
||||
|
||||
export interface NavigationItemProps extends Omit<
|
||||
React.AnchorHTMLAttributes<HTMLAnchorElement>,
|
||||
@@ -12,13 +8,11 @@ export interface NavigationItemProps extends Omit<
|
||||
href?: string;
|
||||
children?: React.ReactNode;
|
||||
/**
|
||||
* Navigation item variant. Accepts both lowercase and PascalCase (case-insensitive).
|
||||
* Figma uses PascalCase, codebase uses lowercase - both are supported.
|
||||
* Navigation item variant.
|
||||
*/
|
||||
variant?: NavigationItemVariantValue;
|
||||
/**
|
||||
* Navigation item size. Accepts both lowercase and PascalCase (case-insensitive).
|
||||
* Figma uses PascalCase, codebase uses lowercase - both are supported.
|
||||
* Navigation item size.
|
||||
*/
|
||||
size?: NavigationItemSizeValue;
|
||||
className?: string;
|
||||
|
||||
Reference in New Issue
Block a user