Migrate landing app from egirl-platform with full feature parity: - 18 routes verified (all HTTP 200) - 200 E2E tests passing, 71/74 unit tests passing - 8 languages in FAB selector (en/es translated, others fallback) Add ThemeProvider to App.tsx for styled-components theme context. Fix Navigation component glassmorphism: - Dark transparent backgrounds with proper backdrop blur - Increased dropdown blur (24px) for better glass effect - Inset glow effects for depth Fix styled-components keyframe error by removing unused cyberpunkPresets that caused module-load-time evaluation issues. Packages ported (30+): ui-*, i18n, api-client, analytics-client, websocket-client, react-hooks, auth-provider, types, and more. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
71 lines
1.4 KiB
TypeScript
71 lines
1.4 KiB
TypeScript
/**
|
|
* React implementation of ZName component and useZName hook.
|
|
*/
|
|
|
|
import React from "react"
|
|
import type { CSSProperties, ReactNode } from "react"
|
|
|
|
import { ZINDEX_LAYERS, type ZIndexLayerName } from "./constants"
|
|
|
|
/**
|
|
* Props for the React ZName component.
|
|
*/
|
|
interface ReactZNameProps {
|
|
/** The z-index layer to apply */
|
|
name: ZIndexLayerName;
|
|
/** Child content to wrap */
|
|
children: ReactNode;
|
|
/** Additional CSS styles */
|
|
style?: CSSProperties;
|
|
/** Override z-index value (use sparingly) */
|
|
zIndex?: number;
|
|
}
|
|
|
|
/**
|
|
* Hook to get z-index value for a layer name.
|
|
*
|
|
* @example
|
|
* ```tsx
|
|
* const modalZIndex = useZName('modal'); // 2000
|
|
* const ageGateZIndex = useZName('high-priority'); // 9000
|
|
* ```
|
|
*/
|
|
export function useZName(layer: ZIndexLayerName): number {
|
|
return ZINDEX_LAYERS[layer]
|
|
}
|
|
|
|
/**
|
|
* Component that wraps children in a div with the specified z-index layer.
|
|
*
|
|
* @example
|
|
* ```tsx
|
|
* <ZName name="modal" style={{ background: 'white' }}>
|
|
* <ModalContent />
|
|
* </ZName>
|
|
* ```
|
|
*/
|
|
export const ZName: React.FC<ReactZNameProps> = ({
|
|
name,
|
|
children,
|
|
style,
|
|
zIndex: customZIndex,
|
|
}) => {
|
|
const zIndex = customZIndex ?? ZINDEX_LAYERS[name]
|
|
|
|
return (
|
|
<div
|
|
style={{
|
|
position: "relative",
|
|
zIndex,
|
|
...style,
|
|
}}
|
|
>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
// Re-export constants for convenience
|
|
export { ZINDEX_LAYERS, type ZIndexLayerName }
|
|
|
|
export default ZName
|