Compare commits
2 Commits
dfa0992425
...
20378c7d0c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20378c7d0c | ||
|
|
d4771254c4 |
|
|
@ -3,6 +3,7 @@
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@ant-design/icons": "^5.4.0",
|
||||||
"@emotion/styled": "^11.11.0",
|
"@emotion/styled": "^11.11.0",
|
||||||
"@mui/icons-material": "^5.14.19",
|
"@mui/icons-material": "^5.14.19",
|
||||||
"@react-google-maps/api": "^2.19.2",
|
"@react-google-maps/api": "^2.19.2",
|
||||||
|
|
@ -31,6 +32,7 @@
|
||||||
"i18next": "^23.6.0",
|
"i18next": "^23.6.0",
|
||||||
"i18next-browser-languagedetector": "^7.1.0",
|
"i18next-browser-languagedetector": "^7.1.0",
|
||||||
"json-server": "^0.17.4",
|
"json-server": "^0.17.4",
|
||||||
|
"prop-types": "^15.8.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-apexcharts": "^1.4.1",
|
"react-apexcharts": "^1.4.1",
|
||||||
"react-bootstrap": "^2.9.1",
|
"react-bootstrap": "^2.9.1",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import React, { FC, useState } from "react";
|
import React, { FC, useState } from "react";
|
||||||
import { ErrorMessage, useField, Field } from "formik";
|
import { ErrorMessage, useField, Field } from "formik";
|
||||||
import { FormGroup } from "reactstrap";
|
import { FormGroup } from "reactstrap";
|
||||||
import PropTypes from "prop-types";
|
|
||||||
import { Eye, EyeOff } from "react-feather";
|
import { Eye, EyeOff } from "react-feather";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
|
|
@ -50,8 +49,5 @@ const PasswordField: FC<PasswordFieldProps> = ({ name, label, ...props }) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
PasswordField.propTypes = {
|
|
||||||
name: PropTypes.string.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
export { PasswordField };
|
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;
|
|
||||||
|
|
@ -28,7 +28,7 @@ function FormStaticInfo({ isDisable = false }: { isDisable?: boolean }) {
|
||||||
|
|
||||||
</Col>
|
</Col>
|
||||||
<Col>
|
<Col>
|
||||||
<ValidationField name="value_type" option={valueTypeOptions || []} type="Select" label='value_type' placeholder='placeholder' />
|
{/* <ValidationField name="value_type" option={valueTypeOptions || []} type="Select" label='value_type' placeholder='placeholder' /> */}
|
||||||
|
|
||||||
<ValidationField name="value" type={formik?.values?.value_type == 'image' ? 'File' : 'text'} label='value' placeholder='placeholder' />
|
<ValidationField name="value" type={formik?.values?.value_type == 'image' ? 'File' : 'text'} label='value' placeholder='placeholder' />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ function StaticInfoPage() {
|
||||||
return (
|
return (
|
||||||
// Pass Status to Layout
|
// Pass Status to Layout
|
||||||
<DashBody status={status as QueryStatusEnum} >
|
<DashBody status={status as QueryStatusEnum} >
|
||||||
<DashHeader title={'StaticInfo'}></DashHeader>
|
<DashHeader showAddButton={false} title={'StaticInfo'}></DashHeader>
|
||||||
|
|
||||||
<LyTable
|
<LyTable
|
||||||
data={data}
|
data={data}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ const useTableColumns: any = () => {
|
||||||
onView={() => {}}
|
onView={() => {}}
|
||||||
objectToEdit={row}
|
objectToEdit={row}
|
||||||
showEdit={true}
|
showEdit={true}
|
||||||
|
showDelete={false}
|
||||||
showView={false}
|
showView={false}
|
||||||
onDelete={() => deleteMutation.mutate({ id: row.id })}
|
onDelete={() => deleteMutation.mutate({ id: row.id })}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user