Skip to content

Commit

Permalink
fix: Update label truncation logic in Playground and adjust sider vis…
Browse files Browse the repository at this point in the history
…ibility 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.
  • Loading branch information
Calcium-Ion committed Dec 12, 2024
1 parent e17f36e commit d241e4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/src/components/HeaderBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
} />:
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/Playground/Playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}))}
/>
Expand Down

0 comments on commit d241e4f

Please sign in to comment.