Skip to content
Merged
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
6 changes: 4 additions & 2 deletions src/components/MobileActionBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import { useState, type ReactNode } from "react";
import { usePlatformDetection } from "../hooks/usePlatformDetection";

type Panel = "trade" | "donate" | "rate" | null;

Expand All @@ -14,6 +15,7 @@ export function MobileActionBar({
rateContent?: ReactNode;
}) {
const [open, setOpen] = useState<Panel>(null);
const { isMiniApp } = usePlatformDetection();

const buttons: { key: Panel; label: string; content?: ReactNode }[] = [
{ key: "trade", label: "Trade", content: tradeContent },
Expand All @@ -33,7 +35,7 @@ export function MobileActionBar({

{/* Bottom sheet */}
{open && (
<div className="fixed inset-x-0 bottom-0 z-50 max-h-[80vh] overflow-y-auto rounded-t-lg border-t border-[var(--border)] bg-[var(--bg)] p-4 pb-[calc(1rem+env(safe-area-inset-bottom))]">
<div className={`fixed inset-x-0 bottom-0 z-50 max-h-[80vh] overflow-y-auto rounded-t-lg border-t border-[var(--border)] bg-[var(--bg)] p-4 ${isMiniApp ? "pb-10" : "pb-[calc(1rem+env(safe-area-inset-bottom))]"}`}>
<div className="mb-3 flex items-center justify-between">
<span className="text-foreground text-sm font-medium capitalize">
{open}
Expand All @@ -52,7 +54,7 @@ export function MobileActionBar({
)}

{/* Fixed bottom bar */}
<div className="fixed inset-x-0 bottom-0 z-30 grid grid-cols-3 gap-2 border-t border-[var(--border)] bg-[var(--bg)]/95 px-3 pt-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] backdrop-blur-sm">
<div className={`fixed inset-x-0 bottom-0 z-30 grid grid-cols-3 gap-2 border-t border-[var(--border)] bg-[var(--bg)]/95 px-3 pt-3 ${isMiniApp ? "pb-8" : "pb-[calc(0.75rem+env(safe-area-inset-bottom))]"} backdrop-blur-sm`}>
{buttons.map(({ key, label }) => (
<button
key={key}
Expand Down
4 changes: 3 additions & 1 deletion src/components/ReadingMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { useEffect, useState, useCallback, useRef } from "react";
import { StoryContent } from "./StoryContent";
import { usePlatformDetection } from "../hooks/usePlatformDetection";

interface Chapter {
plotIndex: number;
Expand All @@ -18,7 +19,7 @@
}

export function ReadingMode({
storylineId,

Check warning on line 22 in src/components/ReadingMode.tsx

View workflow job for this annotation

GitHub Actions / lint-and-typecheck

'storylineId' is defined but never used
storylineTitle,
chapters,
initialChapterIndex,
Expand All @@ -27,6 +28,7 @@
const [currentIdx, setCurrentIdx] = useState(initialChapterIndex);
const [showToc, setShowToc] = useState(false);
const contentRef = useRef<HTMLDivElement>(null);
const { isMiniApp } = usePlatformDetection();

const chapter = chapters[currentIdx];
const hasPrev = currentIdx > 0;
Expand Down Expand Up @@ -115,7 +117,7 @@

{/* Bottom navigation */}
<nav
className="flex items-center justify-between px-4 pt-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] sm:px-6"
className={`flex items-center justify-between px-4 pt-3 ${isMiniApp ? "pb-8" : "pb-[calc(0.75rem+env(safe-area-inset-bottom))]"} sm:px-6`}
style={{ borderTop: "1px solid var(--border)" }}
>
{hasPrev ? (
Expand Down
Loading