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
15565784
authored
Jan 07, 2024
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复侧边导航栏需要刷新才出现选项的问题
parent
40735b9d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
web/src/components/SiderBar.js
+11
-10
No files found.
web/src/components/SiderBar.js
View file @
15565784
import
React
,
{
useContext
,
useState
}
from
'react'
;
import
React
,
{
useContext
,
use
Memo
,
use
State
}
from
'react'
;
import
{
Link
,
useNavigate
}
from
'react-router-dom'
;
import
{
Link
,
useNavigate
}
from
'react-router-dom'
;
import
{
UserContext
}
from
'../context/User'
;
import
{
UserContext
}
from
'../context/User'
;
...
@@ -21,7 +21,15 @@ import {
...
@@ -21,7 +21,15 @@ import {
import
{
Nav
,
Avatar
,
Dropdown
,
Layout
}
from
'@douyinfe/semi-ui'
;
import
{
Nav
,
Avatar
,
Dropdown
,
Layout
}
from
'@douyinfe/semi-ui'
;
// HeaderBar Buttons
// HeaderBar Buttons
let
headerButtons
=
[
const
SiderBar
=
()
=>
{
const
[
userState
,
userDispatch
]
=
useContext
(
UserContext
);
let
navigate
=
useNavigate
();
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
([
'home'
]);
const
[
showSidebar
,
setShowSidebar
]
=
useState
(
false
);
const
systemName
=
getSystemName
();
const
logo
=
getLogo
();
const
headerButtons
=
useMemo
(()
=>
[
{
{
text
:
'首页'
,
text
:
'首页'
,
itemKey
:
'home'
,
itemKey
:
'home'
,
...
@@ -100,15 +108,8 @@ let headerButtons = [
...
@@ -100,15 +108,8 @@ let headerButtons = [
// to: '/about',
// to: '/about',
// icon: <IconAt/>
// icon: <IconAt/>
// }
// }
]
;
],
[
localStorage
.
getItem
(
'enable_data_export'
),
localStorage
.
getItem
(
'enable_drawing'
),
localStorage
.
getItem
(
'chat_link'
),
isAdmin
()])
;
const
SiderBar
=
()
=>
{
const
[
userState
,
userDispatch
]
=
useContext
(
UserContext
);
let
navigate
=
useNavigate
();
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
([
'home'
]);
const
[
showSidebar
,
setShowSidebar
]
=
useState
(
false
);
const
systemName
=
getSystemName
();
const
logo
=
getLogo
();
async
function
logout
()
{
async
function
logout
()
{
setShowSidebar
(
false
);
setShowSidebar
(
false
);
...
...
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