From 2ccf55f75f27543b8c4136f786a9d0c7c5866d60 Mon Sep 17 00:00:00 2001 From: Juan Di Toro Date: Fri, 22 Mar 2024 14:14:45 +0100 Subject: [PATCH] fix: closes #9 --- app/components/general-layout.tsx | 41 ++++++++++++++++++++++++------- app/components/ui/tooltip.tsx | 28 +++++++++++++++++++++ package.json | 2 ++ 3 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 app/components/ui/tooltip.tsx diff --git a/app/components/general-layout.tsx b/app/components/general-layout.tsx index f4d79c3..b861d04 100644 --- a/app/components/general-layout.tsx +++ b/app/components/general-layout.tsx @@ -25,17 +25,28 @@ import { PageIcon, ThemeIcon, } from "./icons"; -import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem } from "./ui/dropdown-menu"; +import { + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuItem, +} from "./ui/dropdown-menu"; import { Avatar } from "@radix-ui/react-avatar"; import { cn } from "~/utils"; import { useGetIdentity, useLogout } from "@refinedev/core"; import type { Identity } from "~/data/auth-provider"; - +import { + Tooltip, + TooltipContent, + TooltipTrigger, + TooltipProvider, +} from "./ui/tooltip"; export const GeneralLayout = ({ children }: React.PropsWithChildren) => { const location = useLocation(); const { data: identity } = useGetIdentity(); - const{ mutate: logout } = useLogout() + const { mutate: logout } = useLogout(); return (
@@ -246,6 +257,7 @@ const UploadFileItem = ({ file: UppyFile; onRemove: (id: string) => void; }) => { + const sizeInMb = bytestoMegabytes(file.size).toFixed(2); return (
@@ -257,12 +269,23 @@ const UploadFileItem = ({ )}
-

- - {file.name} - {" "} - ({bytestoMegabytes(file.size).toFixed(2)} MB) -

+ + + +

+ + {file.name} + {" "} + ({sizeInMb}MB) +

+
+ +

+ {file.name} ({sizeInMb}MB) +

+
+
+