Skip to content

Commit

Permalink
translations
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Oct 29, 2023
1 parent dc9cfc7 commit dc5ba24
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 58 deletions.
107 changes: 57 additions & 50 deletions src/components/adminPage/users/userIsActive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,64 +64,51 @@ const UserIsActive = ({ user }: Iuser) => {
});

return (
<div className="form-control grid grid-cols-1 md:grid-cols-3 gap-10 relative">
<div>
<header className="text-sm">
{t("users.users.userOptionModal.userAccountLabel")}
</header>
<select
value={user?.isActive ? "Active" : "Disabled"}
onChange={(e) => {
updateUser(
{
id: user?.id,
params: { isActive: e.target.value === "Active" ? true : false },
},
{
onSuccess: () => {
toast.success("User updated successfully");
},
},
);
}}
className="select select-sm select-bordered select-ghost max-w-xs"
>
<option value="Active">Active</option>
<option value="Disabled">Disabled</option>
</select>
</div>
<div className="col-span-2">
<p className="text-sm">{t("users.users.userOptionModal.userExpireLabel")}</p>
<div className="flex gap-5">
<DatePicker
className="bg-gray-500"
selected={user.expiresAt}
popperPlacement="bottom-start"
// popperClassName="absolute"
onChange={(date) =>
<div>
<p className="text-sm text-gray-500">
{t("users.users.userOptionModal.account.title")}
</p>
<div className="form-control grid grid-cols-1 md:grid-cols-3 gap-10 relative">
<div>
<header className="text-sm">
{t("users.users.userOptionModal.account.userAccountLabel")}
</header>
<select
value={user?.isActive ? "Active" : "Disabled"}
onChange={(e) => {
updateUser(
{
id: user?.id,
params: { expiresAt: date },
params: { isActive: e.target.value === "Active" ? true : false },
},
{
onSuccess: () => {
toast.success("User updated successfully");
},
},
)
}
calendarContainer={DateContainer}
customInput={<DateButton />}
/>
{user.expiresAt ? (
<button
className="btn btn-sm"
onClick={() =>
);
}}
className="select select-sm select-bordered select-ghost max-w-xs"
>
<option value="Active">Active</option>
<option value="Disabled">Disabled</option>
</select>
</div>
<div className="col-span-2">
<p className="text-sm">
{t("users.users.userOptionModal.account.userExpireLabel")}
</p>
<div className="flex gap-5">
<DatePicker
className="bg-gray-500"
selected={user.expiresAt}
popperPlacement="bottom-start"
// popperClassName="absolute"
onChange={(date) =>
updateUser(
{
id: user?.id,
params: { expiresAt: null },
params: { expiresAt: date },
},
{
onSuccess: () => {
Expand All @@ -130,10 +117,30 @@ const UserIsActive = ({ user }: Iuser) => {
},
)
}
>
Reset
</button>
) : null}
calendarContainer={DateContainer}
customInput={<DateButton />}
/>
{user.expiresAt ? (
<button
className="btn btn-sm"
onClick={() =>
updateUser(
{
id: user?.id,
params: { expiresAt: null },
},
{
onSuccess: () => {
toast.success("User updated successfully");
},
},
)
}
>
Reset
</button>
) : null}
</div>
</div>
</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,11 @@
"userOptionModal": {
"userGroupLabel": "User Group",
"userRoleLabel": "User Role",
"userAccountLabel": "Account Status",
"userExpireLabel": "Account Expiration",
"account": {
"title": "ZTNet performs a daily check for expired users. If a user is found to be expired, all associated peers will be de-authorized, and the user's account will be deactivated.",
"userAccountLabel": "Account Status",
"userExpireLabel": "Account Expiration"
},
"userActionsLabel": "User Actions",
"typeUserName": "Type the name of the user.",
"buttons": {
Expand Down
7 changes: 5 additions & 2 deletions src/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,11 @@
"userOptionModal": {
"userGroupLabel": "Grupo de usuarios",
"userRoleLabel": "Rol de usuario",
"userAccountLabel": "Cuenta de usuario",
"userExpireLabel": "Expirar usuario",
"account": {
"title": "ZTNet realiza una revisión diaria para encontrar usuarios expirados. Si se encuentra que un usuario ha expirado, todos los pares asociados serán desautorizados y la cuenta del usuario se desactivará.",
"userAccountLabel": "Estado de la Cuenta",
"userExpireLabel": "Expiración de la Cuenta"
},
"userActionsLabel": "Acciones del usuario",
"typeUserName": "Escribe el nombre del usuario.",
"buttons": {
Expand Down
7 changes: 5 additions & 2 deletions src/locales/no/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,11 @@
"userOptionModal": {
"userGroupLabel": "Brukergruppe",
"userRoleLabel": "Brukerrolle",
"userAccountLabel": "Brukerkonto",
"userExpireLabel": "Utløpsdato",
"account": {
"title": "ZTNet utfører en daglig sjekk for utløpte brukere. Hvis en bruker blir funnet å ha utløpt, vil alle tilknyttede noder bli deautorisert, og brukerens konto vil bli deaktivert.",
"userAccountLabel": "Kontostatus",
"userExpireLabel": "Konto Utløp"
},
"userActionsLabel": "Brukerhandlinger",
"typeUserName": "Skriv inn brukerens navn.",
"buttons": {
Expand Down
7 changes: 5 additions & 2 deletions src/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,11 @@
"userOptionModal": {
"userGroupLabel": "用户组",
"userRoleLabel": "用户角色",
"userAccountLabel": "用户帐户",
"userExpireLabel": "用户过期",
"account": {
"title": "ZTNet 每天进行一次检查,查找是否有用户已过期。如果发现用户已过期,所有相关的节点将被取消授权,用户帐户将被停用。",
"userAccountLabel": "账户状态",
"userExpireLabel": "账户到期"
},
"userActionsLabel": "用户操作",
"typeUserName": "输入用户的名称。",
"buttons": {
Expand Down

0 comments on commit dc5ba24

Please sign in to comment.