import { StrictMode, useState } from "react";
import { createRoot } from "react-dom/client";
import {
BottomSheet,
Carousel,
FlowStack,
KeyboardInput,
MobileRuntime,
MobileScroll,
type FlowScreen,
} from "../src/mobile";
import "../src/styles.css";
import "./runtime-fixture.css";
function CarouselFixture() {
const [tapCount, setTapCount] = useState(0);
const [sheetOpen, setSheetOpen] = useState(false);
return (
Runtime fixture
{Array.from({ length: 7 }, (_, index) => (
))}
Scrollable parent content
Sheet content
);
}
function KeyboardFixture() {
const screen: FlowScreen = {
id: "keyboard",
footerHeight: 84,
footer: () => (
),
render: () => (
Keyboard fixture
),
};
return (
);
}
function stackedScreen(level: number): FlowScreen {
return {
id: `flow-level-${level}`,
headerHeight: 56,
header: (flow) => (
Level {level}
),
footerHeight: 64,
footer: (flow) => (
),
render: (flow) => (
{level === 2 ? "Screen stacking works" : `Nested view level ${level}`}
{level < 4 ? (
) : null}
),
};
}
function FlowFixture() {
const screen: FlowScreen = {
id: "flow-root",
footerHeight: 84,
footer: () => (
),
render: (flow) => (
Flow root
),
};
return (
);
}
const fixture = new URLSearchParams(window.location.search).get("fixture");
const fixtureElement =
fixture === "keyboard"
?
: fixture === "flow"
?
: ;
createRoot(document.getElementById("root")!).render(
{fixtureElement},
);