Skip to content

Commit

Permalink
Merge pull request #117 from AkshataKatwal16/admin
Browse files Browse the repository at this point in the history
Issue 1317 feat: UI changes
  • Loading branch information
itsvick authored Aug 10, 2024
2 parents 35d6c58 + 67937e3 commit a79547a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
4 changes: 4 additions & 0 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@
"MIN_LENGTH_DIGITS_ERROR": "Minimum {{minLength}} Digits required",
"MAX_LENGTH_DIGITS_ERROR": "Maximum {{maxLength}} Digits allowed",
"MIN_LENGTH_CHARACTERS_ERROR": "Minimum {{minLength}} characters required",
"MAX_LENGTH_DIGITS_ERROR_AGE": "Age should be less than or equal to {{maxLength}}",
"MIN_LENGTH_DIGITS_ERROR_AGE": "Age should be greater than or equal to {{minLength}}",


"MAX_LENGTH_CHARACTERS_ERROR": "Maximum {{maxLength}} characters allowed",
"NUMBER_AND_SPECIAL_CHARACTERS_NOT_ALLOWED": "Numbers and special characters are not allowed",
"CHARACTERS_AND_SPECIAL_CHARACTERS_NOT_ALLOWED": "Characters and special characters are not allowed",
Expand Down
15 changes: 12 additions & 3 deletions src/components/DynamicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ const DynamicForm: React.FC<DynamicFormProps> = ({
const property = error.property.substring(1);

if (schema.properties?.[property]?.validation?.includes("numeric")) {
error.message = t("FORM_ERROR_MESSAGES.MAX_LENGTH_DIGITS_ERROR", {
maxLength: schema.properties?.[property]?.maxLength
});

if (property === 'age') {
error.message = t("FORM_ERROR_MESSAGES.MAX_LENGTH_DIGITS_ERROR_AGE", {
maxLength: schema.properties?.[property]?.maxLength
}); }
}
break;
}
Expand All @@ -136,6 +138,13 @@ const DynamicForm: React.FC<DynamicFormProps> = ({
error.message = t("FORM_ERROR_MESSAGES.MIN_LENGTH_DIGITS_ERROR", {
minLength: schema.properties?.[property]?.minLength
});

if (property === 'age') {
error.message = t("FORM_ERROR_MESSAGES.MIN_LENGTH_DIGITS_ERROR_AGE", {
minLength: schema.properties?.[property]?.minLength
});
// error.message = `Age should be greater than or equal to ${error?.params?.limit}`
}
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/layouts/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const Sidebar = ({

</ListItemIcon>
<ListItemText>
<Typography variant="h2" sx={{ fontWeight: "bold" }}>
<Typography variant="h2" sx={{ fontWeight: "700px" }}>
{t(item.title)}
</Typography>
</ListItemText>
Expand Down
4 changes: 4 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ input[type="number"]::-webkit-outer-spin-button {
display: none !important;
}

/* To show legend in black or inherited color instead of primary color */
legend.Mui-focused {
color: inherit !important;
}



0 comments on commit a79547a

Please sign in to comment.