This commit is contained in:
omkieit 2024-10-14 12:14:54 +05:30
parent c6bea888ad
commit c243bc83de
4 changed files with 71 additions and 64 deletions

File diff suppressed because one or more lines are too long

View File

@ -45,7 +45,7 @@
<script type="module" crossorigin src="/assets/index-CJacNAWv.js"></script>
<script type="module" crossorigin src="/assets/index-7mv97drX.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-iEl-il0E.css">
</head>

View File

@ -28,7 +28,7 @@ const Addproperty = () => {
propertyTaxInfo: [
{ propertytaxowned: "0", ownedyear: "0", taxassessed: "0", taxyear: "0" },
],
images: [{ title: "", file: "" }], // Array to hold image objects
images: [{ title: "", file: "" }],
googleMapLink: "", // Field for Google Maps link
renovationRisk: null,
purchaseCost: "0",
@ -129,6 +129,7 @@ const Addproperty = () => {
const [submitted, setSubmitted] = useState(false);
const handleImageChange = (file, index) => {
console.log("File received:", file); // Debugging log to check the file object
const updatedImages = [...formData.images];
updatedImages[index].file = file.base64; // store base64 format of image
setFormData({ ...formData, images: updatedImages });
@ -1805,21 +1806,27 @@ const Addproperty = () => {
className="btn btn-danger"
onClick={() => handleDeleteImage(index)}
style={{
marginLeft: "5px", // Adjust this to minimize space between the buttons
marginLeft: "5px",
}}
>
Delete
</button>
</div>
{/* Check if image.file contains valid base64 data */}
{image.file && (
<>
<p>Base64 Data:</p> {/* Debugging base64 data */}
<pre>{image.file.slice(0, 100)}...</pre> {/* Display first 100 characters for debugging */}
<div className="col-md-12">
<img
src={image.file}
alt="uploaded"
style={{ width: "150px", height: "150px" }}
style={{ width: "150px", height: "150px", objectFit: "cover" }}
/>
</div>
</>
)}
</div>
))}

View File

@ -34,7 +34,7 @@ const UserProperties = () => {
<div className="row p-2 bg-white border rounded mt-2">
<div className="col-md-3 mt-1">
<img
src={propertydummy}
src={property.images[0].file || propertydummy}
className="w-70"
alt="Img"
style={{