From 7f7c9c35d9d77d4903a8b9f86cc7f415b198b202 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Fri, 27 Mar 2026 18:31:23 +0000 Subject: [PATCH] [#302] Fix miniapp bottom padding with platform detection Use usePlatformDetection() hook instead of env(safe-area-inset-bottom) for miniapp environments where CSS environment variables return 0. When isMiniApp is true, apply explicit Tailwind padding (pb-8/pb-10). Regular browser and desktop layouts use the existing safe-area-inset fallback. Applied to MobileActionBar (fixed bar + bottom sheet) and ReadingMode bottom nav. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/MobileActionBar.tsx | 6 ++++-- src/components/ReadingMode.tsx | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/MobileActionBar.tsx b/src/components/MobileActionBar.tsx index a32c16ad..a5e2b242 100644 --- a/src/components/MobileActionBar.tsx +++ b/src/components/MobileActionBar.tsx @@ -1,6 +1,7 @@ "use client"; import { useState, type ReactNode } from "react"; +import { usePlatformDetection } from "../hooks/usePlatformDetection"; type Panel = "trade" | "donate" | "rate" | null; @@ -14,6 +15,7 @@ export function MobileActionBar({ rateContent?: ReactNode; }) { const [open, setOpen] = useState(null); + const { isMiniApp } = usePlatformDetection(); const buttons: { key: Panel; label: string; content?: ReactNode }[] = [ { key: "trade", label: "Trade", content: tradeContent }, @@ -33,7 +35,7 @@ export function MobileActionBar({ {/* Bottom sheet */} {open && ( -
+
{open} @@ -52,7 +54,7 @@ export function MobileActionBar({ )} {/* Fixed bottom bar */} -
+
{buttons.map(({ key, label }) => (