mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-05 05:38:23 +08:00
fix(client): no-key warning in user menu items (#496)
This commit is contained in:
parent
082e27ff10
commit
9d5e2462d9
@ -120,6 +120,7 @@ export const ChangePassword = () => {
|
||||
return (
|
||||
<ActionContext.Provider value={{ visible, setVisible }}>
|
||||
<Menu.Item
|
||||
key="password"
|
||||
eventKey={'ChangePassword'}
|
||||
onClick={() => {
|
||||
ctx?.setVisible?.(false);
|
||||
|
@ -26,7 +26,7 @@ export const CurrentUser = () => {
|
||||
}}
|
||||
overlay={
|
||||
<Menu>
|
||||
<Menu.Item disabled>Version {process.env.VERSION}</Menu.Item>
|
||||
<Menu.Item key="version" disabled>Version {process.env.VERSION}</Menu.Item>
|
||||
<Menu.Divider />
|
||||
<EditProfile />
|
||||
<ChangePassword />
|
||||
@ -34,6 +34,7 @@ export const CurrentUser = () => {
|
||||
<LanguageSettings />
|
||||
<Menu.Divider />
|
||||
<Menu.Item
|
||||
key="signout"
|
||||
onClick={async () => {
|
||||
await api.resource('users').signout();
|
||||
api.auth.setToken(null);
|
||||
|
@ -105,6 +105,7 @@ export const EditProfile = () => {
|
||||
return (
|
||||
<ActionContext.Provider value={{ visible, setVisible }}>
|
||||
<Menu.Item
|
||||
key="profile"
|
||||
eventKey={'EditProfile'}
|
||||
onClick={() => {
|
||||
setVisible(true);
|
||||
|
@ -17,6 +17,7 @@ export const LanguageSettings = () => {
|
||||
// console.log('data', data?.data?.enabledLanguages);
|
||||
return (
|
||||
<Menu.Item
|
||||
key="language"
|
||||
eventKey={'LanguageSettings'}
|
||||
onClick={() => {
|
||||
setOpen(true);
|
||||
|
@ -33,7 +33,7 @@ export const SwitchRole = () => {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<Menu.Item eventKey={'SwitchRole'}>
|
||||
<Menu.Item key="role" eventKey={'SwitchRole'}>
|
||||
{t('Switch role')}{' '}
|
||||
<Select
|
||||
style={{ minWidth: 100 }}
|
||||
|
Loading…
Reference in New Issue
Block a user