add not found page

This commit is contained in:
NCanggoro 2023-09-27 21:53:28 +07:00
parent ba1ceb1af3
commit 5e13d85ff8
3 changed files with 34 additions and 22 deletions

View File

@ -4,7 +4,7 @@ import './app.css'
import { DefaultLayout } from './layouts'
import routes from './routes'
import "yet-another-react-lightbox/styles.css";
import { Login } from './pages'
import { Login, NotFound } from './pages'
import { Provider } from 'react-redux'
import { persistore, store } from './store/config'
import { PersistGate } from 'redux-persist/integration/react'
@ -13,27 +13,27 @@ import { PersistGate } from 'redux-persist/integration/react'
export function App() {
return (
<>
<Provider store={store}>
<PersistGate persistor={persistore}>
<Router>
<Routes>
<Route path='/login' element={<Login />} />
<Route element={<DefaultLayout />}>
{routes.map(({ path, name, element}) => (
<>
<Route
path={path}
id={name}
element={element}
/>
</>
))}
</Route>
</Routes>
</Router>
</PersistGate>
</Provider>
<Provider store={store}>
<PersistGate persistor={persistore}>
<Router>
<Routes>
<Route path='/login' element={<Login />} />
<Route element={<DefaultLayout />}>
{routes.map(({ path, name, element }) => (
<>
<Route
path={path}
id={name}
element={element}
/>
</>
))}
</Route>
<Route path="*" element={<NotFound />} />
</Routes>
</Router>
</PersistGate>
</Provider>
</>
)
}

View File

@ -0,0 +1,9 @@
const NotFound = () => (
<div class={'main-content content'}>
<img
src={'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.tenor.com%2FUWHgJ8QRcZsAAAAi%2Fturtle-huh-meme.gif&f=1&nofb=1&ipt=64af045b4bd24f01c00528f14b53fb17c49ed5b603fc58332e8a5de65a1b89ef&ipo=images'}
/>
</div>
)
export default NotFound;

View File

@ -5,12 +5,15 @@ import Story from "./Stories";
import NewsEvent from "./NewsEvents";
import LocationDetail from "./LocationDetail";
import Login from './Login';
import NotFound from "./NotFound";
export {
Login,
Home,
NotFound,
BestLocation,
LocationDetail,