Skip to content

Commit

Permalink
style: added react toastify
Browse files Browse the repository at this point in the history
  • Loading branch information
priyankarpal committed May 31, 2023
1 parent 70da1c6 commit 3e41f74
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"react-icons": "^4.9.0",
"react-paginate": "^8.2.0",
"react-router-dom": "^6.11.2",
"react-toastify": "^9.1.3",
"styled-components": "5.3.11",
"workspace-name": "^0.0.0"
},
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Layout from './components/Layout';
import { ThemeProvider } from './context/Theme';
import { lazy, Suspense } from 'react';
import Loader from './utils/Loader';
import { ToastContainer } from 'react-toastify';

const ProjectsPage = lazy(() => import('./pages/ProjectsPage'));
const HomePage = lazy(() => import('./pages/HomePage'));
Expand Down Expand Up @@ -54,6 +55,7 @@ const App = () => {
return (
<ThemeProvider>
<RouterProvider router={router} />
<ToastContainer />
</ThemeProvider>
);
};
Expand Down
15 changes: 15 additions & 0 deletions src/pages/HomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,24 @@ import { Link } from 'react-router-dom';
import Banner from '../components/Banner';
import { ThemeContext } from '../context/Theme';
import images from '../DB/homepage-image.json';
import { toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

const HomePage = () => {
const { theme } = useContext(ThemeContext);

const notify = () =>
toast('Want to add your project? Check out the docs!', {
position: 'top-right',
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: false,
progress: undefined,
theme: 'light',
});

return (
<section>
<div className="relative overflow-hidden">
Expand Down Expand Up @@ -73,6 +87,7 @@ const HomePage = () => {
backgroundColor: theme?.button?.buttonBgColor,
color: theme?.button?.buttonTextColor,
}}
onClick={notify}
>
Browse Projects
</Link>
Expand Down

1 comment on commit 3e41f74

@vercel
Copy link

@vercel vercel bot commented on 3e41f74 May 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

projectshut – ./

projectshut-priyankarpal.vercel.app
projectshut.vercel.app
projectshut-git-main-priyankarpal.vercel.app

Please sign in to comment.