Web:Common:InfoPanel: fix unsupported code

This commit is contained in:
Timofey Boyko 2023-03-24 17:39:19 +03:00
parent 27428ea2d9
commit b527d617e3

View File

@ -143,10 +143,6 @@ const InfoPanel = ({
canDisplay, canDisplay,
viewAs, viewAs,
}) => { }) => {
if (!isVisible || !canDisplay) return null;
if ((isTablet() || isMobile || isMobileUtils()) && isMobileHidden)
return null;
const closeInfoPanel = () => setIsVisible(false); const closeInfoPanel = () => setIsVisible(false);
useEffect(() => { useEffect(() => {
@ -198,7 +194,13 @@ const InfoPanel = ({
); );
}; };
return isMobileOnly ? renderPortalInfoPanel() : infoPanelComponent; return !isVisible ||
!canDisplay ||
((isTablet() || isMobile || isMobileUtils()) && isMobileHidden)
? null
: isMobileOnly
? renderPortalInfoPanel()
: infoPanelComponent;
}; };
InfoPanel.propTypes = { InfoPanel.propTypes = {
@ -215,12 +217,8 @@ StyledInfoPanel.defaultProps = { theme: Base };
InfoPanel.defaultProps = { theme: Base }; InfoPanel.defaultProps = { theme: Base };
export default inject(({ auth }) => { export default inject(({ auth }) => {
const { const { isVisible, isMobileHidden, setIsVisible, getCanDisplay } =
isVisible, auth.infoPanelStore;
isMobileHidden,
setIsVisible,
getCanDisplay,
} = auth.infoPanelStore;
const canDisplay = getCanDisplay(); const canDisplay = getCanDisplay();