@stokr/components-library 3.0.25 → 3.0.26
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.
|
@@ -45,7 +45,7 @@ class MainMenuClass extends PureComponent {
|
|
|
45
45
|
isScrollDown: false
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
|
-
checkActive = (url) => window.location.href.split("/").indexOf(url) > 0;
|
|
48
|
+
checkActive = (url) => typeof window !== "undefined" ? window.location.href.split("/").indexOf(url) > 0 : false;
|
|
49
49
|
render() {
|
|
50
50
|
const { isSettingsActive, isScrollDown, overrideHeightNeeded } = this.state;
|
|
51
51
|
const {
|
|
@@ -9,7 +9,7 @@ const StepsProgressSignup = (props) => {
|
|
|
9
9
|
const { country, kyc_status, taxId, wallets = [] } = user;
|
|
10
10
|
const KYCNotDone = !kyc_status || kyc_status === "Reaply" || kyc_status === "Cancelled" || kyc_status === "Draft";
|
|
11
11
|
const hasLiquidWallet = wallets?.filter((wallet) => wallet.type === walletTypes.LIQUID).length > 0;
|
|
12
|
-
const isActiveStep = (path) => window.location.pathname.includes(path);
|
|
12
|
+
const isActiveStep = (path) => typeof window !== "undefined" ? window.location.pathname.includes(path) : false;
|
|
13
13
|
const items = [
|
|
14
14
|
{
|
|
15
15
|
id: "country",
|
|
@@ -4,9 +4,9 @@ import { sizes } from "../styles/rwd.js";
|
|
|
4
4
|
const useMobileView = (breakpoint = sizes.Medium) => {
|
|
5
5
|
var breakpointNumber = breakpoint.match(/\d/g);
|
|
6
6
|
breakpointNumber = breakpointNumber.join("");
|
|
7
|
-
const [isMobile, setisMobile] = React__default.useState(
|
|
7
|
+
const [isMobile, setisMobile] = React__default.useState(false);
|
|
8
8
|
const timeout = React__default.useRef();
|
|
9
|
-
const checkIsMobile = () => window.innerWidth <= breakpointNumber;
|
|
9
|
+
const checkIsMobile = () => typeof window !== "undefined" ? window.innerWidth <= breakpointNumber : false;
|
|
10
10
|
const onResizeTimeout = () => {
|
|
11
11
|
setisMobile(checkIsMobile());
|
|
12
12
|
};
|
|
@@ -15,10 +15,10 @@ const useMobileView = (breakpoint = sizes.Medium) => {
|
|
|
15
15
|
timeout.current = setTimeout(onResizeTimeout, 100);
|
|
16
16
|
};
|
|
17
17
|
React__default.useEffect(() => {
|
|
18
|
+
setisMobile(window.innerWidth <= breakpointNumber);
|
|
18
19
|
window.addEventListener("resize", onResize);
|
|
19
|
-
const initialId = setTimeout(onResizeTimeout, 0);
|
|
20
20
|
return () => {
|
|
21
|
-
clearTimeout(
|
|
21
|
+
clearTimeout(timeout.current);
|
|
22
22
|
window.removeEventListener("resize", onResize);
|
|
23
23
|
};
|
|
24
24
|
}, []);
|