v2-ui #94

Merged
Vishnu merged 38 commits from v2-ui into main 2025-05-26 05:09:47 +00:00
Showing only changes of commit ae7f33c485 - Show all commits

View File

@@ -10,8 +10,7 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
const [selectedComment, setSelectedComment] = useState<CommentSchema | null>(null); const [selectedComment, setSelectedComment] = useState<CommentSchema | null>(null);
const [transformMode, setTransformMode] = useState<"translate" | "rotate" | null>(null); const [transformMode, setTransformMode] = useState<"translate" | "rotate" | null>(null);
if (comment.state === 'inactive' || isPlaying) return null;
useEffect(() => { useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => { const handleKeyDown = (e: KeyboardEvent) => {
const keyCombination = detectModifierKeys(e); const keyCombination = detectModifierKeys(e);
@@ -23,11 +22,13 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
setTransformMode((prev) => (prev === "rotate" ? null : "rotate")); setTransformMode((prev) => (prev === "rotate" ? null : "rotate"));
} }
}; };
window.addEventListener("keydown", handleKeyDown); window.addEventListener("keydown", handleKeyDown);
return () => window.removeEventListener("keydown", handleKeyDown); return () => window.removeEventListener("keydown", handleKeyDown);
}, [selectedComment]); }, [selectedComment]);
if (comment.state === 'inactive' || isPlaying) return null;
return ( return (
<> <>