增加toast提示
parent
4b203902d4
commit
f7f9425117
@ -0,0 +1,31 @@
|
|||||||
|
import { ToastContentProps } from "react-toastify";
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
type CustomNotificationProps = ToastContentProps<{
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
export function CustomNotification({
|
||||||
|
closeToast,
|
||||||
|
data,
|
||||||
|
toastProps,
|
||||||
|
}: CustomNotificationProps) {
|
||||||
|
const isColored = toastProps.theme === 'colored';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="flex flex-col w-full">
|
||||||
|
<h3
|
||||||
|
className={cn(
|
||||||
|
'text-sm font-semibold',
|
||||||
|
isColored ? 'text-white' : 'text-zinc-800'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{data.title}
|
||||||
|
</h3>
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<p className="text-sm">{data.content}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
import * as React from "react"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
export interface TextAreaProps
|
||||||
|
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
||||||
|
|
||||||
|
export const TextArea = React.forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
||||||
|
({ className, ...props }, ref) => {
|
||||||
|
return (
|
||||||
|
<textarea
|
||||||
|
className={cn(
|
||||||
|
"flex w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
ref={ref}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
Loading…
Reference in New Issue