feat: public boards

This commit is contained in:
Henry
2025-01-11 15:22:49 +00:00
parent d98df1d2c6
commit 2df54f03bb
30 changed files with 487 additions and 100 deletions

View File

@@ -1,15 +1,14 @@
import { useState } from "react";
import { useForm } from "react-hook-form";
import ContentEditable from "react-contenteditable";
import { formatDistanceToNow } from "date-fns";
import { api } from "~/utils/api";
import { usePopup } from "~/providers/popup";
import { useState } from "react";
import ContentEditable from "react-contenteditable";
import { useForm } from "react-hook-form";
import { HiEllipsisHorizontal, HiPencil } from "react-icons/hi2";
import Avatar from "~/components/Avatar";
import Button from "~/components/Button";
import Dropdown from "~/components/Dropdown";
import { HiEllipsisHorizontal, HiPencil } from "react-icons/hi2";
import { usePopup } from "~/providers/popup";
import { api } from "~/utils/api";
interface FormValues {
comment: string;
@@ -54,6 +53,7 @@ const Comment = ({
showPopup({
header: "Unable to update comment",
message: "Please try again later, or contact customer support.",
icon: "error",
});
},
});

View File

@@ -1,8 +1,9 @@
import { useRouter } from "next/navigation";
import { api } from "~/utils/api";
import { useModal } from "~/providers/modal";
import { useBoard } from "~/providers/board";
import { useModal } from "~/providers/modal";
import { usePopup } from "~/providers/popup";
import { api } from "~/utils/api";
interface DeleteCardConfirmationProps {
cardPublicId: string;
@@ -24,6 +25,7 @@ export function DeleteCardConfirmation({
showPopup({
header: "Error deleting card",
message: "Please try again later, or contact customer support.",
icon: "error",
}),
});

View File

@@ -1,8 +1,7 @@
import { api } from "~/utils/api";
import Button from "~/components/Button";
import { useModal } from "~/providers/modal";
import { usePopup } from "~/providers/popup";
import Button from "~/components/Button";
import { api } from "~/utils/api";
export function DeleteLabelConfirmation({
cardPublicId,
@@ -23,6 +22,7 @@ export function DeleteLabelConfirmation({
showPopup({
header: "Error deleting label",
message: "Please try again later, or contact customer support.",
icon: "error",
}),
});

View File

@@ -1,11 +1,10 @@
import { useForm } from "react-hook-form";
import ContentEditable from "react-contenteditable";
import { useForm } from "react-hook-form";
import { HiOutlineArrowUp } from "react-icons/hi2";
import LoadingSpinner from "~/components/LoadingSpinner";
import { api } from "~/utils/api";
import { usePopup } from "~/providers/popup";
import { api } from "~/utils/api";
interface FormValues {
comment: string;
@@ -29,6 +28,7 @@ const NewCommentForm = ({ cardPublicId }: { cardPublicId: string }) => {
showPopup({
header: "Unable to add comment",
message: "Please try again later, or contact customer support.",
icon: "error",
});
},
});

View File

@@ -1,27 +1,25 @@
import Link from "next/link";
import { useParams } from "next/navigation";
import { useForm } from "react-hook-form";
import ContentEditable from "react-contenteditable";
import { useForm } from "react-hook-form";
import { IoChevronForwardSharp } from "react-icons/io5";
import Modal from "~/components/modal";
import { NewWorkspaceForm } from "~/components/NewWorkspaceForm";
import { PageHead } from "~/components/PageHead";
import { useModal } from "~/providers/modal";
import { usePopup } from "~/providers/popup";
import { api } from "~/utils/api";
import ActivityList from "./components/ActivityList";
import Dropdown from "./components/Dropdown";
import { DeleteCardConfirmation } from "./components/DeleteCardConfirmation";
import { DeleteLabelConfirmation } from "./components/DeleteLabelConfirmation";
import Dropdown from "./components/Dropdown";
import { LabelForm } from "./components/LabelForm";
import LabelSelector from "./components/LabelSelector";
import ListSelector from "./components/ListSelector";
import MemberSelector from "./components/MemberSelector";
import { LabelForm } from "./components/LabelForm";
import { NewWorkspaceForm } from "~/components/NewWorkspaceForm";
import NewCommentForm from "./components/NewCommentForm";
import { PageHead } from "~/components/PageHead";
import Modal from "~/components/modal";
import { useModal } from "~/providers/modal";
import { usePopup } from "~/providers/popup";
import { api } from "~/utils/api";
interface FormValues {
cardId: string;
title: string;
@@ -34,9 +32,9 @@ export default function CardPage() {
const { modalContentType, entityId } = useModal();
const { showPopup } = usePopup();
const cardId = Array.isArray(params?.cardId)
const cardId = Array.isArray(params.cardId)
? params.cardId[0]
: params?.cardId;
: params.cardId;
const { data, isLoading } = api.card.byId.useQuery({
cardPublicId: cardId ?? "",
@@ -90,6 +88,7 @@ export default function CardPage() {
showPopup({
header: "Unable to update card",
message: "Please try again later, or contact customer support.",
icon: "error",
});
},
});