diff --git a/package.json b/package.json index 6e1fdb9..b9c3e21 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/package", "name": "tutu", - "version": "1.1.0", + "version": "1.0.8", "description": "", "private": true, "type": "module", diff --git a/src/App.css b/src/App.css index 880ecd9..0e083fc 100644 --- a/src/App.css +++ b/src/App.css @@ -10,11 +10,6 @@ overscroll-behavior-block: none; } -body, #root { - min-height: 100vh; - min-height: 100dvh; -} - .custom-emoji { width: 1em; } diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 50ec67d..8806ff5 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -98,14 +98,7 @@ const safeAreaInsets: Record = { let screenOrientationCallback: (() => void) | undefined; -function removeSafeAreaEmulation(root: HTMLElement) { - for (const name of ["top", "right", "bottom", "left"]) { - root.style.removeProperty(`--safe-area-inset-${name}`); - } -} - function applySafeAreaEmulation(root: HTMLElement, insets: Inset) { - removeSafeAreaEmulation(root); for (const key of Object.keys(insets) as (keyof Inset)[]) { const value = insets[key]; if (!value || value === 0) continue; @@ -116,22 +109,19 @@ function applySafeAreaEmulation(root: HTMLElement, insets: Inset) { function setupSafeAreaEmulation(name: string) { const insets = safeAreaInsets[name]; const root = document.querySelector(":root")! as HTMLElement; - - if (screenOrientationCallback) { - window.screen.orientation.removeEventListener( - "change", - screenOrientationCallback, - ); - screenOrientationCallback = undefined; - } - - removeSafeAreaEmulation(root); - - if (insets) { - screenOrientationCallback = () => { - console.debug( - `safe area emulation target: ${window.screen.orientation.type}`, + if (!insets) { + if (screenOrientationCallback) { + window.screen.orientation.removeEventListener( + "change", + screenOrientationCallback, ); + screenOrientationCallback = undefined; + } + for (const name of ["top", "right", "bottom", "left"]) { + root.style.removeProperty(`--safe-area-inset-${name}`); + } + } else { + screenOrientationCallback = () => { if (window.screen.orientation.type === "portrait-primary") { console.debug("safe area emulation: protrait"); applySafeAreaEmulation(root, insets.protrait); @@ -148,16 +138,6 @@ function setupSafeAreaEmulation(name: string) { } } -if (import.meta.hot) { - import.meta.hot.accept((mod) => { - if (!mod) return; - if (screenOrientationCallback) { - mod["screenOrientationCallback"] = screenOrientationCallback; - setTimeout(screenOrientationCallback, 0); - } - }); -} - type Strings = { ["lang.auto"]: Template<{ detected: string }>; } & Record; diff --git a/src/timelines/TootBottomSheet.css b/src/timelines/TootBottomSheet.css deleted file mode 100644 index afe2e5d..0000000 --- a/src/timelines/TootBottomSheet.css +++ /dev/null @@ -1,18 +0,0 @@ -.TootBottomSheet { - overflow: hidden; - - .Scrollable { - padding-bottom: var(--safe-area-inset-bottom, 0); - overflow-y: auto; - overscroll-behavior-y: contain; - max-height: calc(100vh - var(--scaffold-topbar-height, 0px)); - max-height: calc(100dvh - var(--scaffold-topbar-height, 0px)); - } - - .progress-line { - display: flex; - justify-content: center; - margin-top: 12px; - margin-bottom: 12px; - } -} \ No newline at end of file diff --git a/src/timelines/TootBottomSheet.tsx b/src/timelines/TootBottomSheet.tsx index 1c6b111..92a44c3 100644 --- a/src/timelines/TootBottomSheet.tsx +++ b/src/timelines/TootBottomSheet.tsx @@ -11,7 +11,9 @@ import { import Scaffold from "../material/Scaffold"; import { AppBar, CircularProgress, IconButton, Toolbar } from "@suid/material"; import { Title } from "../material/typography"; -import { Close as CloseIcon } from "@suid/icons-material"; +import { + Close as CloseIcon, +} from "@suid/icons-material"; import { useSessionForAcctStr } from "../masto/clients"; import { resolveCustomEmoji } from "../masto/toot"; import RegularToot, { findElementActionable } from "./RegularToot"; @@ -24,7 +26,6 @@ import TootComposer from "./TootComposer"; import { useDocumentTitle } from "../utils"; import { createTimelineControlsForArray } from "../masto/timelines"; import TootList from "./TootList"; -import "./TootBottomSheet.css"; let cachedEntry: [string, mastodon.v1.Status] | undefined; @@ -244,64 +245,64 @@ const TootBottomSheet: Component = (props) => { } - class="TootBottomSheet" > -
- - + + -
- - - -
- - - refetchContext()} - inReplyToId={remoteToot()?.reblog?.id ?? remoteToot()?.id} - /> +
+ + +
- -
- -
-
- - + refetchContext()} + inReplyToId={remoteToot()?.reblog?.id ?? remoteToot()?.id} /> -
-
+ + + +
+ +
+
+ + + +
); };