mirror of
https://github.com/usememos/memos.git
synced 2025-10-18 02:07:09 +08:00
fix: translate in members section
This commit is contained in:
parent
5686fdfb0a
commit
47a9b434e6
1 changed files with 10 additions and 11 deletions
|
@ -12,17 +12,6 @@ import { User, User_Role } from "@/types/proto/api/v1/user_service";
|
|||
import { useTranslate } from "@/utils/i18n";
|
||||
import showChangeMemberPasswordDialog from "../ChangeMemberPasswordDialog";
|
||||
|
||||
const stringifyUserRole = (role: User_Role) => {
|
||||
const t = useTranslate();
|
||||
if (role === User_Role.HOST) {
|
||||
return "Host";
|
||||
} else if (role === User_Role.ADMIN) {
|
||||
return t("setting.member-section.admin");
|
||||
} else {
|
||||
return t("setting.member-section.user");
|
||||
}
|
||||
};
|
||||
|
||||
interface LocalState {
|
||||
creatingUser: User;
|
||||
}
|
||||
|
@ -49,6 +38,16 @@ const MemberSection = () => {
|
|||
setUsers(users);
|
||||
};
|
||||
|
||||
const stringifyUserRole = (role: User_Role) => {
|
||||
if (role === User_Role.HOST) {
|
||||
return "Host";
|
||||
} else if (role === User_Role.ADMIN) {
|
||||
return t("setting.member-section.admin");
|
||||
} else {
|
||||
return t("setting.member-section.user");
|
||||
}
|
||||
};
|
||||
|
||||
const handleUsernameInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setState({
|
||||
...state,
|
||||
|
|
Loading…
Add table
Reference in a new issue