fix(client): no-key warning in user menu items (#496)

This commit is contained in:
Junyi 2022-06-10 22:19:52 +08:00 committed by GitHub
parent 082e27ff10
commit 9d5e2462d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 2 deletions

View File

@ -120,6 +120,7 @@ export const ChangePassword = () => {
return (
<ActionContext.Provider value={{ visible, setVisible }}>
<Menu.Item
key="password"
eventKey={'ChangePassword'}
onClick={() => {
ctx?.setVisible?.(false);

View File

@ -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);

View File

@ -105,6 +105,7 @@ export const EditProfile = () => {
return (
<ActionContext.Provider value={{ visible, setVisible }}>
<Menu.Item
key="profile"
eventKey={'EditProfile'}
onClick={() => {
setVisible(true);

View File

@ -17,6 +17,7 @@ export const LanguageSettings = () => {
// console.log('data', data?.data?.enabledLanguages);
return (
<Menu.Item
key="language"
eventKey={'LanguageSettings'}
onClick={() => {
setOpen(true);

View File

@ -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 }}