diff --git a/.eslintrc.js b/.eslintrc.js index ee02035f..ad3b53ed 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,4 +7,7 @@ module.exports = { "plugin:@typescript-eslint/recommended", "plugin:jsx-a11y/recommended", ], + rules: { + "@typescript-eslint/ban-ts-comment": "warn", + }, }; diff --git a/src/components/organisms/MyProfileForm/MyProfileForm.tsx b/src/components/organisms/MyProfileForm/MyProfileForm.tsx index 9594bfad..7366299e 100644 --- a/src/components/organisms/MyProfileForm/MyProfileForm.tsx +++ b/src/components/organisms/MyProfileForm/MyProfileForm.tsx @@ -11,6 +11,7 @@ import styled, { withTheme } from "styled-components"; import { Input, Button, Text, Checkbox, TextArea } from "../../../"; import { ExtendableStyledComponent } from "types/component"; +import useAdditionalFieldTranslations from "../../../hooks/useAdditionalFieldsTranslations"; const StyledFormHeader = styled.div<{ mobile: boolean }>` h2, @@ -106,6 +107,8 @@ export const MyProfileForm: React.FC = ({ phone: "", }); const { t } = useTranslation(); + const { getFieldTranslations, filterByKey } = + useAdditionalFieldTranslations(); const { updateProfile, fields, @@ -296,57 +299,73 @@ export const MyProfileForm: React.FC = ({ error={touched.phone && errors.phone} /> - {fields && - Array.isArray(fields.list) && - fields.list - .filter( - (field: API.Metadata) => - field.type === "varchar" || field.type === "text" - ) - .map((field: API.Metadata, index: number) => - field.type === "varchar" ? ( - - ) : ( -