mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-07-19 00:57:55 -05:00
* Changed nav and side to be sticky
* Centered calendar
* Adjusted top padding
* Added firefox scrollbar styling
* Adjusted scroll colors to fit theme
* Somehow this broke?? 😭
* Fix lint
* Adjust calendar padding
---------
Co-authored-by: hfcRed <hfcred@gmx.net>
Co-authored-by: Kalle <38327916+Sendouc@users.noreply.github.com>
60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
import { useCatch, useLocation } from "@remix-run/react";
|
|
import clsx from "clsx";
|
|
import type * as React from "react";
|
|
import { useMatches } from "react-router";
|
|
import { useUser } from "~/modules/auth";
|
|
import type { RootLoaderData } from "~/root";
|
|
import { SideNav } from "app/components/layout/SideNav";
|
|
|
|
export const Main = ({
|
|
children,
|
|
className,
|
|
classNameOverwrite,
|
|
halfWidth,
|
|
bigger,
|
|
style,
|
|
}: {
|
|
children: React.ReactNode;
|
|
className?: string;
|
|
classNameOverwrite?: string;
|
|
halfWidth?: boolean;
|
|
bigger?: boolean;
|
|
style?: React.CSSProperties;
|
|
}) => {
|
|
const caught = useCatch();
|
|
const data = useMatches()[0]?.data as RootLoaderData | undefined;
|
|
const user = useUser();
|
|
const showLeaderboard = data?.publisherId && !user?.patronTier && !caught;
|
|
|
|
const location = useLocation();
|
|
const isFrontPage = location.pathname === "/";
|
|
|
|
return (
|
|
<div className="layout__main-container">
|
|
{!isFrontPage ? <SideNav /> : null}
|
|
<main
|
|
className={
|
|
classNameOverwrite
|
|
? clsx(classNameOverwrite, {
|
|
"half-width": halfWidth,
|
|
"pt-8-forced": showLeaderboard,
|
|
})
|
|
: clsx(
|
|
"layout__main",
|
|
"main",
|
|
{
|
|
"half-width": halfWidth,
|
|
bigger,
|
|
"pt-8-forced": showLeaderboard,
|
|
},
|
|
className,
|
|
)
|
|
}
|
|
style={style}
|
|
>
|
|
{children}
|
|
</main>
|
|
</div>
|
|
);
|
|
};
|