fix: should not tight border in desktop app

This commit is contained in:
Yidadaa 2023-09-19 23:26:52 +08:00
parent f1e7db6a88
commit eae7d6260f

View File

@ -115,7 +115,10 @@ const loadAsyncGoogleFont = () => {
getClientConfig()?.buildMode === "export" ? remoteFontUrl : proxyFontUrl; getClientConfig()?.buildMode === "export" ? remoteFontUrl : proxyFontUrl;
linkEl.rel = "stylesheet"; linkEl.rel = "stylesheet";
linkEl.href = linkEl.href =
googleFontUrl + "/css2?family=" + encodeURIComponent("Noto Sans:wght@300;400;700;900") + "&display=swap"; googleFontUrl +
"/css2?family=" +
encodeURIComponent("Noto Sans:wght@300;400;700;900") +
"&display=swap";
document.head.appendChild(linkEl); document.head.appendChild(linkEl);
}; };
@ -125,6 +128,8 @@ function Screen() {
const isHome = location.pathname === Path.Home; const isHome = location.pathname === Path.Home;
const isAuth = location.pathname === Path.Auth; const isAuth = location.pathname === Path.Auth;
const isMobileScreen = useMobileScreen(); const isMobileScreen = useMobileScreen();
const shouldTightBorder =
config.tightBorder && !isMobileScreen && !getClientConfig()?.isApp;
useEffect(() => { useEffect(() => {
loadAsyncGoogleFont(); loadAsyncGoogleFont();
@ -134,11 +139,9 @@ function Screen() {
<div <div
className={ className={
styles.container + styles.container +
` ${ ` ${shouldTightBorder ? styles["tight-container"] : styles.container} ${
config.tightBorder && !isMobileScreen getLang() === "ar" ? styles["rtl-screen"] : ""
? styles["tight-container"] }`
: styles.container
} ${getLang() === "ar" ? styles["rtl-screen"] : ""}`
} }
> >
{isAuth ? ( {isAuth ? (