Browse Source

fixup: wont show fullscreen icon on mobile

Yidadaa 1 year ago
parent
commit
3c1e81897a
2 changed files with 17 additions and 11 deletions
  1. 13 11
      app/components/chat.tsx
  2. 4 0
      app/components/home.tsx

+ 13 - 11
app/components/chat.tsx

@@ -593,17 +593,19 @@ export function Chat(props: {
               }}
               }}
             />
             />
           </div>
           </div>
-          <div className={styles["window-action-button"]}>
-            <IconButton
-              icon={chatStore.config.tightBorder ? <MinIcon /> : <MaxIcon />}
-              bordered
-              onClick={() => {
-                chatStore.updateConfig(
-                  (config) => (config.tightBorder = !config.tightBorder),
-                );
-              }}
-            />
-          </div>
+          {!isMobileScreen() && (
+            <div className={styles["window-action-button"]}>
+              <IconButton
+                icon={chatStore.config.tightBorder ? <MinIcon /> : <MaxIcon />}
+                bordered
+                onClick={() => {
+                  chatStore.updateConfig(
+                    (config) => (config.tightBorder = !config.tightBorder),
+                  );
+                }}
+              />
+            </div>
+          )}
         </div>
         </div>
 
 
         <PromptToast
         <PromptToast

+ 4 - 0
app/components/home.tsx

@@ -114,6 +114,10 @@ function useDragSideBar() {
   };
   };
 
 
   useEffect(() => {
   useEffect(() => {
+    if (isMobileScreen()) {
+      return;
+    }
+
     document.documentElement.style.setProperty(
     document.documentElement.style.setProperty(
       "--sidebar-width",
       "--sidebar-width",
       `${limit(chatStore.config.sidebarWidth ?? 300)}px`,
       `${limit(chatStore.config.sidebarWidth ?? 300)}px`,