diff --git a/.gitignore b/.gitignore index 13017826..6ff1595a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ node_modules/ venv # api/prycey.db api/__pycache__ -# api/.env \ No newline at end of file +api/.env \ No newline at end of file diff --git a/api/main.py b/api/main.py index a5b01988..a9fa8c6f 100644 --- a/api/main.py +++ b/api/main.py @@ -470,6 +470,7 @@ def rate(uid): print(request.form.get('review')) nr = int(request.form.get('rating')) review = request.form.get('review') + print(uid) if "user_id" in sess: if 1 <= nr <= 5: diff --git a/api/prycey.db b/api/prycey.db index 6258cfec..60514642 100644 Binary files a/api/prycey.db and b/api/prycey.db differ diff --git a/src/components/PostOrder/PostOrder.jsx b/src/components/PostOrder/PostOrder.jsx index 73606b38..2caf32cf 100644 --- a/src/components/PostOrder/PostOrder.jsx +++ b/src/components/PostOrder/PostOrder.jsx @@ -13,24 +13,26 @@ import StarRating from '../StarRating/StarRating'; function PostOrder(props) { const {register, handleSubmit} = useForm(); const [rating, setRating] = useState(null); + const params = new URLSearchParams(props.location.search); + const id = params.get('id'); + const seller = params.get('seller') console.log(props) useEffect(() => { - const params = new URLSearchParams(props.location.search); - const id = params.get('id'); - const seller = params.get('seller') + + console.log(seller) }, []) const onSubmit = (value) =>{ - console.log(value, rating) + console.log(value) let fd = new FormData(); fd.append('review', value.review); fd.append('rating', rating); - axios.post(`http://127.0.0.1:5000/rating/${props.match.params.value}`, fd) - .then(response => toast(response.data.response, {position: toast.POSITION.TOP_CENTER})) - .catch(error => console.log(error)) + // axios.post(`http://127.0.0.1:5000/rating/${props.match.params}`, fd) + // .then(response => toast(response.data.response, {position: toast.POSITION.TOP_CENTER})) + // .catch(error => console.log(error)) } return (
diff --git a/src/components/productPage/ProductPage.jsx b/src/components/productPage/ProductPage.jsx index b7d1ce63..c30d8958 100644 --- a/src/components/productPage/ProductPage.jsx +++ b/src/components/productPage/ProductPage.jsx @@ -58,9 +58,22 @@ function ProductPage({match}) {

{values.description}

-

{values.category}

-

years : {values.year}

-

{values.dateAdded}

+
+
+

{values.category}

+
+
+
+ Used +
+

{values.year} yrs

+
+
+ +
+

Posted on :

+

{values.dateAdded}

+

@@ -161,8 +174,11 @@ function ProductPage({match}) {

E-mail : {values.email}

Contact : +91 {values.contact}

- - buy + +
+ call +

Purchase

+
diff --git a/src/components/productPage/styles.module.scss b/src/components/productPage/styles.module.scss index acbf7bf6..ed675f97 100644 --- a/src/components/productPage/styles.module.scss +++ b/src/components/productPage/styles.module.scss @@ -16,14 +16,68 @@ font-size: 3rem; } .productDescription{ + margin-top: 10px; font-weight: 500; font-size: 1.5rem; width: 80%; letter-spacing: 2px; } - .category{ - font-size: 1.4rem; - font-weight: 400; + + .rowValue{ + display: flex; + margin-top: 10px; + + .catDiv{ + margin-top: 5px; + background-color: $purple; + width: 100px; + text-align: center; + border-radius: 10px; + + + .category{ + padding: 5px 0; + font-size: 1.2rem; + font-weight: 400; + color: white; + + } + } + .yearDiv{ + + margin-left: 10px; + margin-top: 5px; + border: 3px solid $purple; + border-radius: 10px; + width: 100px; + display: flex; + flex-direction: row; + color: black; + + .yearDiv1{ + color: white; + background-color: $purple; + padding: 5px 7px; + } + + .year{ + + padding: 5px 5px; + } + } + } + .postedRow{ + margin-top: 10px; + display: flex; + .dateHeading{ + font-size: 1.2rem; + } + .dateAdded{ + font-size: 1.1rem; + color: #a3a1a1; + padding-top: 2px; + padding-left: 5px; + } } .priceRow{ display: flex; @@ -55,7 +109,7 @@ margin-bottom: 100px; .sellerTag{ - color: $accent_blue; + color: white; align-self: start; }