Skip to content

Commit

Permalink
Add toast error to event page
Browse files Browse the repository at this point in the history
  • Loading branch information
Respirayson committed Mar 11, 2024
1 parent 8972166 commit d216f8d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
27 changes: 25 additions & 2 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"react": "^18.2.0",
"react-calendar": "^4.8.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"react-icons": "^5.0.1",
"react-router-dom": "^6.21.1",
"react-slick": "^0.30.2"
Expand Down
2 changes: 2 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect } from 'react';
import { useLocation, Routes, Route } from 'react-router-dom';
import { About, Article, Events, Home, Privacy, Resources } from './pages';
import { Toaster } from 'react-hot-toast';
import NavigationBar from './layout/NavigationBar';
import Footer from './layout/Footer';
import './App.css';
Expand All @@ -13,6 +14,7 @@ function App() {
{/* Main content */}
<ScrollToTop />
<main className='w-full'>
<div><Toaster/></div>
<Routes>
<Route path='/' element={<Home />} />
<Route path='/privacy' element={<Privacy />} />
Expand Down
3 changes: 2 additions & 1 deletion src/pages/events/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import Calendar from 'react-calendar';
import { toast } from 'react-hot-toast';
import { FaSearch } from 'react-icons/fa';
import articles from './articles.json' with {type: 'json'};
import SearchResult from './SearchResult';
Expand Down Expand Up @@ -50,7 +51,7 @@ function Events() {
}

{/* TODO: handle this */}
<button className='' onClick={() => alert('More coming soon!')}>
<button className='' onClick={() => toast.error('More coming soon!')}>
More Results
</button>
</div>
Expand Down

0 comments on commit d216f8d

Please sign in to comment.