gitscope
← marzneshin / Diff · 54b7df5 → 54b7df5
Changes 54b7df5..54b7df5
Patch commit
diff --git a/dashboard/public/locales/en.json b/dashboard/public/locales/en.json
index 49662b4..6f1c5e2 100644
--- a/dashboard/public/locales/en.json
+++ b/dashboard/public/locales/en.json
@@ -39,7 +39,7 @@
"disable": "Disable",
"close": "Close",
"save": "Save",
- "day": "Day",
+ "days": "Days",
"page": {
"settings": {
"certificate": {
diff --git a/dashboard/public/locales/kur.json b/dashboard/public/locales/kur.json
index 9ba00ad..8b5409f 100644
--- a/dashboard/public/locales/kur.json
+++ b/dashboard/public/locales/kur.json
@@ -32,7 +32,7 @@
"disable": "Naçalakî ke",
"close": "Dayixe",
"save": "Seyv Bike",
- "day": "Roj",
+ "days": "Roj",
"page": {
"settings": {
"certificate": {
diff --git a/dashboard/src/features/users/dialogs/mutation/fields/onhold-expire-duration.tsx b/dashboard/src/features/users/dialogs/mutation/fields/onhold-expire-duration.tsx
index bae8c7f..9ca6b6a 100644
--- a/dashboard/src/features/users/dialogs/mutation/fields/onhold-expire-duration.tsx
+++ b/dashboard/src/features/users/dialogs/mutation/fields/onhold-expire-duration.tsx
@@ -27,7 +27,7 @@ export const OnHoldExpireDurationField: FC<OnHoldExpireDurationFieldProps> = ()
name="on_hold_expire_duration"
render={({ field }) => (
<FormItem>
- <FormLabel>{t('page.users.on_hold_expire_duration')} ({t('day')})</FormLabel>
+ <FormLabel>{t('page.users.on_hold_expire_duration')} ({t('days')})</FormLabel>
<FormControl>
<Input
type="number"
diff --git a/dashboard/src/features/users/dialogs/mutation/fields/username.tsx b/dashboard/src/features/users/dialogs/mutation/fields/username.tsx
index 70dc2e8..3c8912e 100644
--- a/dashboard/src/features/users/dialogs/mutation/fields/username.tsx
+++ b/dashboard/src/features/users/dialogs/mutation/fields/username.tsx
@@ -6,13 +6,13 @@ import {
FormLabel,
FormMessage
} from '@marzneshin/components';
-import { FC } from 'react'
+import { FC, InputHTMLAttributes } from 'react'
import { useFormContext } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
interface UsernameFieldProps { }
-export const UsernameField: FC<UsernameFieldProps> = () => {
+export const UsernameField: FC<UsernameFieldProps & InputHTMLAttributes<HTMLElement>> = ({ disabled }) => {
const form = useFormContext()
const { t } = useTranslation()
return (
@@ -23,7 +23,7 @@ export const UsernameField: FC<UsernameFieldProps> = () => {
<FormItem>
<FormLabel>{t('username')}</FormLabel>
<FormControl>
- <Input {...field} />
+ <Input disabled={disabled} {...field} />
</FormControl>
<FormMessage />
</FormItem>
diff --git a/dashboard/src/features/users/dialogs/mutation/index.tsx b/dashboard/src/features/users/dialogs/mutation/index.tsx
index 2141e09..0bbe1fa 100644
--- a/dashboard/src/features/users/dialogs/mutation/index.tsx
+++ b/dashboard/src/features/users/dialogs/mutation/index.tsx
@@ -71,7 +71,7 @@ export const UsersMutationDialog: FC<UsersMutationDialogProps> = ({
<form onSubmit={handleSubmit}>
<div className="flex-col grid-cols-2 gap-2 sm:flex md:grid">
<div>
- <UsernameField />
+ <UsernameField disabled={(entity && entity.username) ? true : false} />
<DataLimitFields />
<ExpirationMethodFields entity={entity} />
<NoteField />