mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-03-23 14:21:01 +00:00
new UI, unify map/demo/live architecture more, cleanup
This commit is contained in:
parent
d9b5e30831
commit
4741f59582
146 changed files with 5477 additions and 3005 deletions
29
src/components/VisualInput.tsx
Normal file
29
src/components/VisualInput.tsx
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { lazy, Suspense } from "react";
|
||||
import { useTouchDevice } from "./useTouchDevice";
|
||||
|
||||
const TouchJoystick = lazy(() =>
|
||||
import("@/src/components/TouchJoystick").then((mod) => ({
|
||||
default: mod.TouchJoystick,
|
||||
})),
|
||||
);
|
||||
|
||||
const KeyboardOverlay = lazy(() =>
|
||||
import("@/src/components/KeyboardOverlay").then((mod) => ({
|
||||
default: mod.KeyboardOverlay,
|
||||
})),
|
||||
);
|
||||
|
||||
export function VisualInput() {
|
||||
const isTouch = useTouchDevice();
|
||||
|
||||
return (
|
||||
<Suspense>
|
||||
{isTouch ? <TouchJoystick /> : null}
|
||||
{isTouch === false ? (
|
||||
// isTouch can be `null` before we know for sure; make sure this doesn't
|
||||
// render until it's definitively false
|
||||
<KeyboardOverlay />
|
||||
) : null}
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue