Skip to content
Open
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
Expand Up @@ -111,17 +111,13 @@ export function App() {
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
29 changes: 24 additions & 5 deletions app/routes/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { useMediaQuery } from "@mantine/hooks";
import { motion } from "framer-motion";
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { type LoaderFunctionArgs, data, Link, useLoaderData } from "react-router";
import {
type LoaderFunctionArgs,
data,
Link,
useLoaderData,
} from "react-router";
import Footer from "~/components/landing/footer";
import { GlobeComponent } from "~/components/landing/globe.client";
import Header from "~/components/landing/header/header";
Expand All @@ -12,7 +18,7 @@ import Partners from "~/components/landing/sections/partners";
import PricingPlans from "~/components/landing/sections/pricing-plans";
import Stats from "~/components/landing/stats";
import i18next from "~/i18next.server";
import { type Partner, getDirectusClient } from "~/lib/directus";
import { type Partner, getDirectusClient } from "~/lib/directus";
import { getLatestDevices } from "~/models/device.server";
import { getUserId, getUserName } from "~/utils/session.server";

Expand Down Expand Up @@ -99,12 +105,25 @@ 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"
overflowY: "auto",
}}
>
<header className="z-10">
Expand Down Expand Up @@ -194,7 +213,7 @@ export default function Index() {
</div>
{isDesktop && (
<div className="w-1/3 cursor-pointer">
<GlobeComponent latestDevices={latestDevices}/>
<GlobeComponent latestDevices={latestDevices} />
</div>
)}
</div>
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