fix
This commit is contained in:
parent
dfa0992425
commit
d4771254c4
|
|
@ -3,6 +3,7 @@
|
|||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^5.4.0",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@mui/icons-material": "^5.14.19",
|
||||
"@react-google-maps/api": "^2.19.2",
|
||||
|
|
@ -31,6 +32,7 @@
|
|||
"i18next": "^23.6.0",
|
||||
"i18next-browser-languagedetector": "^7.1.0",
|
||||
"json-server": "^0.17.4",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^18.2.0",
|
||||
"react-apexcharts": "^1.4.1",
|
||||
"react-bootstrap": "^2.9.1",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import React, { FC, useState } from "react";
|
||||
import { ErrorMessage, useField, Field } from "formik";
|
||||
import { FormGroup } from "reactstrap";
|
||||
import PropTypes from "prop-types";
|
||||
import { Eye, EyeOff } from "react-feather";
|
||||
import "./index.css";
|
||||
|
||||
|
|
@ -50,8 +49,5 @@ const PasswordField: FC<PasswordFieldProps> = ({ name, label, ...props }) => {
|
|||
);
|
||||
};
|
||||
|
||||
PasswordField.propTypes = {
|
||||
name: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export { PasswordField };
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
import React, { FC } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import { HtmlEditor } from "./HtmlEditor";
|
||||
import { useFormikContext } from "formik";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
interface SingleLangEditorProps {
|
||||
langCode: number;
|
||||
property: string;
|
||||
}
|
||||
|
||||
const PROPERTY_TYPES: string[] = [
|
||||
"privacy_description",
|
||||
"conditions_description",
|
||||
"about_us_description",
|
||||
"product_description",
|
||||
"auction_description"
|
||||
];
|
||||
|
||||
const SingleLangEditor: FC<SingleLangEditorProps> = ({ langCode, property }) => {
|
||||
const formik:any = useFormikContext();
|
||||
const {t} = useTranslation();
|
||||
|
||||
const label = `${t(property)} (${t(`lang_${langCode}`)})`;
|
||||
const fieldName = `translated_fields[${langCode}][${property}]`;
|
||||
return (
|
||||
<>
|
||||
<h5 className="Information_title">{label}</h5>
|
||||
<HtmlEditor
|
||||
langCode={langCode}
|
||||
name={fieldName}
|
||||
editorState={formik.values.translated_fields[langCode][property]}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
SingleLangEditor.propTypes = {
|
||||
langCode: PropTypes.oneOf([1, 2]).isRequired,
|
||||
property: PropTypes.oneOf(PROPERTY_TYPES).isRequired,
|
||||
};
|
||||
|
||||
export default SingleLangEditor;
|
||||
Loading…
Reference in New Issue
Block a user