diff --git a/packages/react/src/routes/home/home.tsx b/packages/react/src/routes/home/home.tsx index 4cf268ecb..14b66716b 100644 --- a/packages/react/src/routes/home/home.tsx +++ b/packages/react/src/routes/home/home.tsx @@ -1,6 +1,6 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/shadcn/ui/tabs"; import { mostRecentOrgAtom } from "@/store/org"; -import { useAtom, useSetAtom } from "jotai"; +import { useAtom, useAtomValue, useSetAtom } from "jotai"; import { lazy, useEffect, useState } from "react"; import { Trans, useTranslation } from "react-i18next"; import { @@ -24,6 +24,8 @@ import { isSidebarOpenAtom, sidebarShouldBeFullscreenAtom, } from "@/hooks/useFrame"; +import { userAtom } from "@/store/auth"; +import { useVideoSelection } from "@/hooks/useVideoSelection"; const ChannelsOrg = lazy(() => import("../orgChannels").then((module) => ({ default: module.ChannelsOrg })), @@ -97,6 +99,7 @@ function StickyTabsList({ const [open] = useAtom(isSidebarOpenAtom); const [isFullScreen] = useAtom(sidebarShouldBeFullscreenAtom); + const user = useAtomValue(userAtom); return ( } {tab !== "members" && } + {(user?.role === "admin" || user?.role === "editor") && ( + + )} ); } @@ -138,11 +144,6 @@ export default StickyTabsList; export const CardSizeToggle: React.FC = () => { const { nextSize, setNextSize } = useVideoCardSizes(["list", "md", "lg"]); - const handleClick = () => { - setNextSize(); - console.log("new card size", nextSize); - }; - return ( { variant="ghost" role="button" type="button" - onClick={handleClick} + onClick={setNextSize} > { ); }; + +export const EditingStateToggle: React.FC = () => { + const { selectionMode, setSelectionMode, clearSelection } = + useVideoSelection(); + + return selectionMode ? ( + { + setSelectionMode(!selectionMode); + clearSelection(); + }} + > + Exit Edit Mode + + ) : ( + { + setSelectionMode(!selectionMode); + clearSelection(); + }} + > + + + ); +};