mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
added 404 page
This commit is contained in:
@@ -5,6 +5,7 @@ import Home from './components/Home';
|
||||
import Board from './components/Board';
|
||||
import Thread from './components/Thread';
|
||||
import Catalog from './components/Catalog';
|
||||
import NotFound from './components/NotFound';
|
||||
import { createGlobalStyle } from 'styled-components';
|
||||
import 'react-tooltip/dist/react-tooltip.css';
|
||||
import preloadImages from './utils/preloadImages';
|
||||
@@ -76,6 +77,7 @@ export default function App() {
|
||||
<Route path={`/:subplebbitAddress/catalog`} element={<Catalog setBodyStyle={setBodyStyle} /> }>
|
||||
<Route path='post' element={<Catalog />} />
|
||||
</Route>
|
||||
<Route path='*' element={<NotFound />} />
|
||||
</Routes>
|
||||
</BoardContext.Provider>
|
||||
</div>
|
||||
|
||||
@@ -5,7 +5,7 @@ import { BoardContext } from '../App';
|
||||
|
||||
const Home = ({ setBodyStyle }) => {
|
||||
const [defaultSubplebbits, setDefaultSubplebbits] = useState([]);
|
||||
const { selectedTitle, setSelectedTitle, selectedAddress, setSelectedAddress, selectedStyle, setSelectedStyle } = useContext(BoardContext);
|
||||
const { setSelectedTitle, setSelectedAddress, setSelectedStyle } = useContext(BoardContext);
|
||||
|
||||
useEffect(() => {
|
||||
setBodyStyle({
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import { Link } from "react-router-dom";
|
||||
import { Container, Header, Logo, Page, Boards, BoardsTitle } from './styles/Home.styled';
|
||||
|
||||
|
||||
const NotFound = ({ setBodyStyle }) => {
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<Header>
|
||||
<Logo>
|
||||
<Link to="/">
|
||||
<img alt="plebchan" src="/assets/logo/logo-transparent.png" />
|
||||
</Link>
|
||||
</Logo>
|
||||
</Header>
|
||||
<Page>
|
||||
<Boards>
|
||||
<BoardsTitle>
|
||||
<h2 style={{textAlign: 'center'}}>404 Not Found</h2>
|
||||
</BoardsTitle>
|
||||
<img src="/assets/plebchan-husbando.jpg" style={{
|
||||
display: "block",
|
||||
margin: "auto",
|
||||
padding: "15px",
|
||||
width: "50%"
|
||||
}}></img>
|
||||
</Boards>
|
||||
</Page>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
||||
export default NotFound;
|
||||
Reference in New Issue
Block a user