Closed lokytech5 closed 1 month ago
This task aims to install react-toastify for toast notifications and create a toast component to display notifications across the application.
react-toastify
Navigate to the frontend folder using this command
cd frontend
Install react-toastify:
npm install react-toastify
Set Up Toast Notifications:
ToastNotify.tsx
app/components
ToastContainer
Integrate Toast Container in Layout Component:
Branch: Please create a new branch from development for your changes.
development
git checkout development git pull origin development git checkout -b feature/setup-toast-notifications
Pull Request: Submit a pull request to merge your changes into development.
Testing: Ensure the toast notifications work correctly by displaying different types of notifications (success, error, info, warning).
Create ToastNotify.tsx:
import React from 'react'; import { ToastContainer, toast } from 'react-toastify'; const ToastNotify = () => { return <ToastContainer position="bottom-right" autoClose={5000} hideProgressBar={false} newestOnTop={false} closeOnClick={true} draggable={true} pauseOnHover={true} />; }; export default ToastNotify;
Create Utility Functions for Toast Notifications:
component
toastUtils.ts
component/utils
Add utility functions for displaying different types of toast notifications:
import { toast } from 'react-toastify'; export const showToastSuccess = (message: string) => { toast.success(message); };
Ensure the ToastContainer is included in layout component (e.g., Layout.tsx):
Layout.tsx
import ToastNotify from './components/ToastNotify'; import 'react-toastify/dist/ReactToastify.css'; return ( <html lang="en"> <body className={inter.className}> <Providers> <div className="min-h-screen bg-base-300 flex flex-col"> <Navbar /> <div className="flex-grow">{children}</div> <Footer /> </div> <ToastNotify /> </Providers> </body> </html> )
let me know if there is anything not clear.
good morning @lokytech5 , sure! working on it
pull request open
good day @aedoardo1990. am checking the pr
Feature Request: Set Up Toast Notifications with react-toastify
Description
This task aims to install
react-toastify
for toast notifications and create a toast component to display notifications across the application.Tasks
Navigate to the frontend folder using this command
Install react-toastify:
react-toastify
using npm.Set Up Toast Notifications:
ToastNotify.tsx
in theapp/components
directory.ToastContainer
component.Integrate Toast Container in Layout Component:
ToastContainer
is included in layout component.Additional Notes
Branch: Please create a new branch from
development
for your changes.Pull Request: Submit a pull request to merge your changes into
development
.Testing: Ensure the toast notifications work correctly by displaying different types of notifications (success, error, info, warning).
Guidelines to Follow:
Create
ToastNotify.tsx
:Create Utility Functions for Toast Notifications:
component
directorytoastUtils.ts
in thecomponent/utils
directory.Add utility functions for displaying different types of toast notifications:
Integrate Toast Container in Layout Component:
Ensure the
ToastContainer
is included in layout component (e.g.,Layout.tsx
):