Merge branch 'develop' into feature/whitelabel

This commit is contained in:
Viktor Fomin 2022-11-02 13:20:18 +05:00
commit 6ebfa4d559
4 changed files with 1456 additions and 788 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react";
import styled from "styled-components";
import { isMobile, isIOS } from "react-device-detect";
import { inject, observer } from "mobx-react";
import { useLocation } from "react-router-dom";
import SmartBanner from "react-smartbanner";
import "./main.css";
@ -10,14 +11,9 @@ const Wrapper = styled.div`
`;
const ReactSmartBanner = (props) => {
const {
t,
ready,
isBannerVisible,
setIsBannerVisible,
currentProductId,
} = props;
const { t, ready, isBannerVisible, setIsBannerVisible } = props;
const force = isIOS ? "ios" : "android";
const location = useLocation();
const [isDocuments, setIsDocuments] = useState(false);
@ -43,12 +39,12 @@ const ReactSmartBanner = (props) => {
}, []);
useEffect(() => {
if (window.location.pathname.toLowerCase().includes("files")) {
if (window.location.pathname.toLowerCase().includes("rooms")) {
setIsDocuments(true);
} else {
setIsDocuments(false);
}
}, [currentProductId]);
}, [location]);
const storeText = {
ios: t("SmartBanner:AppStore"),
@ -99,10 +95,9 @@ const ReactSmartBanner = (props) => {
);
};
export default inject(({ auth, bannerStore }) => {
export default inject(({ bannerStore }) => {
return {
isBannerVisible: bannerStore.isBannerVisible,
setIsBannerVisible: bannerStore.setIsBannerVisible,
currentProductId: auth.settingsStore.currentProductId,
};
})(observer(ReactSmartBanner));

View File

@ -114,7 +114,6 @@
}
.smartbanner-ios {
background: #f2f2f2;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
line-height: 80px;
}
.smartbanner-ios .smartbanner-close {

View File

@ -1,7 +1,7 @@
import { makeAutoObservable } from "mobx";
class BannerStore {
isBannerVisible = false; //TODO: set to true after fix
isBannerVisible = true;
constructor() {
makeAutoObservable(this);