refactor: improve ReceivedFilesModal layout (#216)

This commit is contained in:
Daniel Luiz Alves
2025-08-18 16:37:42 -03:00
committed by GitHub
2 changed files with 59 additions and 50 deletions

View File

@@ -36,7 +36,6 @@ import {
DropdownMenuTrigger, DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"; } from "@/components/ui/dropdown-menu";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator"; import { Separator } from "@/components/ui/separator";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { import {
@@ -768,7 +767,7 @@ export function ReceivedFilesModal({
<DialogDescription>{t("reverseShares.modals.receivedFiles.description")}</DialogDescription> <DialogDescription>{t("reverseShares.modals.receivedFiles.description")}</DialogDescription>
</DialogHeader> </DialogHeader>
<div className="flex flex-col gap-4 flex-1 overflow-hidden"> <div className="flex flex-col gap-4 flex-1 min-h-0">
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
<div className="flex items-center gap-4"> <div className="flex items-center gap-4">
<Badge variant="secondary" className="text-sm"> <Badge variant="secondary" className="text-sm">
@@ -848,7 +847,8 @@ export function ReceivedFilesModal({
</div> </div>
</div> </div>
) : ( ) : (
<ScrollArea className="flex-1"> <div className="h-[450px] w-full overflow-y-auto rounded-lg border bg-background shadow-sm [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-muted-foreground/20">
<div className="p-1">
<Table> <Table>
<TableHeader> <TableHeader>
<TableRow> <TableRow>
@@ -894,7 +894,8 @@ export function ReceivedFilesModal({
))} ))}
</TableBody> </TableBody>
</Table> </Table>
</ScrollArea> </div>
</div>
)} )}
</div> </div>
</DialogContent> </DialogContent>

View File

@@ -19,6 +19,14 @@ const publicPaths = [
"/s/", "/s/",
"/r/", "/r/",
]; ];
const unauthenticatedOnlyPaths = [
"/login",
"/forgot-password",
"/reset-password",
"/auth/callback",
"/auth/oidc/callback",
];
const homePaths = ["/"]; const homePaths = ["/"];
export function RedirectHandler({ children }: RedirectHandlerProps) { export function RedirectHandler({ children }: RedirectHandlerProps) {
@@ -28,7 +36,7 @@ export function RedirectHandler({ children }: RedirectHandlerProps) {
useEffect(() => { useEffect(() => {
if (isAuthenticated === true) { 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"); router.replace("/dashboard");
return; return;
} }
@@ -46,7 +54,7 @@ export function RedirectHandler({ children }: RedirectHandlerProps) {
if ( if (
isAuthenticated === true && isAuthenticated === true &&
(publicPaths.some((path) => pathname.startsWith(path)) || homePaths.includes(pathname)) (unauthenticatedOnlyPaths.some((path) => pathname.startsWith(path)) || homePaths.includes(pathname))
) { ) {
return <LoadingScreen />; return <LoadingScreen />;
} }