mirror of
https://github.com/kyantech/Palmr.git
synced 2025-10-23 06:11:58 +00:00
refactor: improve ReceivedFilesModal layout (#216)
This commit is contained in:
@@ -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({
|
||||
<DialogDescription>{t("reverseShares.modals.receivedFiles.description")}</DialogDescription>
|
||||
</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 gap-4">
|
||||
<Badge variant="secondary" className="text-sm">
|
||||
@@ -848,7 +847,8 @@ export function ReceivedFilesModal({
|
||||
</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>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
@@ -894,7 +894,8 @@ export function ReceivedFilesModal({
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</ScrollArea>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</DialogContent>
|
||||
|
@@ -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 <LoadingScreen />;
|
||||
}
|
||||
|
Reference in New Issue
Block a user