Skip to content
Open
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
24 changes: 20 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ function App() {
const [amountInput, setAmountInput] = useState("50");
const [selectedPreset, setSelectedPreset] = useState<number | "custom">(50);

const [isTouchDevice, setIsTouchDevice] = useState(false);
useEffect(() => {
setIsTouchDevice('ontouchstart' in window || navigator.maxTouchPoints > 0);
}, []);

// Handle global shortcuts
const handleGlobalKeyDown = useCallback((event: KeyboardEvent) => {
// Navigation to My APIs (e.g. g then a)
Expand Down Expand Up @@ -774,13 +779,24 @@ function App() {
<NavLink to={APP_ROUTES.themePlayground} className={({ isActive }) => isActive ? "link-nav active" : "link-nav"}>Theme Playground</NavLink>
<NavLink to={APP_ROUTES.status} className={({ isActive }) => isActive ? "link-nav active" : "link-nav"}>Status</NavLink>
<NavLink to={APP_ROUTES.documentation} className={({ isActive }) => isActive ? "link-nav active" : "link-nav"}>Documentation</NavLink>
{!isTouchDevice && (
<button
className="link-nav"
onClick={() => setIsShortcutsModalOpen(true)}
style={{ background: 'transparent', border: 'none', cursor: 'pointer', fontFamily: 'inherit', fontSize: 'inherit', color: 'inherit', padding: 0 }}
>
Keyboard Shortcuts (?)
</button>
)}
</nav>
</footer>

<ShortcutsModal
isOpen={isShortcutsModalOpen}
onClose={() => setIsShortcutsModalOpen(false)}
/>
{!isTouchDevice && (
<ShortcutsModal
isOpen={isShortcutsModalOpen}
onClose={() => setIsShortcutsModalOpen(false)}
/>
)}

<CompareTray />
<CompareDrawer />
Expand Down
2 changes: 2 additions & 0 deletions src/data/mockApis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export type Review = {
verified: boolean;
};



export type APIItem = {
id: string;
name: string;
Expand Down