Navigation, state management, create rule button integration

This commit is contained in:
adilallo
2026-03-02 22:40:29 -07:00
parent 3e3d2881f5
commit 3a3e54d455
17 changed files with 370 additions and 139 deletions
+12 -2
View File
@@ -1,5 +1,6 @@
"use client";
import { useState, useEffect } from "react";
import { useMediaQuery } from "../../hooks/useMediaQuery";
import HeaderLockup from "../../components/type/HeaderLockup";
import Upload from "../../components/controls/Upload";
@@ -12,8 +13,17 @@ import Upload from "../../components/controls/Upload";
* Responsive sizing: uses L/M for HeaderLockup based on 640px breakpoint.
*/
export default function UploadPage() {
const [isMounted, setIsMounted] = useState(false);
const isMdOrLarger = useMediaQuery("(min-width: 640px)");
// Avoid flash: only use breakpoint after mount so SSR and first paint use same layout (desktop).
useEffect(() => {
// eslint-disable-next-line react-hooks/set-state-in-effect -- intentional: defer layout breakpoint until after mount to prevent flash
setIsMounted(true);
}, []);
const effectiveMdOrLarger = !isMounted || isMdOrLarger;
const handleUploadClick = () => {
// TODO: Handle upload button click (e.g. open file picker)
};
@@ -25,8 +35,8 @@ export default function UploadPage() {
<HeaderLockup
title="How should conflicts be resolved?"
description="This will be the name of your community"
justification={isMdOrLarger ? "center" : "left"}
size={isMdOrLarger ? "L" : "M"}
justification={effectiveMdOrLarger ? "center" : "left"}
size={effectiveMdOrLarger ? "L" : "M"}
/>
{/* Upload component: no label in create flow, max width 474px */}