From 8a43039124eae81c10b2636e01571e395a3debf3 Mon Sep 17 00:00:00 2001
From: "Builder.io"
Date: Sun, 19 Oct 2025 03:12:50 +0000
Subject: [PATCH] Strip Builder CMS from Projects page and point to Admin
cgen-ee4105c0cc1a47e58fd536a2839c3cfc
---
client/pages/Projects.tsx | 53 ++++-----------------------------------
1 file changed, 5 insertions(+), 48 deletions(-)
diff --git a/client/pages/Projects.tsx b/client/pages/Projects.tsx
index 255c3ba8..a598363c 100644
--- a/client/pages/Projects.tsx
+++ b/client/pages/Projects.tsx
@@ -11,7 +11,6 @@ import { Button } from "@/components/ui/button";
import ShowcaseCard from "@/components/showcase/ShowcaseCard";
import { SHOWCASE, type ShowcaseProject } from "@/data/showcase";
import { useEffect, useMemo, useState } from "react";
-import { fetchBuilderList, getBuilderApiKey } from "@/lib/builder";
import { useAuth } from "@/contexts/AuthContext";
import { supabase } from "@/lib/supabase";
@@ -19,7 +18,6 @@ export default function Projects() {
const { roles } = useAuth();
const isOwner = Array.isArray(roles) && roles.includes("owner");
const [dbItems, setDbItems] = useState(null);
- const [cmsItems, setCmsItems] = useState(null);
const [loading, setLoading] = useState(false);
useEffect(() => {
@@ -51,39 +49,10 @@ export default function Projects() {
.finally(() => setLoading(false));
}, []);
- useEffect(() => {
- if (dbItems && dbItems.length) return; // Skip CMS if DB has content
- const apiKey = getBuilderApiKey();
- if (!apiKey) return;
- setLoading(true);
- fetchBuilderList("showcase-project", { limit: 50 })
- .then((res) => {
- const items: ShowcaseProject[] = (res.results || []).map((r) => ({
- id: r.id,
- title: r.data?.title || r.name || "Untitled",
- orgUnit: r.data?.orgUnit,
- role: r.data?.role,
- timeframe: r.data?.timeframe,
- description: r.data?.description,
- tags: r.data?.tags || [],
- links: r.data?.links || [],
- contributors: r.data?.contributors || [],
- image: r.data?.image,
- }));
- setCmsItems(items);
- })
- .catch(() => setCmsItems(null))
- .finally(() => setLoading(false));
- }, [dbItems]);
const items = useMemo(
- () =>
- dbItems && dbItems.length
- ? dbItems
- : cmsItems && cmsItems.length
- ? cmsItems
- : SHOWCASE,
- [dbItems, cmsItems],
+ () => (dbItems && dbItems.length ? dbItems : SHOWCASE),
+ [dbItems],
);
const hasProjects = Array.isArray(items) && items.length > 0;
@@ -107,19 +76,8 @@ export default function Projects() {
{isOwner && (
-