@@ -37,64 +38,70 @@ export default function DashboardProjects({
{q && q.length > 0 ? `Showing search results for: ${q}` : "My Projects"}
-
- {sandboxes.map((sandbox) => {
- if (q && q.length > 0) {
- if (!sandbox.name.toLowerCase().includes(q.toLowerCase())) {
- return null
+ {sandboxes.length > 0 ? (
+
+ {sandboxes.map((sandbox) => {
+ if (q && q.length > 0) {
+ if (!sandbox.name.toLowerCase().includes(q.toLowerCase())) {
+ return null;
+ }
}
- }
- return (
-
-
- {/* */}
-
-
-
- {sandbox.name}
+ return (
+
+
+ {/* */}
+
-
-
-
-
- {sandbox.visibility === "private" ? (
- <>
-
Private
- >
- ) : (
- <>
-
Public
- >
- )}
+
+
+ {sandbox.visibility === "private" ? (
+ <>
+ Private
+ >
+ ) : (
+ <>
+ Public
+ >
+ )}
+
+
+ 3d ago
+
-
- 3d ago
-
-
- {/* */}
-
-
- )
- })}
-
+ {/* */}
+
+
+ );
+ })}
+
+ ) : (
+
+ You don't have any projects yet. Create one to get started!
+
+ )}
- )
+ );
}
diff --git a/frontend/components/dashboard/shared.tsx b/frontend/components/dashboard/shared.tsx
index be28989..9e5eb03 100644
--- a/frontend/components/dashboard/shared.tsx
+++ b/frontend/components/dashboard/shared.tsx
@@ -1,4 +1,4 @@
-import { Sandbox } from "@/lib/types"
+import { Sandbox } from "@/lib/types";
import {
Table,
TableBody,
@@ -7,77 +7,84 @@ import {
TableHead,
TableHeader,
TableRow,
-} from "@/components/ui/table"
-import Image from "next/image"
-import Button from "../ui/customButton"
-import { ChevronRight } from "lucide-react"
-import Avatar from "../ui/avatar"
-import Link from "next/link"
+} from "@/components/ui/table";
+import Image from "next/image";
+import Button from "../ui/customButton";
+import { ChevronRight } from "lucide-react";
+import Avatar from "../ui/avatar";
+import Link from "next/link";
export default function DashboardSharedWithMe({
shared,
}: {
shared: {
- id: string
- name: string
- type: "react" | "node"
- author: string
- sharedOn: Date
- }[]
+ id: string;
+ name: string;
+ type: "react" | "node";
+ author: string;
+ sharedOn: Date;
+ }[];
}) {
return (
Shared With Me
-
-
-
-
- Sandbox Name
- Shared By
- Sent On
-
-
-
-
- {shared.map((sandbox) => (
-
-
-
-
- {sandbox.name}
-
-
-
-
-
-
- {new Date(sandbox.sharedOn).toLocaleDateString()}
-
-
-
-
-
-
+ {shared.length > 0 ? (
+
+
+
+
+ Sandbox Name
+ Shared By
+ Sent On
+
- ))}
-
-
-
+
+
+ {shared.map((sandbox) => (
+
+
+
+
+ {sandbox.name}
+
+
+
+
+
+
+ {new Date(sandbox.sharedOn).toLocaleDateString()}
+
+
+
+
+
+
+
+ ))}
+
+
+
+ ) : (
+
+ No sandboxes here. Get a friend to share one with you, and try out
+ live collaboration!
+
+ )}
- )
+ );
}
diff --git a/frontend/components/editor/index.tsx b/frontend/components/editor/index.tsx
index 49f96c2..195f75b 100644
--- a/frontend/components/editor/index.tsx
+++ b/frontend/components/editor/index.tsx
@@ -39,6 +39,8 @@ import { Sandbox, User, TFile, TFileData, TFolder, TTab } from "@/lib/types";
import { processFileType, validateName } from "@/lib/utils";
import { Cursors } from "./live/cursors";
import { Terminal } from "@xterm/xterm";
+import DisableAccessModal from "./live/disableModal";
+import Loading from "./loading";
export default function CodeEditor({
userData,
@@ -77,6 +79,10 @@ export default function CodeEditor({
const [creatingTerminal, setCreatingTerminal] = useState(false);
const [provider, setProvider] = useState
();
const [ai, setAi] = useState(false);
+ const [disableAccess, setDisableAccess] = useState({
+ isDisabled: false,
+ message: "",
+ });
const isOwner = sandboxData.userId === userData.id;
const clerk = useClerk();
@@ -519,6 +525,19 @@ export default function CodeEditor({
// })
};
+ if (disableAccess.isDisabled) {
+ return (
+ <>
+ {}}
+ />
+
+ >
+ );
+ }
+
return (
<>
diff --git a/frontend/components/editor/live/disableModal.tsx b/frontend/components/editor/live/disableModal.tsx
new file mode 100644
index 0000000..b66d369
--- /dev/null
+++ b/frontend/components/editor/live/disableModal.tsx
@@ -0,0 +1,33 @@
+"use client";
+
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "@/components/ui/dialog";
+
+import { ChevronRight, FileStack, Globe, TextCursor } from "lucide-react";
+
+export default function DisableAccessModal({
+ open,
+ setOpen,
+ message,
+}: {
+ open: boolean;
+ setOpen: (open: boolean) => void;
+ message: string;
+}) {
+ return (
+
+ );
+}
diff --git a/frontend/components/editor/live/room.tsx b/frontend/components/editor/live/room.tsx
index a59aaf3..8c29005 100644
--- a/frontend/components/editor/live/room.tsx
+++ b/frontend/components/editor/live/room.tsx
@@ -1,15 +1,14 @@
-"use client"
+"use client";
-import { RoomProvider } from "@/liveblocks.config"
-import { ClientSideSuspense } from "@liveblocks/react"
-import Loading from "../loading"
+import { RoomProvider } from "@/liveblocks.config";
+import { ClientSideSuspense } from "@liveblocks/react";
export function Room({
id,
children,
}: {
- id: string
- children: React.ReactNode
+ id: string;
+ children: React.ReactNode;
}) {
return (
*/}
- )
+ );
}
diff --git a/frontend/components/editor/loading.tsx b/frontend/components/editor/loading.tsx
index 482383a..662e354 100644
--- a/frontend/components/editor/loading.tsx
+++ b/frontend/components/editor/loading.tsx
@@ -5,41 +5,41 @@ import { Loader, Loader2 } from "lucide-react";
export default function Loading() {
return (
-
-
-
-
-
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+ //
+