From b05f18b2458bd8f787d30914787bdfee2b0bbcbd Mon Sep 17 00:00:00 2001 From: xaralis <filip.varecha@fragaria.cz> Date: Sun, 27 Dec 2020 08:55:27 +0100 Subject: [PATCH] feat: add 404 page --- src/App.jsx | 18 ++++++++++++++++++ src/containers/GlobalStats.jsx | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/App.jsx b/src/App.jsx index 904e3fb..0d4facf 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -6,6 +6,7 @@ import * as Sentry from "@sentry/react"; import { loadConfig } from "actions/global-info"; import { loadMe } from "actions/users"; import { initializeWSChannel } from "actions/ws"; +import Button from "components/Button"; import Footer from "components/Footer"; import Navbar from "components/Navbar"; import Home from "pages/Home"; @@ -78,6 +79,22 @@ const LoadingComponent = ( </div> ); +const NotFound = () => ( + <article className="container container--default py-8 lg:py-24"> + <h1 className="head-alt-base lg:head-alt-lg mb-8"> + 404ka: Tahle stránka tu není + </h1> + <p className="text-base lg:text-xl mb-8"> + Dostali jste se na takzvanou „<strong>čtyřystačtyřku</strong>“, což + znamená, že stránka, kterou jste se pokusili navštívit, na tomhle webu + není. + </p> + <Button routerTo="/" className="text-base lg:text-xl" hoverActive fullwidth> + Přejít na hlavní stránku + </Button> + </article> +); + const BaseApp = () => { initializeWSChannel.read(); @@ -87,6 +104,7 @@ const BaseApp = () => { <Switch> <Route exact path="/" children={<Home />} /> <Route exact path="/program" children={<Program />} /> + <Route component={NotFound} /> </Switch> <Footer /> </Router> diff --git a/src/containers/GlobalStats.jsx b/src/containers/GlobalStats.jsx index d425afb..fc991fc 100644 --- a/src/containers/GlobalStats.jsx +++ b/src/containers/GlobalStats.jsx @@ -22,7 +22,7 @@ const GlobalStats = () => { <strong>{onlineMembers}</strong>{" "} <span> {onlineMembers === 1 && "člen online"} - {onlineMembers > 1 && onlineMembers < 4 && "členové online"} + {onlineMembers > 1 && onlineMembers <= 4 && "členové online"} {(onlineMembers === 0 || onlineMembers > 4) && "členů online"} </span> </div> -- GitLab