Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tailwindStylesheetUrl from "/app/tailwind.css?url";
import appStylesheetUrl from "/app/app.css?url";
import clsx from "clsx";
import i18next from "./i18next.server";

Check warning on line 4 in app/root.tsx

View workflow job for this annotation

GitHub Actions / ⬣ Lint

`./i18next.server` import should occur after import of `./cookies`
import { useTranslation } from "react-i18next";
import {
data,
Expand Down Expand Up @@ -111,17 +111,13 @@
useChangeLanguage(data.locale);

return (
<html
lang={data.locale}
dir={i18n.dir()}
className={clsx("light", "overflow-hidden")}
>
<html lang={data.locale} dir={i18n.dir()} className={clsx("light")}>
<head>
<Meta />
{/* <PreventFlashOnWrongTheme ssrTheme={Boolean(data.theme)} /> */}
<Links />
</head>
<body className="flex h-full flex-col dark:bg-dark-background dark:text-dark-text overflow-visible overflow-auto">
<body className="dark:bg-dark-background dark:text-dark-text">
<Outlet />
<Toaster />
<ScrollRestoration />
Expand Down
16 changes: 15 additions & 1 deletion app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { readItems } from "@directus/sdk";
import { useMediaQuery } from "@mantine/hooks";
import { motion } from "framer-motion";
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import {
type LoaderFunctionArgs,
Expand Down Expand Up @@ -114,9 +115,22 @@ export default function Index() {

const isDesktop = useMediaQuery("(min-width: 768px)");

/**
* Stupid workaround for chromium and webkit that both render double
* scroll bars when using scrollSnapType.
* Simply setting overflow hidden on the html element fixes it and
* the rest of the pages stay untouched from this.
*/
useEffect(() => {
document.documentElement.style.setProperty("overflow", "hidden");
return () => {
document.documentElement.style.removeProperty("overflow");
};
}, []);

return (
<div
className="h-screen bg-white dark:bg-black"
className="max-h-screen bg-white dark:bg-black"
style={{
scrollSnapType: "y mandatory",
overflowY: "auto",
Expand Down
24 changes: 11 additions & 13 deletions app/routes/docs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,18 @@ export const loader = async () => {
};

export default function ApiDocumentation() {
const spec = useLoaderData<typeof loader>();
const spec = useLoaderData();
return (
<div style={{ height: "100vh", overflow: "auto", scrollbarWidth: "thin" }}>
<div>
<div className="flex items-center justify-center p-3">
<img
src="./openSenseMap_API.png"
alt="API Image"
height={350}
width={350}
/>
</div>
<SwaggerUI spec={spec} />
<main>
<div className="flex items-center justify-center p-3">
<img
src="./openSenseMap_API.png"
alt="API Image"
height={350}
width={350}
/>
</div>
</div>
<SwaggerUI spec={spec} />
</main>
);
}
Loading