From 00b4036b65b898e0aa2779013045a2d49a9242df Mon Sep 17 00:00:00 2001 From: jin-co Date: Mon, 18 Sep 2023 08:17:08 +0900 Subject: [PATCH] Update --- React/test-housing/src/pages/EditListing.js | 275 +++++++++++++++++++- 1 file changed, 273 insertions(+), 2 deletions(-) diff --git a/React/test-housing/src/pages/EditListing.js b/React/test-housing/src/pages/EditListing.js index 7739153a3..896f95c6e 100644 --- a/React/test-housing/src/pages/EditListing.js +++ b/React/test-housing/src/pages/EditListing.js @@ -1,7 +1,278 @@ -import React from 'react' +import React, { useState } from 'react' export const EditListing = () => { + const [geolocationEnabled, setGeolocationEnabled] = useState(false) + const [formData, setFormData] = useState({ + type: 'rent', + name: '', + bedrooms: 1, + bathrooms: 1, + parking: false, + furnished: false, + address: '', + offer: false, + regularPrice: 0, + discountedPrice: 0, + images: {}, + latitude: 0, + longitude: 0, + }) + + const { + type, + name, + bedrooms, + bathrooms, + parking, + furnished, + address, + offer, + regularPrice, + discountedPrice, + images, + latitude, + longitude, + } = formData + + const onMutate = (e) => { + setFormData((prev) => ({ + ...prev, + [e.target.id]: e.target.value + })) + } + + const onSubmit = (e) => { + e.preventDefault() + } + return ( -
EditListing
+
+
+

Edit listing

+
+ +
+
+ +
+ + + +
+ + +
+
+ + +
+
+ + +
+
+ +
+ + + +
+ +
+ + + +
+ + + {!geolocationEnabled && ( +
+
+ + +
+
+ + +
+
+ )} + + +
+ + +
+ + +
+ + {type === 'rent' &&

$ / Month

} +
+ + {offer && ( + <> + + + + )} + + +

+ The first image will be the cover (max 6). +

+ + + +
+
+
) }