-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: rework toasts api and add mini mode support in toasts #987
Conversation
✅ Deploy Preview for testitori ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for teritori-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
… required for it and, created ToastProvider component
…st context provider
39ad2b7
to
b52efdd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have this kind of systems in useFeedback, please adapt it instead of having two providers and api for feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, I agree with @n0izn0iz about useFeedback
miniToast: { message: "" }, | ||
setMiniToast: () => {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't add new api, use previous api or extend it and change the toast render only
we need all existing toasts to work in mini mode also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think, a toast should be a toast, the mode can affect how it renders but we should have a single api
you can extend the current api
removed: ErrorToast and SuccesToast to make single NormalToast, deprecated use of setToastError and setToastSuccess
…i-dapp into feat/mini-Toast
topOffset?: number; | ||
} | ||
|
||
export const NormalToast: React.FC<NormalToastProps> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… required for it and, created ToastProvider component
…st context provider
removed: ErrorToast and SuccesToast to make single NormalToast, deprecated use of setToastError and setToastSuccess
080813d
to
52da131
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
* feat:created toast component for mini mode and added icons and colors required for it and, created ToastProvider component * refactor: moved toast message clear logic from toast component to toast context provider * refactor: replaced MiniToast on mini comment input * refactor: removed ToastProvider and moved added miniToast on feedback provider * chore: removed console.log * feat: added clear toast on press * refactor: Feedback Provider to use single api for mini and normal toast, removed: ErrorToast and SuccesToast to make single NormalToast, deprecated use of setToastError and setToastSuccess * fix: tsc errors * fix: unused exports error * feat:created toast component for mini mode and added icons and colors required for it and, created ToastProvider component * refactor: moved toast message clear logic from toast component to toast context provider * refactor: replaced MiniToast on mini comment input * refactor: removed ToastProvider and moved added miniToast on feedback provider * chore: removed console.log * feat: added clear toast on press * refactor: Feedback Provider to use single api for mini and normal toast, removed: ErrorToast and SuccesToast to make single NormalToast, deprecated use of setToastError and setToastSuccess * fix: tsc errors * fix: unused exports error * fix: regression * fix: regression no right padding * fix:padding diffrenece in success and error * fix: different with for success and error as in main --------- Co-authored-by: Sakul Budhathoki <[email protected]>
No description provided.