-
- Oops, looks like something went wrong!
-
+
+ Oops, looks like something went wrong!
+
We track these errors automatically, but if the problem persists feel
free to{" "}
contact us
{" "}
diff --git a/apps/nextjs/src/app/(dashboard)/layout.tsx b/apps/nextjs/src/app/(dashboard)/layout.tsx
new file mode 100644
index 00000000..41e9e600
--- /dev/null
+++ b/apps/nextjs/src/app/(dashboard)/layout.tsx
@@ -0,0 +1,19 @@
+import { redirect } from "next/navigation";
+
+import { auth } from "@acme/auth";
+
+import routes from "~/_utils/routes";
+
+export default async function WorkspaceLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ const session = await auth();
+
+ if (!session) {
+ redirect(routes.home);
+ }
+
+ return <>{children}>;
+}
diff --git a/apps/nextjs/src/app/workspace/(dashboard)/[id]/_components/ManageWeek.tsx b/apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/ManageWeek.tsx
similarity index 85%
rename from apps/nextjs/src/app/workspace/(dashboard)/[id]/_components/ManageWeek.tsx
rename to apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/ManageWeek.tsx
index 54a36aca..4f077149 100644
--- a/apps/nextjs/src/app/workspace/(dashboard)/[id]/_components/ManageWeek.tsx
+++ b/apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/ManageWeek.tsx
@@ -4,10 +4,14 @@ import { useCallback, useEffect, useState } from "react";
import Link from "next/link";
import { usePathname, useSearchParams } from "next/navigation";
import { addWeeks, format, isValid, parse, subWeeks } from "date-fns";
+import { FaArrowLeft } from "react-icons/fa";
import { FaRegCalendarPlus } from "react-icons/fa6";
import { HiArrowSmLeft, HiArrowSmRight } from "react-icons/hi";
-import { getDaysOfWeek } from "../_lib/days";
+import { Button } from "@acme/ui/button";
+
+import { getDaysOfWeek } from "~/_utils/days";
+import routes from "~/_utils/routes";
import WorkspaceHeader from "./WorkspaceHeader";
export function ManageWeek() {
@@ -39,6 +43,12 @@ export function ManageWeek() {
return (
+
@@ -82,11 +83,14 @@ export const Sprint = (props: {
{sortedUsers.map((user) => (
-
-
{user.name}
+
+
+ {getAvatarFallback(user.name)}
+
+
{user.name}
{weekdays.slice(0, showDaysPerWeek).map((weekday) => (
============================================================================= */
@@ -23,7 +24,7 @@ export const WeekList = (props: { weekend: boolean; weekdays: number }) => {
return (
-
+
{daysOfWeek.slice(0, props.weekdays).map(({ day, date }) => (
@@ -45,14 +46,15 @@ interface DayProps {
export const Day: React.FC
= ({ day, date }) => {
return (
{day}
+ {format(date, "EEE")}
);
};
diff --git a/apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/WorkspaceHeader.tsx b/apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/WorkspaceHeader.tsx
new file mode 100644
index 00000000..0dad1a33
--- /dev/null
+++ b/apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/WorkspaceHeader.tsx
@@ -0,0 +1,73 @@
+"use client";
+
+import { useEffect, useId } from "react";
+import { zodResolver } from "@hookform/resolvers/zod";
+import Cookies from "js-cookie";
+import { useForm } from "react-hook-form";
+import * as z from "zod";
+
+import {
+ Form,
+ FormControl,
+ FormField,
+ FormItem,
+ FormLabel,
+} from "@acme/ui/form";
+import { Label } from "@acme/ui/label";
+import { Switch } from "@acme/ui/switch";
+
+const FormSchema = z.object({
+ weekend: z.boolean(),
+});
+
+/*
+============================================================================= */
+const WorkspaceHeader = () => {
+ const id = useId();
+ const form = useForm<{ weekend: boolean }>({
+ resolver: zodResolver(FormSchema),
+ defaultValues: {
+ weekend: false,
+ },
+ });
+
+ useEffect(() => {
+ const weekendCookie = JSON.parse(Cookies.get("weekend") ?? null);
+
+ form.setValue("weekend", weekendCookie);
+ }, [form]);
+
+ useEffect(() => {
+ const subscription = form.watch((value) =>
+ Cookies.set("weekend", value.weekend!.toString(), {
+ expires: 365,
+ }),
+ );
+
+ return () => subscription.unsubscribe();
+ });
+ return (
+
+
+
+ );
+};
+
+export default WorkspaceHeader;
diff --git a/apps/nextjs/src/app/workspace/(dashboard)/[id]/_components/markdown.tsx b/apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/markdown.tsx
similarity index 100%
rename from apps/nextjs/src/app/workspace/(dashboard)/[id]/_components/markdown.tsx
rename to apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/markdown.tsx
diff --git a/apps/nextjs/src/app/workspace/(dashboard)/[id]/_components/reactions.tsx b/apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/reactions.tsx
similarity index 94%
rename from apps/nextjs/src/app/workspace/(dashboard)/[id]/_components/reactions.tsx
rename to apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/reactions.tsx
index 4f18c23b..6c58df58 100644
--- a/apps/nextjs/src/app/workspace/(dashboard)/[id]/_components/reactions.tsx
+++ b/apps/nextjs/src/app/(dashboard)/workspaces/[id]/_components/reactions.tsx
@@ -1,14 +1,14 @@
"use client";
import { useCallback, useEffect, useState } from "react";
-import clsx from "clsx";
import EmojiPicker, { Emoji } from "emoji-picker-react";
import { MdOutlineEmojiEmotions } from "react-icons/md";
+import { cn } from "@acme/ui";
+import { Button } from "@acme/ui/button";
import { toast } from "@acme/ui/toast";
-import Button from "~/app/_components/button";
-import useOutsideClick from "~/app/_hooks/useOutsideClick";
+import useOutsideClick from "~/_hooks/useOutsideClick";
import { api } from "~/trpc/react";
interface Props {
@@ -101,8 +101,8 @@ export const ReactionRow: React.FC = ({ sprintId, userId }) => {
{uniqueReactions.map((unified) => (