mirror of https://github.com/buster-so/buster.git
update the toaster
This commit is contained in:
parent
97d8dc8c46
commit
b4706b40ff
|
@ -3,7 +3,7 @@
|
|||
import React from 'react';
|
||||
import { useTheme } from 'next-themes';
|
||||
import { Toaster as ToasterSonner } from 'sonner';
|
||||
import { CircleCheck, CircleXmark, CircleWarning } from '@/components/ui/icons/NucleoIconOutlined';
|
||||
import { CircleCheck, CircleXmark, CircleWarning } from '@/components/ui/icons/NucleoIconFilled';
|
||||
|
||||
type ToasterProps = React.ComponentProps<typeof ToasterSonner>;
|
||||
|
||||
|
@ -12,9 +12,10 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
|||
|
||||
return (
|
||||
<ToasterSonner
|
||||
position="top-center"
|
||||
expand={true}
|
||||
position="bottom-right"
|
||||
expand={false}
|
||||
visibleToasts={5}
|
||||
duration={3000}
|
||||
icons={{
|
||||
success: <CircleCheck />,
|
||||
error: <CircleXmark />,
|
||||
|
@ -29,7 +30,8 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
|||
'group toast group-[.toaster]:bg-background! border !p-3 group-[.toaster]:text-foreground! group-[.toaster]:border-border! group-[.toaster]:shadow!',
|
||||
description: 'group-[.toast]:text-muted-foreground',
|
||||
actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',
|
||||
cancelButton: 'group-[.toast]:bg-border group-[.toast]:text-foreground'
|
||||
cancelButton: 'group-[.toast]:bg-border group-[.toast]:text-foreground',
|
||||
icon: 'mx-0! !flex !justify-center'
|
||||
}
|
||||
}}
|
||||
{...props}
|
||||
|
|
|
@ -27,8 +27,7 @@ const openNotification = (props: NotificationProps) => {
|
|||
|
||||
const toastOptions: ExternalToast = {
|
||||
...props,
|
||||
description: !hasTitle && message ? message : message,
|
||||
position: 'top-center'
|
||||
description: !hasTitle && message ? message : message
|
||||
};
|
||||
|
||||
switch (type) {
|
||||
|
|
Loading…
Reference in New Issue