gbc-kyc-kit 2.0.13 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37932,18 +37932,38 @@ const DocumentReaderController = (dataDocument, clientId, authorize, eventId, so
37932
37932
  });
37933
37933
  setActivateCamera(false);
37934
37934
  };
37935
+ const usePortrait = () => {
37936
+ const [isPortrait2, setIsPortrait] = useState(window.innerHeight > window.innerWidth);
37937
+ useEffect(() => {
37938
+ const handleResize = () => {
37939
+ setIsPortrait(window.innerHeight > window.innerWidth);
37940
+ };
37941
+ window.addEventListener("resize", handleResize);
37942
+ return () => {
37943
+ window.removeEventListener("resize", handleResize);
37944
+ };
37945
+ }, []);
37946
+ return isPortrait2;
37947
+ };
37948
+ const isPortrait = usePortrait();
37935
37949
  const videoConstraints = {
37936
37950
  width: {
37937
- ideal: 1280
37951
+ ideal: isPortrait ? 720 : 1280
37938
37952
  },
37939
37953
  height: {
37940
- ideal: 720
37954
+ ideal: isPortrait ? 1280 : 720
37941
37955
  },
37942
37956
  aspectRatio: {
37943
- ideal: 16 / 9
37957
+ ideal: isPortrait ? 9 / 16 : 16 / 9
37944
37958
  },
37945
- facingMode: "user"
37959
+ facingMode: "environment"
37946
37960
  };
37961
+ useEffect(() => {
37962
+ if (activateCamera) {
37963
+ setActivateCamera(false);
37964
+ setTimeout(() => setActivateCamera(true), 100);
37965
+ }
37966
+ }, [isPortrait]);
37947
37967
  return {
37948
37968
  onSendSubmitDocument,
37949
37969
  simpleHandleSubmit,
@@ -38441,7 +38461,7 @@ function DocumentReader({
38441
38461
  audio: false,
38442
38462
  style: {
38443
38463
  width: "98%",
38444
- height: "98%",
38464
+ height: "auto",
38445
38465
  objectFit: "cover",
38446
38466
  position: "absolute",
38447
38467
  top: "50%",