Made the settings a little nicer

This commit is contained in:
Alois 2026-04-10 20:48:26 +02:00
commit 93db9fe54a
2 changed files with 48 additions and 37 deletions

View file

@ -2,17 +2,25 @@ import { Button } from "@tensamin/ui/cmp/button";
import options from "@tensamin/shared/settings"; import options from "@tensamin/shared/settings";
import { cn, useIsMobile } from "@tensamin/ui/utils"; import { cn, useIsMobile } from "@tensamin/ui/utils";
import { Outlet, useNavigate } from "@tanstack/react-router"; import { Outlet, useLocation, useNavigate } from "@tanstack/react-router";
export default function Screen() { export default function Screen() {
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const location = useLocation();
return ( return (
<div className="flex h-full w-full"> <div className="flex h-full w-full">
{!isMobile && <SettingsSidebar />} {!isMobile && <SettingsSidebar />}
{/* Page */} {/* Page */}
<div className="bg-background w-full h-full p-3"> <div className="bg-background w-full h-full p-3 flex flex-col gap-3">
<h1 className="text-xl font-semibold">
{location.pathname
.split("/")
.pop()
?.replace(/-/g, " ")
.replace(/\b\w/g, (l) => l.toUpperCase())}
</h1>
<Outlet /> <Outlet />
</div> </div>
</div> </div>

View file

@ -71,6 +71,8 @@ function QrCodeLogin() {
const [qrCodeVisible, setQrCodeVisible] = useState(false); const [qrCodeVisible, setQrCodeVisible] = useState(false);
return ( return (
<div className="flex flex-col gap-1 pl-2">
<p>Login QR Code</p>
<div className="relative rounded-lg w-50 border-3 aspect-square overflow-hidden"> <div className="relative rounded-lg w-50 border-3 aspect-square overflow-hidden">
{qrCodeBase64 && ( {qrCodeBase64 && (
<img className="w-full h-full" src={qrCodeBase64} alt="QR Code" /> <img className="w-full h-full" src={qrCodeBase64} alt="QR Code" />
@ -85,10 +87,10 @@ function QrCodeLogin() {
<AlertDialogHeader> <AlertDialogHeader>
<AlertDialogTitle>Are you sure?</AlertDialogTitle> <AlertDialogTitle>Are you sure?</AlertDialogTitle>
<AlertDialogDescription> <AlertDialogDescription>
This will expose your private key! This is the same as Exposing this QR code is the same as sharing your .tu
sharing the .tu file! It's very tedious to change the file. Since changing your private key is quite tedious,
private key, so only do this if you are sure no one can only do this when you're confident the key won't be
steal it! compromised.
</AlertDialogDescription> </AlertDialogDescription>
</AlertDialogHeader> </AlertDialogHeader>
<AlertDialogFooter> <AlertDialogFooter>
@ -107,5 +109,6 @@ function QrCodeLogin() {
</> </>
)} )}
</div> </div>
</div>
); );
} }