b6bda3d692
- Add mobile viewport detection hook - Add virtual keyboard detection with fallback - Add auto-hide hook for header/keys strip - Add special keys mapping hook - Create MobileTerminalHeader, SpecialKeysStrip, SpecialKeysPanel components - Create MobileTerminalWrapper component - Update TerminalComponent with mobile support, font scaling, copy/paste, reconnection - Update AppShell to hide chrome on mobile terminal pages - Update TerminalPage to use MobileTerminalWrapper - Add comprehensive mobile terminal styles - TypeScript check passes - Build succeeds
51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
import React from "react";
|
|
import { useNavigate, useParams } from "react-router-dom";
|
|
import { TerminalComponent } from "../components/terminal";
|
|
import { MobileTerminalWrapper } from "../components/mobile-terminal-wrapper";
|
|
import { useMobileViewport } from "../hooks/use-mobile-viewport";
|
|
|
|
export const TerminalPage: React.FC = () => {
|
|
const { instanceId } = useParams<{ instanceId: string }>();
|
|
const navigate = useNavigate();
|
|
const isMobile = useMobileViewport();
|
|
|
|
if (!instanceId) {
|
|
return (
|
|
<section className="stack">
|
|
<h1>Terminal</h1>
|
|
<p className="muted">No instance ID provided.</p>
|
|
</section>
|
|
);
|
|
}
|
|
|
|
if (isMobile) {
|
|
return (
|
|
<MobileTerminalWrapper
|
|
instanceId={instanceId}
|
|
onBack={() => navigate(-1)}
|
|
onClose={() => navigate(-1)}
|
|
/>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<section className="terminal-page">
|
|
<div className="terminal-page-header">
|
|
<button
|
|
className="secondary-button"
|
|
onClick={() => navigate(-1)}
|
|
type="button"
|
|
>
|
|
Back
|
|
</button>
|
|
<h1>Terminal</h1>
|
|
</div>
|
|
<TerminalComponent
|
|
instanceId={instanceId}
|
|
onClose={() => navigate(-1)}
|
|
isMobile={false}
|
|
/>
|
|
</section>
|
|
);
|
|
};
|