Web:Client:PortalSettings: fix branding mobile view

This commit is contained in:
Timofey Boyko 2023-05-03 13:30:47 +03:00
parent cf9a5117df
commit 8a49d98e45

View File

@ -60,7 +60,7 @@ const Branding = ({
isSettingPaid,
standalone,
}) => {
const [viewDesktop, setViewDesktop] = useState(false);
// const [viewDesktop, setViewDesktop] = useState(false);
useEffect(() => {
return () => {
@ -70,22 +70,22 @@ const Branding = ({
};
}, []);
useEffect(() => {
onCheckView();
window.addEventListener("resize", onCheckView);
// useEffect(() => {
// onCheckView();
// window.addEventListener("resize", onCheckView);
return () => window.removeEventListener("resize", onCheckView);
}, []);
// return () => window.removeEventListener("resize", onCheckView);
// }, []);
const onCheckView = () => {
if (!isMobile && window.innerWidth > 1024) {
setViewDesktop(true);
} else {
setViewDesktop(false);
}
};
// const onCheckView = () => {
// if (!isMobile && window.innerWidth > 1024) {
// setViewDesktop(true);
// } else {
// setViewDesktop(false);
// }
// };
if (!viewDesktop)
if (isMobile)
return <BreakpointWarning sectionName={t("Settings:Branding")} />;
return (