Skip to content

Commit 5021097

Browse files
rsbhclaude
andcommitted
fix: remove react-device-detect, use navigator.platform
react-device-detect causes ESM export issues when run from npx cache. Replace with inline navigator.platform check for Mac detection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1f5227c commit 5021097

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

packages/chronicle/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"mermaid": "^11.13.0",
4949
"openapi-types": "^12.1.3",
5050
"react": "^19.0.0",
51-
"react-device-detect": "^2.2.3",
51+
5252
"react-dom": "^19.0.0",
5353
"react-router-dom": "^7.13.1",
5454
"remark-directive": "^4.0.0",

packages/chronicle/src/components/ui/search.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { useNavigate } from "react-router-dom";
55
import { Button, Command, Dialog, Text } from "@raystack/apsara";
66
import { cx } from "class-variance-authority";
77
import { DocumentIcon, HashtagIcon } from "@heroicons/react/24/outline";
8-
import { isMacOs } from "react-device-detect";
98
import { MethodBadge } from "@/components/api/method-badge";
109
import styles from "./search.module.css";
1110

@@ -45,7 +44,7 @@ function SearchShortcutKey({ className }: { className?: string }) {
4544
const [key, setKey] = useState("\u2318");
4645

4746
useEffect(() => {
48-
setKey(isMacOs ? "\u2318" : "Ctrl");
47+
setKey(navigator.platform?.startsWith("Mac") ? "\u2318" : "Ctrl");
4948
}, []);
5049

5150
return (

0 commit comments

Comments
 (0)