develop
This commit is contained in:
parent
dac5b5dcfc
commit
e68a9366a3
@ -2,7 +2,7 @@ import Webcam from "react-webcam";
|
||||
import styles from "./styles.module.scss";
|
||||
import ModalOverlay, { ModalOverlayType } from "@/components/palmistry/modal-overlay/modal-overlay";
|
||||
import Modal from "@/components/palmistry/modal/modal";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useRef, useState } from "react";
|
||||
// import { useDynamicSize } from "@/hooks/useDynamicSize";
|
||||
|
||||
interface CameraModalProps {
|
||||
@ -32,9 +32,9 @@ function CameraModal({
|
||||
// const ratio = isLandscape ? width / height : height / width;
|
||||
const cameraRef = useRef<Webcam>(null);
|
||||
|
||||
useEffect(() => {
|
||||
setIsVideoReady(false);
|
||||
}, [reinitializeKey]);
|
||||
// useEffect(() => {
|
||||
// setIsVideoReady(false);
|
||||
// }, [reinitializeKey]);
|
||||
|
||||
const onClickOverlay = (e: React.MouseEvent) => {
|
||||
if (e.target === e.currentTarget) {
|
||||
|
||||
@ -31,7 +31,11 @@ function Camera() {
|
||||
const isIphoneSafari = useMemo((): boolean => {
|
||||
const userAgent = navigator.userAgent;
|
||||
const isIOS = /iPhone/i.test(userAgent);
|
||||
const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
|
||||
const isSafari = /Safari/i.test(userAgent) &&
|
||||
!/CriOS/i.test(userAgent) && // не Chrome
|
||||
!/FxiOS/i.test(userAgent) && // не Firefox
|
||||
!/EdgiOS/i.test(userAgent) && // не Edge
|
||||
!/OPiOS/i.test(userAgent); // не Opera
|
||||
|
||||
return isIOS && isSafari;
|
||||
}, []);
|
||||
|
||||
@ -2,7 +2,7 @@ import Webcam from "react-webcam";
|
||||
import styles from "./styles.module.scss";
|
||||
import ModalOverlay, { ModalOverlayType } from "@/components/palmistry/modal-overlay/modal-overlay";
|
||||
import Modal from "@/components/palmistry/modal/modal";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useRef, useState } from "react";
|
||||
// import { useDynamicSize } from "@/hooks/useDynamicSize";
|
||||
|
||||
interface CameraModalProps {
|
||||
@ -32,9 +32,9 @@ function CameraModal({
|
||||
// const ratio = isLandscape ? width / height : height / width;
|
||||
const cameraRef = useRef<Webcam>(null);
|
||||
|
||||
useEffect(() => {
|
||||
setIsVideoReady(false);
|
||||
}, [reinitializeKey]);
|
||||
// useEffect(() => {
|
||||
// setIsVideoReady(false);
|
||||
// }, [reinitializeKey]);
|
||||
|
||||
const onClickOverlay = (e: React.MouseEvent) => {
|
||||
if (e.target === e.currentTarget) {
|
||||
|
||||
@ -31,7 +31,11 @@ function Camera() {
|
||||
const isIphoneSafari = useMemo((): boolean => {
|
||||
const userAgent = navigator.userAgent;
|
||||
const isIOS = /iPhone/i.test(userAgent);
|
||||
const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
|
||||
const isSafari = /Safari/i.test(userAgent) &&
|
||||
!/CriOS/i.test(userAgent) && // не Chrome
|
||||
!/FxiOS/i.test(userAgent) && // не Firefox
|
||||
!/EdgiOS/i.test(userAgent) && // не Edge
|
||||
!/OPiOS/i.test(userAgent); // не Opera
|
||||
|
||||
return isIOS && isSafari;
|
||||
}, []);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user