Просмотр исходного кода

fix: Update label truncation logic in Playground and adjust sider visibility in HeaderBar

- Modified the group label truncation in the Playground component to shorten labels exceeding 16 characters for better mobile display.
- Corrected the conditional rendering logic in the HeaderBar to toggle the sider visibility based on its current state, enhancing user interface responsiveness.
CalciumIon 1 год назад
Родитель
Сommit
d241e4fe29
2 измененных файлов с 3 добавлено и 3 удалено
  1. 1 1
      web/src/components/HeaderBar.js
  2. 2 2
      web/src/pages/Playground/Playground.js

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

@@ -148,7 +148,7 @@ const HeaderBar = () => {
               logo: (
                 <>
                   {
-                    styleState.showSider ?
+                    !styleState.showSider ?
                       <Button icon={<IconMenu />} theme="light" aria-label="展开侧边栏" onClick={
                         () => styleDispatch({ type: 'SET_SIDER', payload: true })
                       } />:

+ 2 - 2
web/src/pages/Playground/Playground.js

@@ -328,8 +328,8 @@ const Playground = () => {
               autoComplete='new-password'
               optionList={groups.map((group) => ({
                 ...group,
-                label: styleState.isMobile && group.label.length > 18
-                  ? group.label.substring(0, 18) + '...'
+                label: styleState.isMobile && group.label.length > 16
+                  ? group.label.substring(0, 16) + '...'
                   : group.label,
               }))}
             />