feat: improve account management
This commit is contained in:
20
src/components/back.tsx
Normal file
20
src/components/back.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { cn } from "@/commons";
|
||||
import { useRouter } from "@tanstack/react-router";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export function GoBack({
|
||||
children,
|
||||
className,
|
||||
}: { children: ReactNode | ReactNode[]; className?: string }) {
|
||||
const { history } = useRouter();
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => history.go(-1)}
|
||||
className={cn(className)}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
27
src/components/frame.tsx
Normal file
27
src/components/frame.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { cn } from "@/commons";
|
||||
import { useRouteContext } from "@tanstack/react-router";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export function Frame({
|
||||
children,
|
||||
shadow,
|
||||
className,
|
||||
}: { children: ReactNode; shadow?: boolean; className?: string }) {
|
||||
const { platform } = useRouteContext({ strict: false });
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
className,
|
||||
platform === "linux"
|
||||
? "bg-white dark:bg-neutral-950"
|
||||
: "bg-white dark:bg-white/10",
|
||||
shadow
|
||||
? "shadow-lg shadow-neutral-500/10 dark:shadow-none dark:ring-1 dark:ring-white/20"
|
||||
: "",
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
export * from "./container";
|
||||
export * from "./frame";
|
||||
export * from "./back";
|
||||
export * from "./box";
|
||||
export * from "./spinner";
|
||||
export * from "./quote";
|
||||
|
||||
Reference in New Issue
Block a user