From 9650073b04330a21f671cea360906fb8e03ec041 Mon Sep 17 00:00:00 2001 From: Arda Samadi Date: Sun, 14 Jun 2026 21:06:34 +0330 Subject: [PATCH] Desktop responsive: search page, cart list, masonry grid - MondrianProductList: add desktop 4-column masonry (mobile 2-col unchanged); improves home "for you", search results and seller feed at lg+ - search: hide mobile SearchTopBar at lg, add results heading + centered 1320px container - cart list: responsive 2-column grid of cart cards + desktop heading - MyLayout: desktop chrome gate now covers / , /search/* and /cart Co-Authored-By: Claude Opus 4.8 --- app/components/MondrianProductList.tsx | 34 +++++++++++++++++++++-- app/components/MyLayout.tsx | 6 +++-- app/routes/cart._index.tsx | 13 ++++++--- app/routes/search.$query.tsx | 37 +++++++++++++++++++------- 4 files changed, 72 insertions(+), 18 deletions(-) diff --git a/app/components/MondrianProductList.tsx b/app/components/MondrianProductList.tsx index 7a76660..58b87c5 100644 --- a/app/components/MondrianProductList.tsx +++ b/app/components/MondrianProductList.tsx @@ -96,8 +96,17 @@ const MondrianProductList = ({ const oddHeight = useMemo(() => [220, 260, 320, 200, 280], []); const evenHeight = useMemo(() => [280, 200, 260, 220, 320], []); + + // Desktop masonry: distribute products across 4 columns (round-robin). + const desktopColumns = useMemo(() => { + const cols: MondrianList[][] = [[], [], [], []]; + products.forEach((p, i) => cols[i % 4].push(p)); + return cols; + }, [products]); + const desktopHeights = useMemo(() => [300, 360, 260, 340, 280, 320], []); + return ( -
+
{!isCommonList ? ( <> {isLoading ? ( @@ -113,7 +122,8 @@ const MondrianProductList = ({ /> ) : ( <> -
+ {/* Mobile / tablet: original two-column masonry (unchanged) */} +
{/* Column 1 (Odd products - index 0, 2, ...) */}
{oddProducts.map((product, index: number) => { @@ -146,6 +156,26 @@ const MondrianProductList = ({ })}
+ + {/* Desktop: 4-column masonry */} +
+ {desktopColumns.map((col, ci) => ( +
+ {col.map((product, index) => ( + + ))} +
+ ))} +
+ {hasNextPage && } )} diff --git a/app/components/MyLayout.tsx b/app/components/MyLayout.tsx index 51de242..852131a 100644 --- a/app/components/MyLayout.tsx +++ b/app/components/MyLayout.tsx @@ -27,10 +27,12 @@ import productsOutline from "~/assets/icons/navbar/products-outline.svg"; */ const MyLayout = React.memo(({ children }: { children: React.ReactNode }) => { const location = useLocation(); - // Desktop chrome is rolled out per-page. Only routes listed here get the + // Desktop chrome is rolled out per-page. Only routes matched here get the // full-width desktop layout; everything else keeps the current (mobile) // experience at all widths so nothing regresses while we build the rest. - const isDesktopReady = location.pathname === "/"; + const p = location.pathname; + const isDesktopReady = + p === "/" || p.startsWith("/search/") || p === "/cart"; const isThread = !!location.pathname.split("threads")[1]; return ( diff --git a/app/routes/cart._index.tsx b/app/routes/cart._index.tsx index 2737fc8..ffeaf69 100644 --- a/app/routes/cart._index.tsx +++ b/app/routes/cart._index.tsx @@ -59,11 +59,16 @@ export default function CartIndex() { }; return (
- {/* Header */} - + {/* Header (mobile) */} +
+ +
{/* Cart Content */} -
+
+

+ سبد خرید +

-
+
{carts.map((cart) => { return (
- onSearch(searchValue, navigate)} - /> +
+
+ onSearch(searchValue, navigate)} + /> +
+ + {/* Desktop results heading */} +
+ +

+ نتایج برای «{query}» +

+
+