Clean up editor code and reorganize contents (#478)

This commit is contained in:
Jeremy 2024-11-01 15:31:54 +05:30 committed by GitHub
parent b3aa3cb18a
commit 5190b109c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 475 additions and 444 deletions

View file

@ -9,6 +9,7 @@ import {
useTransform,
} from 'framer-motion';
import { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react';
import { useOnClickOutside } from 'usehooks-ts';
import {
Tooltip,
@ -25,7 +26,6 @@ import {
StopIcon,
SummarizeIcon,
} from './icons';
import useClickOutside from './use-click-outside';
type ToolProps = {
type: 'final-polish' | 'request-suggestions' | 'adjust-reading-level';
@ -265,7 +265,7 @@ export const Toolbar = ({
const [selectedTool, setSelectedTool] = useState<string | null>(null);
const [isAnimating, setIsAnimating] = useState(false);
useClickOutside(toolbarRef, () => {
useOnClickOutside(toolbarRef, () => {
setIsToolbarVisible(false);
setSelectedTool(null);
});