diff --git a/frontend/apps/editor2d/src/components/features/ToolbarTopRight/index.tsx b/frontend/apps/editor2d/src/components/features/ToolbarTopRight/index.tsx index 0e4a21a222..2e0455057c 100644 --- a/frontend/apps/editor2d/src/components/features/ToolbarTopRight/index.tsx +++ b/frontend/apps/editor2d/src/components/features/ToolbarTopRight/index.tsx @@ -1,12 +1,12 @@ import { faGear, faImages } from "@fortawesome/pro-solid-svg-icons"; import { twMerge } from "tailwind-merge"; import { Activity } from "~/components/ui/Activity/Activity"; - import { GalleryModal } from "@storyteller/ui-gallery-modal"; import { Button } from "@storyteller/ui-button"; import { SettingsModal } from "@storyteller/ui-settings-modal"; import { useState } from "react"; import { AuthButtons } from "~/components/shared_authentication/AuthButtons"; +import { Tooltip } from "@storyteller/ui-tooltip"; export const ToolbarTopRight = () => { const [isSettingsModalOpen, setIsSettingsModalOpen] = useState(false); @@ -18,11 +18,13 @@ export const ToolbarTopRight = () => {
- - +
- - - - - - - - - My Profile - - - {menuOptions.map((option, index) => ( - ( + <> + { - e.preventDefault(); - e.stopPropagation(); - option.onClick(); - }} > - - {option.label} - - ))} - + + + + + + + + My Profile + + + {menuOptions.map((option, index) => ( + { + e.preventDefault(); + e.stopPropagation(); + option.onClick(); + close(); + }} + > + + {option.label} + + ))} + + + )} ); } diff --git a/frontend/apps/editor2d/src/components/ui/Activity/Activity.tsx b/frontend/apps/editor2d/src/components/ui/Activity/Activity.tsx index ce4a7ebf36..c9dc4510c4 100644 --- a/frontend/apps/editor2d/src/components/ui/Activity/Activity.tsx +++ b/frontend/apps/editor2d/src/components/ui/Activity/Activity.tsx @@ -7,6 +7,7 @@ import { InProgressCard } from "./InProgressCard"; import { useJobContext } from "~/components/JobContext"; import { Api } from "~/KonvaApp/Api"; import { toast } from "sonner"; +import { Tooltip } from "@storyteller/ui-tooltip"; // Dummy data types interface CompletedItem { @@ -27,48 +28,8 @@ interface ActiveJob { }; } -// Dummy data for testing -const dummyCompletedItems: CompletedItem[] = [ - { - token: "1", - maybe_title: "Completed Item 1", - public_bucket_path: "/test1", - updated_at: new Date().toISOString(), - }, - { - token: "2", - maybe_title: "Completed Item 2", - public_bucket_path: "/test2", - updated_at: new Date().toISOString(), - }, -]; - -// const dummyJobs: ActiveJob[] = [ -// { -// job_token: "job1", -// request: { -// maybe_model_title: "In Progress Job 1", -// }, -// status: { -// status: "STARTED", -// progress_percentage: 45, -// }, -// }, -// { -// job_token: "job2", -// request: { -// maybe_model_title: "In Progress Job 2", -// }, -// status: { -// status: "PENDING", -// progress_percentage: 0, -// }, -// }, -// ]; - export function Activity() { - const { jobTokens, addJobToken, removeJobToken, clearJobTokens } = - useJobContext(); + const { jobTokens, removeJobToken } = useJobContext(); const [completedItems, setCompletedItems] = useState([]); const [jobs, setJobs] = useState([]); const [loading, setLoading] = useState(true); @@ -150,68 +111,69 @@ export function Activity() { }, [jobTokens, removeJobToken]); return ( - - - <> - {jobs.length > 0 ? ( - - ) : ( - - )} - Activity - - + + + + <> + {jobs.length > 0 ? ( + + ) : ( + + )} + + + {jobs.length > 0 && ( +
+ )} +
+ } + > +
+ {/* In progress */} {jobs.length > 0 && ( -
- )} -
- } - > -
- {/* In progress */} - {jobs.length > 0 && ( -
- {jobs.map((job) => ( - - ))} -
- )} - - {loading ? ( -
- -

Retrieving Activities

-
- ) : completedItems.length === 0 && jobs.length === 0 ? ( -
-

No activities yet

-
- ) : ( -
- {/* Completed */} -
- {completedItems.map((item) => ( - +
+ {jobs.map((job) => ( + ))}
-
- )} -
- + )} + + {loading ? ( +
+ +

Retrieving Activities

+
+ ) : completedItems.length === 0 && jobs.length === 0 ? ( +
+

No activities yet

+
+ ) : ( +
+ {/* Completed */} +
+ {completedItems.map((item) => ( + + ))} +
+
+ )} +
+ + ); }