From 6c5a0f33ae1f18b98a1c5116dda222e498dbceb1 Mon Sep 17 00:00:00 2001 From: cohenerickson Date: Fri, 15 Dec 2023 09:35:42 -0600 Subject: [PATCH] Header/Headerless routes --- src/components/HeaderRoute.tsx | 12 +++++++++++ src/index.tsx | 17 +++++---------- src/pages/Home.tsx | 29 ++++++++++++++------------ src/pages/_404.tsx | 30 +++++++++++++++------------ src/pages/discord.tsx | 38 +++++++++++++++++++--------------- 5 files changed, 71 insertions(+), 55 deletions(-) create mode 100644 src/components/HeaderRoute.tsx diff --git a/src/components/HeaderRoute.tsx b/src/components/HeaderRoute.tsx new file mode 100644 index 0000000..43fedec --- /dev/null +++ b/src/components/HeaderRoute.tsx @@ -0,0 +1,12 @@ +import { Header } from "./Header"; + +export function HeaderRoute(props: { children: any }) { + return ( +
+
+
+
{props.children}
+
+
+ ); +} diff --git a/src/index.tsx b/src/index.tsx index 015474a..9c6e45f 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -13,18 +13,11 @@ import "./i18n"; export function App() { return ( -
-
-
-
- - - - - -
-
-
+ + + + +
); } diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index ed9d835..b706589 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,23 +1,26 @@ import { useState } from "preact/hooks"; import { useTranslation } from "react-i18next"; +import { HeaderRoute } from "../components/HeaderRoute"; export function Home() { const [isFocused, setIsFocused] = useState(false); const { t } = useTranslation(); return ( -
- { - setIsFocused(true); - }} - onBlur={(e) => { - setIsFocused(false); - }} - type="text" - class="font-roboto h-14 w-80 rounded-2xl border border-input-border-color bg-input p-2 text-center text-xl placeholder:text-input-text focus:outline-none" - placeholder={isFocused ? "" : t("home.placeholder")} - > -
+ +
+ { + setIsFocused(true); + }} + onBlur={(e) => { + setIsFocused(false); + }} + type="text" + class="font-roboto h-14 w-80 rounded-2xl border border-input-border-color bg-input p-2 text-center text-xl placeholder:text-input-text focus:outline-none" + placeholder={isFocused ? "" : t("home.placeholder")} + > +
+
); } diff --git a/src/pages/_404.tsx b/src/pages/_404.tsx index c294a22..1fd4e7c 100644 --- a/src/pages/_404.tsx +++ b/src/pages/_404.tsx @@ -1,22 +1,26 @@ import { useTranslation } from "react-i18next"; import { Link } from "preact-router"; +import { HeaderRoute } from "../components/HeaderRoute"; export function NotFound() { const { t } = useTranslation(); + return ( -
-
- -
-

{t("404.text")}

- 404 + +
+
+ +
+

{t("404.text")}

+ 404 +
+ + +
- - - -
-
+ + ); } diff --git a/src/pages/discord.tsx b/src/pages/discord.tsx index 284cbf7..6f843fa 100644 --- a/src/pages/discord.tsx +++ b/src/pages/discord.tsx @@ -1,25 +1,29 @@ import { useTranslation } from "react-i18next"; +import { HeaderRoute } from "../components/HeaderRoute"; export function DiscordPage() { const { t } = useTranslation(); + return ( -
-
-
-

{t("discord.title")}

- {t("discord.sub")} + +
+
+
+

{t("discord.title")}

+ {t("discord.sub")} +
+ + + + + +
- - - - - - -
-
+ + ); }