diff --git a/frontend/components/dashboard/navbar/search.tsx b/frontend/components/dashboard/navbar/search.tsx index 65e731f..f254efe 100644 --- a/frontend/components/dashboard/navbar/search.tsx +++ b/frontend/components/dashboard/navbar/search.tsx @@ -6,27 +6,34 @@ import { useEffect, useState } from "react"; import { useRouter } from "next/navigation"; export default function DashboardNavbarSearch() { - const [search, setSearch] = useState(""); + // const [search, setSearch] = useState(""); const router = useRouter(); - useEffect(() => { - const delayDebounceFn = setTimeout(() => { - if (search) { - router.push(`/dashboard?q=${search}`); - } else { - router.push(`/dashboard`); - } - }, 300); + // useEffect(() => { + // const delayDebounceFn = setTimeout(() => { + // if (search) { + // router.push(`/dashboard?q=${search}`); + // } else { + // router.push(`/dashboard`); + // } + // }, 300); - return () => clearTimeout(delayDebounceFn); - }, [search]); + // return () => clearTimeout(delayDebounceFn); + // }, [search]); return (
setSearch(e.target.value)} + // value={search} + // onChange={(e) => setSearch(e.target.value)} + onChange={(e) => { + if (e.target.value === "") { + router.push(`/dashboard`); + return; + } + router.push(`/dashboard?q=${e.target.value}`); + }} placeholder="Search projects..." className="pl-8" /> diff --git a/frontend/components/dashboard/projectCard/index.tsx b/frontend/components/dashboard/projectCard/index.tsx index fd4671c..62212df 100644 --- a/frontend/components/dashboard/projectCard/index.tsx +++ b/frontend/components/dashboard/projectCard/index.tsx @@ -31,7 +31,7 @@ export default function ProjectCard({ onClick={() => router.push(`/code/${sandbox.id}`)} onMouseEnter={() => setHovered(true)} onMouseLeave={() => setHovered(false)} - className={`group/canvas-card p-4 h-48 flex flex-col justify-between items-start hover:border-muted-foreground relative overflow-hidden transition-all`} + className={`group/canvas-card p-4 h-48 flex flex-col justify-between items-start hover:border-muted-foreground/50 relative overflow-hidden transition-all`} > {hovered && ( diff --git a/frontend/components/dashboard/projectCard/revealEffect.tsx b/frontend/components/dashboard/projectCard/revealEffect.tsx index d233c1a..3786394 100644 --- a/frontend/components/dashboard/projectCard/revealEffect.tsx +++ b/frontend/components/dashboard/projectCard/revealEffect.tsx @@ -38,7 +38,7 @@ export const CanvasRevealEffect = ({ />
{showGradient && ( -
+
)}
); diff --git a/frontend/components/editor/index.tsx b/frontend/components/editor/index.tsx index 0e7fd8b..d4e2f2a 100644 --- a/frontend/components/editor/index.tsx +++ b/frontend/components/editor/index.tsx @@ -4,7 +4,7 @@ import dynamic from "next/dynamic"; import Loading from "@/components/editor/loading"; import { Sandbox, User } from "@/lib/types"; import { useEffect, useState } from "react"; -import { startServer } from "@/lib/utils"; +// import { startServer } from "@/lib/utils"; import { toast } from "sonner"; const CodeEditor = dynamic(() => import("@/components/editor/editor"), { @@ -23,18 +23,15 @@ export default function Editor({ const [didFail, setDidFail] = useState(false); useEffect(() => { - startServer(sandboxData.id, userData.id, (success: boolean) => { - if (!success) { - toast.error("Failed to start server."); - setDidFail(true); - } else { - setIsServerRunning(true); - } - }); - - // return () => { - // stopServer(sandboxData.id, userData.id); - // }; + // startServer(sandboxData.id, userData.id, (success: boolean) => { + // if (!success) { + // toast.error("Failed to start server."); + // setDidFail(true); + // } else { + // setIsServerRunning(true); + // } + // }); + console.log("startServer"); }, []); if (!isServerRunning || didFail) diff --git a/frontend/components/ui/userButton.tsx b/frontend/components/ui/userButton.tsx index dc701b5..a7bd392 100644 --- a/frontend/components/ui/userButton.tsx +++ b/frontend/components/ui/userButton.tsx @@ -54,10 +54,11 @@ export default function UserButton({ userData }: { userData: User }) {
- + + {/* Edit Profile - + */} signOut(() => router.push("/"))} className="!text-destructive cursor-pointer" diff --git a/frontend/lib/utils.ts b/frontend/lib/utils.ts index 3886ffc..ecc6ced 100644 --- a/frontend/lib/utils.ts +++ b/frontend/lib/utils.ts @@ -62,32 +62,32 @@ export function addNew( } } -export async function startServer( - sandboxId: string, - userId: string, - callback: (success: boolean) => void -) { - try { - const res = await fetch("http://localhost:4001/start", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - sandboxId, - userId, - }), - }); +// export async function startServer( +// sandboxId: string, +// userId: string, +// callback: (success: boolean) => void +// ) { +// try { +// const res = await fetch("http://localhost:4001/start", { +// method: "POST", +// headers: { +// "Content-Type": "application/json", +// }, +// body: JSON.stringify({ +// sandboxId, +// userId, +// }), +// }); - if (res.status !== 200) { - console.error("Failed to start server", res); - callback(false); - } +// if (res.status !== 200) { +// console.error("Failed to start server", res); +// callback(false); +// } - callback(true); - } catch (error) { - console.error("Failed to start server", error); +// callback(true); +// } catch (error) { +// console.error("Failed to start server", error); - callback(false); - } -} +// callback(false); +// } +// }