-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): update dependency react-toastify to v11 (#379)
* fix(deps): update dependency react-toastify to v11 * remove stylesheet * only show copy button when pilot is ready * migrate success toast * migrate error toast * migrate info toast --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Philipp Giese <[email protected]>
- Loading branch information
1 parent
1683c65
commit d622315
Showing
8 changed files
with
106 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
import { Toast, toast } from './Toast' | ||
import { type DerivedToastProps, Toast, toast } from './Toast' | ||
import type { ToastProps } from './ToastProps' | ||
|
||
export const errorToast = ({ title, message }: ToastProps) => | ||
toast( | ||
({ dismiss }) => ( | ||
<> | ||
<div className="flex items-center justify-between gap-4"> | ||
{title && <Toast.Title className="text-white">{title}</Toast.Title>} | ||
const ErrorToast = ({ | ||
data: { title, message }, | ||
closeToast, | ||
}: DerivedToastProps) => ( | ||
<Toast className="border-red-500/60 bg-red-500 dark:border-red-700"> | ||
<div className="flex items-center justify-between gap-4"> | ||
{title && <Toast.Title className="text-white">{title}</Toast.Title>} | ||
|
||
<Toast.Dismiss | ||
className="text-white hover:bg-white/20" | ||
onDismiss={closeToast} | ||
/> | ||
</div> | ||
|
||
<Toast.Dismiss | ||
className="text-white hover:bg-white/20" | ||
onDismiss={dismiss} | ||
/> | ||
</div> | ||
<div className="text-red-50">{message}</div> | ||
</Toast> | ||
) | ||
|
||
<div className="text-red-50">{message}</div> | ||
</> | ||
), | ||
{ | ||
className: 'border-red-500/60 bg-red-500 dark:border-red-700', | ||
autoClose: false, | ||
}, | ||
) | ||
export const errorToast = ({ title, message }: ToastProps) => | ||
toast(ErrorToast, { | ||
data: { title, message }, | ||
autoClose: false, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
import { Toast, toast } from './Toast' | ||
import { Toast, toast, type DerivedToastProps } from './Toast' | ||
import type { ToastProps } from './ToastProps' | ||
|
||
export const infoToast = ({ title, message }: ToastProps) => | ||
toast( | ||
({ dismiss }) => ( | ||
<> | ||
<div className="flex items-center justify-between gap-4"> | ||
{title && ( | ||
<Toast.Title className="text-zinc-50 dark:text-zinc-900"> | ||
{title} | ||
</Toast.Title> | ||
)} | ||
const InfoToast = ({ | ||
data: { title, message }, | ||
closeToast, | ||
}: DerivedToastProps) => ( | ||
<Toast className="border-zinc-800/80 bg-zinc-900 dark:border-zinc-300/80 dark:bg-zinc-100"> | ||
<div className="flex items-center justify-between gap-4"> | ||
{title && ( | ||
<Toast.Title className="text-zinc-50 dark:text-zinc-900"> | ||
{title} | ||
</Toast.Title> | ||
)} | ||
|
||
<Toast.Dismiss | ||
className="text-zinc-50 hover:bg-white/20 dark:text-zinc-900 dark:hover:bg-zinc-900/10" | ||
onDismiss={closeToast} | ||
/> | ||
</div> | ||
|
||
<Toast.Dismiss | ||
className="text-zinc-50 hover:bg-white/20 dark:text-zinc-900 dark:hover:bg-zinc-900/10" | ||
onDismiss={dismiss} | ||
/> | ||
</div> | ||
<div className="text-zinc-200 dark:text-zinc-700">{message}</div> | ||
</Toast> | ||
) | ||
|
||
<div className="text-zinc-200 dark:text-zinc-700">{message}</div> | ||
</> | ||
), | ||
{ | ||
className: | ||
'border-zinc-800/80 bg-zinc-900 dark:border-zinc-300/80 dark:bg-zinc-100', | ||
}, | ||
) | ||
export const infoToast = ({ title, message }: ToastProps) => | ||
toast(InfoToast, { data: { title, message } }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
import { Toast, toast } from './Toast' | ||
import { Toast, toast, type DerivedToastProps } from './Toast' | ||
import type { ToastProps } from './ToastProps' | ||
|
||
export const successToast = ({ title, message }: ToastProps) => | ||
toast( | ||
({ dismiss }) => ( | ||
<> | ||
<div className="flex items-center justify-between gap-4"> | ||
{title && ( | ||
<Toast.Title className="text-green-900 dark:text-white"> | ||
{title} | ||
</Toast.Title> | ||
)} | ||
const SuccessToast = ({ | ||
data: { title, message }, | ||
closeToast, | ||
}: DerivedToastProps) => ( | ||
<Toast className="border-green-300/80 bg-green-200 dark:border-green-500/80 dark:bg-green-600"> | ||
<div className="flex items-center justify-between gap-4"> | ||
{title && ( | ||
<Toast.Title className="text-green-900 dark:text-white"> | ||
{title} | ||
</Toast.Title> | ||
)} | ||
|
||
<Toast.Dismiss | ||
className="text-green-900 hover:bg-green-500/20 dark:text-white dark:hover:bg-white/10" | ||
onDismiss={closeToast} | ||
/> | ||
</div> | ||
|
||
<Toast.Dismiss | ||
className="text-green-900 hover:bg-green-500/20 dark:text-white dark:hover:bg-white/10" | ||
onDismiss={dismiss} | ||
/> | ||
</div> | ||
<div className="text-green-700 dark:text-green-50">{message}</div> | ||
</Toast> | ||
) | ||
|
||
<div className="text-green-700 dark:text-green-50">{message}</div> | ||
</> | ||
), | ||
{ | ||
className: | ||
'border-green-300/80 bg-green-200 dark:border-green-500/80 dark:bg-green-600', | ||
}, | ||
) | ||
export const successToast = ({ title, message }: ToastProps) => | ||
toast(SuccessToast, { data: { message, title } }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.