diff --git a/apps/web/app/(org)/dashboard/caps/components/NewFolderDialog.tsx b/apps/web/app/(org)/dashboard/caps/components/NewFolderDialog.tsx index 5ecf9387c1..fd7c5cafea 100644 --- a/apps/web/app/(org)/dashboard/caps/components/NewFolderDialog.tsx +++ b/apps/web/app/(org)/dashboard/caps/components/NewFolderDialog.tsx @@ -10,24 +10,17 @@ import { Input, } from "@cap/ui"; import type { Folder, Space } from "@cap/web-domain"; -import { faFolderPlus } from "@fortawesome/free-solid-svg-icons"; +import { faFolder, faFolderPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { type RiveFile, useRiveFile } from "@rive-app/react-canvas"; import clsx from "clsx"; import { Option } from "effect"; import { useRouter } from "next/navigation"; -import React, { useEffect, useRef, useState } from "react"; +import type React from "react"; +import { useEffect, useState } from "react"; import { toast } from "sonner"; import { useEffectMutation, useRpcClient } from "@/lib/EffectRuntime"; import { PublicCollectionField } from "../../_components/PublicCollectionField"; import { useDashboardContext } from "../../Contexts"; -import { - BlueFolder, - type FolderHandle, - NormalFolder, - RedFolder, - YellowFolder, -} from "./Folders"; interface Props { open: boolean; @@ -36,38 +29,10 @@ interface Props { } const FolderOptions = [ - { - value: "normal", - label: "Normal", - component: ( - riveFile: RiveFile | undefined, - ref: React.Ref, - ) => , - }, - { - value: "blue", - label: "Blue", - component: ( - riveFile: RiveFile | undefined, - ref: React.Ref, - ) => , - }, - { - value: "red", - label: "Red", - component: ( - riveFile: RiveFile | undefined, - ref: React.Ref, - ) => , - }, - { - value: "yellow", - label: "Yellow", - component: ( - riveFile: RiveFile | undefined, - ref: React.Ref, - ) => , - }, + { value: "normal", label: "Normal", color: "#9ca3af" }, + { value: "blue", label: "Blue", color: "#3b82f6" }, + { value: "red", label: "Red", color: "#ef4444" }, + { value: "yellow", label: "Yellow", color: "#eab308" }, ] as const; export const NewFolderDialog: React.FC = ({ @@ -83,10 +48,6 @@ export const NewFolderDialog: React.FC = ({ const { activeOrganization, setUpgradeModalOpen } = useDashboardContext(); const router = useRouter(); - const { riveFile } = useRiveFile({ - src: "/rive/dashboard.riv", - }); - useEffect(() => { if (!open) { setSelectedColor(null); @@ -94,19 +55,6 @@ export const NewFolderDialog: React.FC = ({ } }, [open]); - const folderRefs = useRef( - FolderOptions.reduce( - (acc, opt) => { - acc[opt.value] = React.createRef(); - return acc; - }, - {} as Record< - (typeof FolderOptions)[number]["value"], - React.RefObject - >, - ), - ); - const rpc = useRpcClient(); const createFolder = useEffectMutation({ @@ -155,12 +103,12 @@ export const NewFolderDialog: React.FC = ({ ); diff --git a/apps/web/app/(org)/dashboard/folder/[id]/components/SubfolderDialog.tsx b/apps/web/app/(org)/dashboard/folder/[id]/components/SubfolderDialog.tsx index b2b18202e3..d5f25c6926 100644 --- a/apps/web/app/(org)/dashboard/folder/[id]/components/SubfolderDialog.tsx +++ b/apps/web/app/(org)/dashboard/folder/[id]/components/SubfolderDialog.tsx @@ -10,25 +10,17 @@ import { Input, } from "@cap/ui"; import type { Folder } from "@cap/web-domain"; -import { faFolderPlus } from "@fortawesome/free-solid-svg-icons"; +import { faFolder, faFolderPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import type { RiveFile } from "@rive-app/react-canvas"; -import { useRiveFile } from "@rive-app/react-canvas"; import clsx from "clsx"; import { Option } from "effect"; import { useRouter } from "next/navigation"; -import React, { useEffect, useRef, useState } from "react"; +import type React from "react"; +import { useEffect, useState } from "react"; import { toast } from "sonner"; import { useEffectMutation, useRpcClient } from "@/lib/EffectRuntime"; import { PublicCollectionField } from "../../../_components/PublicCollectionField"; import { useDashboardContext } from "../../../Contexts"; -import { - BlueFolder, - type FolderHandle, - NormalFolder, - RedFolder, - YellowFolder, -} from "../../../caps/components/Folders"; interface Props { open: boolean; @@ -37,38 +29,10 @@ interface Props { } const FolderOptions = [ - { - value: "normal", - label: "Normal", - component: ( - riveFile: RiveFile | undefined, - ref: React.Ref, - ) => , - }, - { - value: "blue", - label: "Blue", - component: ( - riveFile: RiveFile | undefined, - ref: React.Ref, - ) => , - }, - { - value: "red", - label: "Red", - component: ( - riveFile: RiveFile | undefined, - ref: React.Ref, - ) => , - }, - { - value: "yellow", - label: "Yellow", - component: ( - riveFile: RiveFile | undefined, - ref: React.Ref, - ) => , - }, + { value: "normal", label: "Normal", color: "#9ca3af" }, + { value: "blue", label: "Blue", color: "#3b82f6" }, + { value: "red", label: "Red", color: "#ef4444" }, + { value: "yellow", label: "Yellow", color: "#eab308" }, ] as const; export const SubfolderDialog: React.FC = ({ @@ -85,10 +49,6 @@ export const SubfolderDialog: React.FC = ({ useDashboardContext(); const router = useRouter(); - const { riveFile } = useRiveFile({ - src: "/rive/dashboard.riv", - }); - useEffect(() => { if (!open) { setSelectedColor(null); @@ -97,19 +57,6 @@ export const SubfolderDialog: React.FC = ({ } }, [open]); - const folderRefs = useRef( - FolderOptions.reduce( - (acc, opt) => { - acc[opt.value] = React.createRef(); - return acc; - }, - {} as Record< - (typeof FolderOptions)[number]["value"], - React.RefObject - >, - ), - ); - const rpc = useRpcClient(); const createSubfolder = useEffectMutation({ @@ -158,12 +105,12 @@ export const SubfolderDialog: React.FC = ({ );