From 4075a7df29fed0fc5c1f9086cdc24aef52b1b9e7 Mon Sep 17 00:00:00 2001 From: Daniel Luiz Alves Date: Mon, 18 Aug 2025 16:24:59 -0300 Subject: [PATCH] refactor: improve ReceivedFilesModal layout and remove unused ScrollArea component - Updated the layout of the ReceivedFilesModal to enhance responsiveness and usability by replacing the ScrollArea with a div that manages overflow. - Removed the unused ScrollArea import to clean up the codebase. --- .../components/received-files-modal.tsx | 97 ++++++++++--------- .../src/components/auth/redirect-handler.tsx | 12 ++- 2 files changed, 59 insertions(+), 50 deletions(-) diff --git a/apps/web/src/app/(shares)/reverse-shares/components/received-files-modal.tsx b/apps/web/src/app/(shares)/reverse-shares/components/received-files-modal.tsx index 5278292..5e947fe 100644 --- a/apps/web/src/app/(shares)/reverse-shares/components/received-files-modal.tsx +++ b/apps/web/src/app/(shares)/reverse-shares/components/received-files-modal.tsx @@ -36,7 +36,6 @@ import { DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Input } from "@/components/ui/input"; -import { ScrollArea } from "@/components/ui/scroll-area"; import { Separator } from "@/components/ui/separator"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { @@ -768,7 +767,7 @@ export function ReceivedFilesModal({ {t("reverseShares.modals.receivedFiles.description")} -
+
@@ -848,53 +847,55 @@ export function ReceivedFilesModal({
) : ( - - - - - - +
+
+ + + + + + {t("reverseShares.modals.receivedFiles.columns.file")} + {t("reverseShares.modals.receivedFiles.columns.size")} + {t("reverseShares.modals.receivedFiles.columns.sender")} + {t("reverseShares.modals.receivedFiles.columns.date")} + + {t("reverseShares.modals.receivedFiles.columns.actions")} + + + + + {files.map((file) => ( + - - {t("reverseShares.modals.receivedFiles.columns.file")} - {t("reverseShares.modals.receivedFiles.columns.size")} - {t("reverseShares.modals.receivedFiles.columns.sender")} - {t("reverseShares.modals.receivedFiles.columns.date")} - - {t("reverseShares.modals.receivedFiles.columns.actions")} - - - - - {files.map((file) => ( - - ))} - -
-
+ ))} + + +
+
)} diff --git a/apps/web/src/components/auth/redirect-handler.tsx b/apps/web/src/components/auth/redirect-handler.tsx index e9912e0..035cffc 100644 --- a/apps/web/src/components/auth/redirect-handler.tsx +++ b/apps/web/src/components/auth/redirect-handler.tsx @@ -19,6 +19,14 @@ const publicPaths = [ "/s/", "/r/", ]; + +const unauthenticatedOnlyPaths = [ + "/login", + "/forgot-password", + "/reset-password", + "/auth/callback", + "/auth/oidc/callback", +]; const homePaths = ["/"]; export function RedirectHandler({ children }: RedirectHandlerProps) { @@ -28,7 +36,7 @@ export function RedirectHandler({ children }: RedirectHandlerProps) { useEffect(() => { if (isAuthenticated === true) { - if (publicPaths.some((path) => pathname.startsWith(path)) || homePaths.includes(pathname)) { + if (unauthenticatedOnlyPaths.some((path) => pathname.startsWith(path)) || homePaths.includes(pathname)) { router.replace("/dashboard"); return; } @@ -46,7 +54,7 @@ export function RedirectHandler({ children }: RedirectHandlerProps) { if ( isAuthenticated === true && - (publicPaths.some((path) => pathname.startsWith(path)) || homePaths.includes(pathname)) + (unauthenticatedOnlyPaths.some((path) => pathname.startsWith(path)) || homePaths.includes(pathname)) ) { return ; }