feat: render Highlighter if getText
This commit is contained in:
@@ -5,6 +5,7 @@ import { useBrowserDimensionsStore } from "../../context/browserDimensions";
|
|||||||
import { Highlighter } from "../atoms/Highlighter";
|
import { Highlighter } from "../atoms/Highlighter";
|
||||||
import { GenericModal } from '../atoms/GenericModal';
|
import { GenericModal } from '../atoms/GenericModal';
|
||||||
import { Button, Typography, Box } from '@mui/material';
|
import { Button, Typography, Box } from '@mui/material';
|
||||||
|
import { useActionContext } from '../../context/browserActions';
|
||||||
|
|
||||||
interface ConfirmationBoxProps {
|
interface ConfirmationBoxProps {
|
||||||
selector: string;
|
selector: string;
|
||||||
@@ -40,8 +41,11 @@ export const BrowserWindow = () => {
|
|||||||
const [highlighterData, setHighlighterData] = useState<{ rect: DOMRect, selector: string } | null>(null);
|
const [highlighterData, setHighlighterData] = useState<{ rect: DOMRect, selector: string } | null>(null);
|
||||||
const [showConfirmation, setShowConfirmation] = useState(false);
|
const [showConfirmation, setShowConfirmation] = useState(false);
|
||||||
|
|
||||||
|
|
||||||
const { socket } = useSocketStore();
|
const { socket } = useSocketStore();
|
||||||
const { width, height } = useBrowserDimensionsStore();
|
const { width, height } = useBrowserDimensionsStore();
|
||||||
|
const { getText, getScreenshot, resetActions } = useActionContext();
|
||||||
|
|
||||||
|
|
||||||
console.log('Use browser dimensions:', width, height)
|
console.log('Use browser dimensions:', width, height)
|
||||||
|
|
||||||
@@ -139,7 +143,7 @@ export const BrowserWindow = () => {
|
|||||||
</GenericModal>
|
</GenericModal>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
{(!showConfirmation && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ?
|
{(getText && !showConfirmation && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ?
|
||||||
<Highlighter
|
<Highlighter
|
||||||
unmodifiedRect={highlighterData?.rect}
|
unmodifiedRect={highlighterData?.rect}
|
||||||
displayedSelector={highlighterData?.selector}
|
displayedSelector={highlighterData?.selector}
|
||||||
|
|||||||
Reference in New Issue
Block a user