GuoRuqiang 1 год назад
Родитель
Сommit
bab718e9bc
2 измененных файлов с 11 добавлено и 11 удалено
  1. 1 1
      web/src/components/HeaderBar.js
  2. 10 10
      web/src/components/SiderBar.js

+ 1 - 1
web/src/components/HeaderBar.js

@@ -57,7 +57,7 @@ let buttons = [
     onMouseLeave: (e) => {
       e.currentTarget.querySelector('svg').style.color = 'black';
     },
-    className: localStorage.getItem('chat_link')
+    className: localStorage.getItem('chat_link') && !isMobile() //移动端不显示
       ? 'semi-navigation-item-normal'
       : 'tableHiddle',
   },

+ 10 - 10
web/src/components/SiderBar.js

@@ -86,16 +86,16 @@ const SiderBar = () => {
         icon: <IconLayers />,
         className: isAdmin() ? 'semi-navigation-item-normal' : 'tableHiddle',
       },
-      // 去掉侧边栏的聊天,换到HeaderBar
-      // {
-      //   text: '聊天',
-      //   itemKey: 'chat',
-      //   to: '/chat',
-      //   icon: <IconComment />,
-      //   className: localStorage.getItem('chat_link')
-      //     ? 'semi-navigation-item-normal'
-      //     : 'tableHiddle',
-      // },
+      // 修改侧边栏的聊天按钮,当移动端的时候才显示。
+      {
+        text: '聊天',
+        itemKey: 'chat',
+        to: '/chat',
+        icon: <IconComment />,
+        className: isMobile() && localStorage.getItem('chat_link')
+          ? 'semi-navigation-item-normal'
+          : 'tableHiddle',
+      },
       {
         text: '令牌',
         itemKey: 'token',