camera and gallery image crop

This commit is contained in:
azykov@mail.ru
2026-09-29 20:04:58 +03:00
parent b6fb2fe40f
commit 45158cde38
11 changed files with 553 additions and 27 deletions
+5
View File
@@ -1,4 +1,5 @@
import { useEffect, useRef, useState } from 'react';
import { pushOverlayBack } from './platform.js';
import type { ScanResult } from './scanner.js';
import { Icon } from './ui.js';
@@ -10,6 +11,10 @@ export function ScannerView({ formats, hint, onResult, onClose }: { formats: For
const [error, setError] = useState<string>();
const onResultRef = useRef(onResult);
onResultRef.current = onResult;
// Android back button closes the scanner, not the screen underneath.
const closeRef = useRef(onClose);
closeRef.current = onClose;
useEffect(() => pushOverlayBack(closeRef), []);
useEffect(() => {
let stopped = false;