refactor phase 3a components chunk 1 targeted actions imports

This commit is contained in:
2026-03-12 12:13:29 +00:00
parent be59237ec9
commit a0a633a9ea
14 changed files with 208 additions and 186 deletions
+12 -12
View File
@@ -4,7 +4,7 @@ import { useMemo, useState } from "react";
import Dropzone from "react-dropzone";
import { connect } from "react-redux";
import { Field, reduxForm } from "redux-form";
import { uploadFiles } from "../../actions";
import { uploadFiles } from "../../actions/services/documentService";
import { bytesToSize } from "../utils";
const required = (errorMsg) => (value) =>
@@ -79,25 +79,25 @@ const baseStyle = {
color: "#bdbdbd",
transition: "border .3s ease-in-out",
width: "80%",
margin: "20px auto 30px",
margin: "20px auto 30px"
};
const activeStyle = {
borderColor: "#2196f3",
borderColor: "#2196f3"
};
const acceptStyle = {
borderColor: "#00e676",
borderColor: "#00e676"
};
const rejectStyle = {
borderColor: "#ff1744",
borderColor: "#ff1744"
};
const RenderFileUpload = (field) => {
const files = field.input.value;
const style = useMemo(
() => ({
...baseStyle,
...baseStyle
// ...(isDragActive ? activeStyle : {}),
// ...(isDragAccept ? acceptStyle : {}),
// ...(isDragReject ? rejectStyle : {}),
@@ -220,7 +220,7 @@ const RenderFileUpload = (field) => {
field.documentTypeCode
)}_${file.name}`,
{
type: file.type,
type: file.type
}
)
);
@@ -323,7 +323,7 @@ let UploadFile = (props) => {
t(
"myportal:searchcases-validation-minlength"
)
),
)
]}
className="govuk-input"
component={RenderTextfield}
@@ -428,11 +428,11 @@ const mapStateToProps = (state) => {
"pinswg_developmentdescription": "something to go here",
"pinswg_agriculturalholding": 846040000,
"_pinswg_planningappeals78ids_value":
"50b533aa-43f1-ec11-aade-00224800be9c",
"50b533aa-43f1-ec11-aade-00224800be9c"
},
initialValues: {
caseReference: "CAS-00764-L0Q9W2",
},
caseReference: "CAS-00764-L0Q9W2"
}
};
};
@@ -447,6 +447,6 @@ export default connect(
reduxForm({
form: "uploadFileForm",
destroyOnUnmount: false,
enableReinitialize: true, // this is needed!!
enableReinitialize: true // this is needed!!
})(UploadFile)
);