Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
47a92439
authored
Mar 08, 2025
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: Simplify chat menu items rendering in SiderBar
parent
69e6d5ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
31 deletions
+28
-31
web/src/components/SiderBar.js
+28
-31
No files found.
web/src/components/SiderBar.js
View file @
47a92439
...
...
@@ -294,39 +294,36 @@ const SiderBar = () => {
}}
>
{
/* Chat Section - Only show if there are chat items */
}
{
chatItems
.
length
>
0
&&
(
<>
{
chatMenuItems
.
map
((
item
)
=>
{
if
(
item
.
items
&&
item
.
items
.
length
>
0
)
{
return
(
<
Nav
.
Sub
key
=
{
item
.
itemKey
}
itemKey
=
{
item
.
itemKey
}
text
=
{
item
.
text
}
icon
=
{
item
.
icon
}
>
{
item
.
items
.
map
((
subItem
)
=>
(
<
Nav
.
Item
key
=
{
subItem
.
itemKey
}
itemKey
=
{
subItem
.
itemKey
}
text
=
{
subItem
.
text
}
/
>
))}
<
/Nav.Sub
>
);
}
else
{
return
(
{
chatMenuItems
.
map
((
item
)
=>
{
if
(
item
.
items
&&
item
.
items
.
length
>
0
)
{
return
(
<
Nav
.
Sub
key
=
{
item
.
itemKey
}
itemKey
=
{
item
.
itemKey
}
text
=
{
item
.
text
}
icon
=
{
item
.
icon
}
>
{
item
.
items
.
map
((
subItem
)
=>
(
<
Nav
.
Item
key
=
{
item
.
itemKey
}
itemKey
=
{
item
.
itemKey
}
text
=
{
item
.
text
}
icon
=
{
item
.
icon
}
key
=
{
subItem
.
itemKey
}
itemKey
=
{
subItem
.
itemKey
}
text
=
{
subItem
.
text
}
/
>
);
}
})}
<
/
>
)}
))}
<
/Nav.Sub
>
);
}
else
{
return
(
<
Nav
.
Item
key
=
{
item
.
itemKey
}
itemKey
=
{
item
.
itemKey
}
text
=
{
item
.
text
}
icon
=
{
item
.
icon
}
/
>
);
}
})}
{
/* Divider */
}
<
Divider
style
=
{
dividerStyle
}
/
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment