-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
### What changes were proposed in this pull request? Modify favicon and define custom toast. ![image](https://github.com/datastrato/gravitino/assets/17310559/3b7ee6b4-fe54-4bf8-be65-f7584aba1ef0) ![image](https://github.com/datastrato/gravitino/assets/17310559/6c4d9944-0574-4fee-a961-b13b6f638f9b) ### Why are the changes needed? Fix: #1665 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? N/A
- Loading branch information
Showing
3 changed files
with
60 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright 2024 Datastrato Pvt Ltd. | ||
* This software is licensed under the Apache License version 2. | ||
*/ | ||
|
||
'use client' | ||
|
||
import { toast, ToastBar, Toaster } from 'react-hot-toast' | ||
|
||
export default function StyledToast() { | ||
return ( | ||
<div> | ||
<Toaster | ||
reverseOrder={false} | ||
position='top-right' | ||
toastOptions={{ | ||
duration: Infinity, | ||
style: { | ||
borderRadius: '8px', | ||
maxWidth: 500 | ||
} | ||
}} | ||
> | ||
{t => ( | ||
<ToastBar toast={t}> | ||
{({ icon, message }) => ( | ||
<> | ||
{icon} | ||
<div className='twc-flex twc-w-full twc-break-all [&>div]:twc-justify-start'>{message}</div> | ||
<div className='twc-flex twc-h-full'> | ||
{t.type !== 'loading' && ( | ||
<button | ||
className='twc-border-0 twc-text-[#666] twc-w-6 twc-h-6 twc-justify-start twc-rounded-full twc-ring-primary-400 twc-transition hover:twc-bg-[#f8f8f8] focus:twc-outline-none focus-visible:twc-ring' | ||
onClick={() => toast.dismiss(t.id)} | ||
> | ||
x | ||
</button> | ||
)} | ||
</div> | ||
</> | ||
)} | ||
</ToastBar> | ||
)} | ||
</Toaster> | ||
</div> | ||
) | ||
} |
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