Skip to content

Commit

Permalink
fix: move scrolling from body to approot
Browse files Browse the repository at this point in the history
  • Loading branch information
ferothefox committed Jun 26, 2023
1 parent 3c62c65 commit 05efab6
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions components/AppRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function AppRoot({ Component, pageProps }: AppProps) {
return (
<div
// A lot of this codebase is from the DeckThemes codebase, which has a light and dark mode, however this app only has a dark mode, so we put the dark class here incase we copy over things that have both styles
className={`dark relative flex min-h-screen flex-col bg-base-6-dark text-textDark ${montserrat} ${openSans}`}
className={`dark relative flex overflow-y-scroll h-screen min-h-screen flex-col bg-base-6-dark text-textDark ${montserrat} ${openSans}`}
>
<ToastContainer
position="bottom-center"
Expand All @@ -45,8 +45,9 @@ export function AppRoot({ Component, pageProps }: AppProps) {
pauseOnHover
theme={"dark"}
/>
{dummyResult && <MainNav />}
<main className="page-shadow ml-4 mt-2 mb-4 flex h-full flex-1 flex-grow flex-col rounded-3xl border-[1px] border-borders-base3-light bg-base-2-light dark:border-borders-base1-dark dark:bg-base-2-dark">
<div>
{dummyResult && <MainNav />}
<main className="page-shadow ml-4 mt-12 mb-4 flex h-min flex-1 flex-grow flex-col rounded-3xl border-[1px] border-borders-base3-light bg-base-2-light dark:border-borders-base1-dark dark:bg-base-2-dark">
{(showNewBackendPage || (!backendExists && !dummyResult)) && (
<DownloadBackendPage
onboarding={!backendExists}
Expand All @@ -63,6 +64,7 @@ export function AppRoot({ Component, pageProps }: AppProps) {
<BackendFailedPage />
)}
</main>
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion components/Native/Titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Titlebar = () => {
<>
<div
data-tauri-drag-region
className="fixed top-0 left-0 right-0 z-[2147483647] flex h-8 cursor-default select-none flex-row dark:bg-base-6-dark"
className="cssloader-titlebar fixed z-[2147483647] flex h-8 cursor-default select-none flex-row bg-base-6-dark"
>
<div className="absolute top-0 left-0 flex h-full">
<Link
Expand Down
4 changes: 2 additions & 2 deletions components/Nav/MainNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function MainNav() {
return (
<>
<div
className="sticky top-0 isolate z-[9998] w-full dark:bg-base-6-dark"
className="sticky top-8 isolate z-[9998] w-full dark:bg-base-6-dark"
style={{ boxShadow: "0px 0px 15px #090a0c, 0px 4px 15px #090a0c" }}
>
<div className="mx-auto flex w-full max-w-5xl flex-col px-4 sm:flex-row sm:items-center sm:justify-between">
Expand All @@ -69,7 +69,7 @@ export function MainNav() {
/>
<h1 className={`font-fancy text-xl font-semibold`}>CSSLoader</h1>
</Link>
</div> */}
</div>
<div
id="navContainer"
className="font-fancy relative my-4 flex h-full items-center gap-2 overflow-hidden sm:my-0"
Expand Down
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BiReset } from "react-icons/bi";
import { OneColumnThemeView, TwoColumnThemeView, CreatePresetModal } from "../components";
import { useVW } from "../hooks/useVW";
import { themeContext } from "./_app";
import { themeContext } from "@contexts/themeContext";
import { useContext, useState, useEffect, useMemo } from "react";
import { LabelledInput, RadioDropdown, Tooltip, TwoItemToggle } from "@components/Primitives";
import { TbColumns1, TbColumns2 } from "react-icons/tb";
Expand Down
2 changes: 1 addition & 1 deletion pages/manage-themes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { themeContext } from "./_app";
import { themeContext } from "@contexts/themeContext";
import { useContext, useEffect, useState } from "react";
import { MinimalCSSThemeInfo, Theme } from "../ThemeTypes";
import { deleteTheme, downloadThemeFromUrl, toast } from "../backend";
Expand Down
2 changes: 1 addition & 1 deletion pages/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useState, useEffect, useContext } from "react";
import { AiOutlineQuestionCircle } from "react-icons/ai";
import { BsDiscord } from "react-icons/bs";
import { FaPatreon } from "react-icons/fa";
import { themeContext } from "./_app";
import { themeContext } from "@contexts/themeContext";
import { GenericInstallBackendModal } from "@components/GenericInstallBackendModal";
import { open } from "@tauri-apps/api/dialog";

Expand Down
2 changes: 1 addition & 1 deletion pages/store.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useContext, useEffect, useRef } from "react";
import { themeContext } from "./_app";
import { themeContext } from "@contexts/themeContext";
import { allowedStoreOrigins, storeUrl } from "../constants";
import { downloadThemeFromUrl, storeRead, toast } from "../backend";

Expand Down

0 comments on commit 05efab6

Please sign in to comment.