+
diff --git a/app/(dashboard)/page.tsx b/app/(dashboard)/page.tsx
index 768e925..0be87c2 100644
--- a/app/(dashboard)/page.tsx
+++ b/app/(dashboard)/page.tsx
@@ -3,14 +3,20 @@
import { useOrganization } from "@clerk/nextjs";
import { EmptyOrg } from "./_components/empty-org";
import { BoardList } from "./_components/board-list";
+import { MobileOptimization } from "@/components/mobile-optimization";
const DashboardPage = () => {
const { organization } = useOrganization();
return (
-
- {!organization ? : }
-
+ <>
+
+
+
+ {!organization ? : }
+
+
+ >
);
};
diff --git a/app/api/liveblocks-auth/route.ts b/app/api/liveblocks-auth/route.ts
index a7f2010..fd00631 100644
--- a/app/api/liveblocks-auth/route.ts
+++ b/app/api/liveblocks-auth/route.ts
@@ -12,10 +12,10 @@ const liveBlocks = new Liveblocks({
export async function POST(request: Request) {
const authorization = await auth();
const user = await currentUser();
- console.log("AUTH_INFO", {
- authorization,
- user,
- });
+ // console.log("AUTH_INFO", {
+ // authorization,
+ // user,
+ // });
if (!authorization || !user) {
return new Response("Unauthorized", { status: 403 });
}
@@ -23,21 +23,21 @@ export async function POST(request: Request) {
const { room } = await request.json();
const board = await convex.query(api.board.get, { id: room });
- console.log("AUTH_INFO", {
- room,
- board,
- boardOrgId: board?.orgId,
- userOrgId: authorization.orgId,
- });
+ // console.log("AUTH_INFO", {
+ // room,
+ // board,
+ // boardOrgId: board?.orgId,
+ // userOrgId: authorization.orgId,
+ // });
if (board?.orgId !== authorization.orgId) {
return new Response("Unauthorized", { status: 403 });
}
- const userInfo = {
- name: user.firstName || "Teammate",
- picture: user.imageUrl,
- };
- console.log({ userInfo });
+ // const userInfo = {
+ // name: user.firstName || "Teammate",
+ // picture: user.imageUrl,
+ // };
+ // console.log({ userInfo });
const session = liveBlocks.prepareSession(user.id, {
userInfo: {
@@ -51,6 +51,6 @@ export async function POST(request: Request) {
}
const { status, body } = await session.authorize();
- console.log({ status, body }, "Allowed");
+ // console.log({ status, body }, "Allowed");
return new Response(body, { status });
}
diff --git a/app/board/[boardid]/_components/tool-button.tsx b/app/board/[boardid]/_components/tool-button.tsx
index aacd471..091093e 100644
--- a/app/board/[boardid]/_components/tool-button.tsx
+++ b/app/board/[boardid]/_components/tool-button.tsx
@@ -21,7 +21,7 @@ export const ToolButton = ({
isDisabled,
}: ToolButtonProps) => {
const handleClick = () => {
- console.log("ToolButton clicked:", label);
+ // console.log("ToolButton clicked:", label);
onClick();
};
return (
diff --git a/app/board/[boardid]/page.tsx b/app/board/[boardid]/page.tsx
index 7ed092f..fed5c13 100644
--- a/app/board/[boardid]/page.tsx
+++ b/app/board/[boardid]/page.tsx
@@ -7,6 +7,7 @@ import { Id } from "@/convex/_generated/dataModel";
import { Canvas } from "./_components/canvas";
import { Room } from "@/app/room";
import { Loading } from "./_components/loading";
+import { MobileOptimization } from "@/components/mobile-optimization";
interface BoardIdPageProps {
params: Promise<{
@@ -33,9 +34,12 @@ const BoardIdPage = ({ params }: BoardIdPageProps) => {
}
return (
-
}>
-
-
+ <>
+
+
}>
+
+
+ >
);
};
diff --git a/app/globals.css b/app/globals.css
index 26d9832..8cab784 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -11,6 +11,78 @@ body {
font-family: Arial, Helvetica, sans-serif;
}
+/* Mobile-specific utilities */
+@media (max-width: 768px) {
+ .touch-manipulation {
+ touch-action: manipulation;
+ }
+
+ /* Larger touch targets on mobile */
+ .mobile-touch-target {
+ min-height: 44px;
+ min-width: 44px;
+ }
+
+ /* Prevent zoom on input focus */
+ input, select, textarea {
+ font-size: 16px !important;
+ }
+
+ /* Smooth scrolling on mobile */
+ * {
+ -webkit-overflow-scrolling: touch;
+ }
+
+ /* Better scrollbar styling for mobile */
+ ::-webkit-scrollbar {
+ width: 3px;
+ }
+
+ ::-webkit-scrollbar-track {
+ background: transparent;
+ }
+
+ ::-webkit-scrollbar-thumb {
+ background: rgba(0, 0, 0, 0.2);
+ border-radius: 3px;
+ }
+
+ ::-webkit-scrollbar-thumb:hover {
+ background: rgba(0, 0, 0, 0.3);
+ }
+
+ /* Ensure proper viewport height on mobile */
+ .mobile-full-height {
+ height: 100vh;
+ height: 100dvh; /* Dynamic viewport height for mobile browsers */
+ }
+
+ /* Adjust spacing for mobile optimization banner */
+ .mobile-content-with-banner {
+ padding-top: 60px; /* Space for collapsed banner */
+ }
+
+ .mobile-content-with-expanded-banner {
+ padding-top: 140px; /* Space for expanded banner */
+ }
+
+ /* Adjust search overlay positioning */
+ .mobile-search-overlay {
+ top: 60px; /* Below the mobile banner */
+ }
+
+ .mobile-search-overlay-with-expanded-banner {
+ top: 140px; /* Below the expanded mobile banner */
+ }
+}
+
+/* Extra small screens */
+@media (min-width: 480px) {
+ .xs\:grid-cols-2 {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ }
+}
+
@layer base {
:root {
--background: 0 0% 100%;
diff --git a/components/actions.tsx b/components/actions.tsx
index 2276bf6..e375128 100644
--- a/components/actions.tsx
+++ b/components/actions.tsx
@@ -31,6 +31,7 @@ export const Actions = ({
}: ActionProps) => {
const { onOpen } = useRenameModal();
const { mutate, pending } = useApiMutation(api.board.remove);
+
const onCopyLink = () => {
navigator.clipboard
.writeText(`${window.location.origin}/board/${id}`)
@@ -39,9 +40,22 @@ export const Actions = ({
};
const onDelete = () => {
+ toast.loading("Deleting board...", { id: "delete-board" });
+
mutate({ id })
- .then(() => toast.success("Board Deleted"))
- .catch(() => toast.error("Failed to delete board"));
+ .then(() => {
+ toast.success("Board Deleted", { id: "delete-board" });
+ // Use window.location.href to ensure a full page load
+ window.location.href = "/";
+ })
+ .catch((error) => {
+ // console.error("Delete error:", error);
+ if (error.message?.includes("Unauthorized") || error.message?.includes("authentication")) {
+ toast.error("Authentication issue. Please try again.", { id: "delete-board" });
+ } else {
+ toast.error("Failed to delete board", { id: "delete-board" });
+ }
+ });
};
return (
@@ -76,6 +90,7 @@ export const Actions = ({