From 6c3f70dc31410498b2fec58191110f545137948b Mon Sep 17 00:00:00 2001 From: samaamro20 Date: Tue, 16 Apr 2019 16:05:23 +0300 Subject: [PATCH 1/7] version 2 of brand detials --- client/src/components/Brand/brand.css | 8 +- client/src/components/Brand/index.js | 32 +-- client/src/components/Feedback/feedback.css | 210 -------------------- client/src/components/Feedback/index.js | 159 --------------- 4 files changed, 25 insertions(+), 384 deletions(-) delete mode 100644 client/src/components/Feedback/feedback.css delete mode 100644 client/src/components/Feedback/index.js diff --git a/client/src/components/Brand/brand.css b/client/src/components/Brand/brand.css index e1f6fb3..535d47c 100644 --- a/client/src/components/Brand/brand.css +++ b/client/src/components/Brand/brand.css @@ -42,6 +42,7 @@ display: flex; flex-direction: row; text-align: left !important; + margin-bottom: 3%; } .score1 { width: 170px; @@ -112,7 +113,7 @@ margin-bottom: 70px; } .MoreDetails { - margin-left: 17px; + margin-left: 25%; max-width: 100%; padding-top: 6%; text-align: left !important; @@ -277,9 +278,13 @@ } .They-areas-they-are { display: initial; + text-align: center !important; + margin-left: 10% !important; } .pargrah-brand { margin-top: 10px; + width: 60%; + } .animal { padding-left: 700px; @@ -457,6 +462,7 @@ } .details-feedback-container { + width: 100%; display: flex; flex-direction: row; float: left; diff --git a/client/src/components/Brand/index.js b/client/src/components/Brand/index.js index ae0e0f6..68d00be 100644 --- a/client/src/components/Brand/index.js +++ b/client/src/components/Brand/index.js @@ -2,7 +2,6 @@ import React from "react"; import back from "./left.png"; import "./brand.css"; import axios from "axios"; -import Feedback from "../Feedback"; import { FadeLoader } from "react-spinners"; import { Link } from "react-router-dom"; import defaultimage from "./x.jpg"; @@ -150,12 +149,13 @@ class Brand extends React.Component {

{environmentscore}

Environment Rating

+
+

+ {ReasonForEnvironmentScore} +

+
-
-

- {ReasonForEnvironmentScore} -

-
+
{labourscore}{" "}

Labour Rating

+
+

{ReasonForLabourScore}

+ +
+
-

{ReasonForLabourScore}

{labourscore}

-

TransparencyRating

+

Transparency Rating

+
+

+ {ReasonForTransparencyScore} +

+
-

- {ReasonForTransparencyScore} -

+
@@ -192,9 +199,6 @@ class Brand extends React.Component {
-
- -
diff --git a/client/src/components/Feedback/feedback.css b/client/src/components/Feedback/feedback.css deleted file mode 100644 index 92a477b..0000000 --- a/client/src/components/Feedback/feedback.css +++ /dev/null @@ -1,210 +0,0 @@ -.mainf { - border: solid gray 1px; - margin-left: 14px; - margin-top: 47px; - height: 488px; - width: 88%; -} - -.result img { - width: 100px; - height: 100px; -} -.header { - display: inline-flex; - margin-top: 2%; - float: left; -} - -.btn-metodo { - height: 40px; - background-color: black; - color: white; - margin-bottom: 20px; - - display: flex; - - justify-content: center; - - align-items: center; - - width: 498px; - - margin-left: 32px; -} - -.header img { - width: 50px; - height: 50px; - float: left; -} - -.feedbackcard { - display: inline-flex; -} - -.feedbackcard img { - width: 60px; - height: 60px; - margin-top: 17px; -} - -.nameuser { - margin-left: 40px; - padding-top: 0px !important; - margin-right: 10%; -} - -.votes img { - width: 25px; - height: 25px; - margin-right: 30px; -} - -.votes p { - margin-right: 30px; -} - -.votes { - display: inline-flex; - margin-left: 15%; -} -.line { - border-left: 1px solid #000; - height: 415px; -} - -.line2 { - border-bottom: 1px solid #000; - width: 500px; - margin-bottom: 10px; - margin-left: 15px; -} - -.votes p { - border: 1px solid #000; - border-radius: 50%; - text-align: center; -} - -.mainorg { - display: inline-flex; - - padding-left: 30px; -} - -.allcards { - display: inline-block; -} -.cards { - padding-left: 5%; - text-align: left !important; -} -.carduser { - text-align: left !important; -} - -.like button { - background-color: Transparent; - border: none; -} -.dislike button { - background-color: Transparent; - border: none; -} - -.sweet-loading { - display: flex; - justify-content: center; - align-items: center; - color: #1389a6; -} - -@media only screen and (max-width: 600px) { - .header { - display: flex; - } - .header h3 { - font-size: 10pt; - margin-right: 46%; - } - .header img { - width: 50px; - height: 50px; - float: left; - } - - .feedbackcard { - display: flex; - margin-right: 40%; - width: 30%; - } - - .feedbackcard img { - width: 60px; - height: 60px; - margin-top: 12px; - } - .feedbackcard h4 { - font-size: 8pt; - } - .feedbackcard h5 { - font-size: 6pt; - } - - .nameuser { - margin-left: 6px; - padding-top: 0px !important; - margin-right: 10%; - } - - .votes img { - width: 17px; - height: 20px; - margin-right: 30px; - } - - .votes p { - margin-right: 30px; - } - - .votes { - display: inline-flex; - } - .line { - border-left: 1px solid #000; - height: 359px; - } - - .line2 { - border-bottom: 1px solid #000; - width: 500px; - margin-bottom: 10px; - margin-left: 15px; - } - - .votes p { - border: 1px solid #000; - border-radius: 50%; - text-align: center; - } - - .mainorg { - display: inline-flex; - width: 60%; - } - - .allcards { - display: inline-block; - } - .cards { - padding-left: 2%; - } - - .sweet-loading { - display: flex; - justify-content: center; - align-items: center; - color: #1389a6; - } -} diff --git a/client/src/components/Feedback/index.js b/client/src/components/Feedback/index.js deleted file mode 100644 index bb1267a..0000000 --- a/client/src/components/Feedback/index.js +++ /dev/null @@ -1,159 +0,0 @@ -import React, { Component } from "react"; -import "./feedback.css"; -import lamba from "./assets/lamba.png"; -import user from "./assets/user.png"; -import like from "./assets/like.png"; -import dislike from "./assets/dislike.png"; -import AddFeedback from "./add.js"; -import axios from "axios"; -import { FadeLoader } from "react-spinners"; - -export default class Feedback extends Component { - state = { - info: [], - loading: false, - ids: [], - NoData: "" - }; - componentDidMount() { - const { name } = this.props; - axios - .get(`/api/getfeedback/${name}`) - .then(({ data }) => { - if (data.length === 3) { - this.state.ids.push( - Object.keys(data[0])[0], - Object.keys(data[1])[0], - Object.keys(data[2])[0] - ); - this.state.info.push( - Object.values(data[0]), - Object.values(data[1]), - Object.values(data[2]) - ); - this.setState({ - loading: true - }); - } else if (data.length === 2) { - this.state.ids.push(Object.keys(data[0])[0], Object.keys(data[1])[0]); - this.state.info.push(Object.values(data[0]), Object.values(data[1])); - this.setState({ - loading: true - }); - } else if (data.length === 1) { - this.state.ids.push(Object.keys(data[0])[0]); - this.state.info.push(Object.values(data[0])); - this.setState({ - loading: true - }); - } else { - this.setState({ - NoData: "No Feedback For this Brand" - }); - } - }) - .catch(err => { - console.log(err); - }); - } - - like = (id, like) => { - const idfeedback = this.state.ids[id]; - axios - .get(`/api/like/${idfeedback}/${like}`) - .then(({ data: { success } }) => { - if (success) { - window.location.reload(); - } else { - console.log("error"); - } - }) - .catch(err => { - console.log(err); - }); - }; - - dislike = (id, dislike) => { - const idfeedback = this.state.ids[id]; - axios - .get(`/api/dislike/${idfeedback}/${dislike}`) - .then(({ data: { success } }) => { - if (success) { - window.location.reload(); - } else { - console.log("error"); - } - }) - .catch(err => { - console.log(err); - }); - }; - - render() { - return ( -
-
-
-
- lamba -

What does the community think about {this.props.name}

-
-
-
-

Feedback

-

{this.state.NoData}

- {this.state.info.length !== 0 ? ( - this.state.info.map((i, id) => { - return ( -
-
-
- user -
-

Name

-
{i[0].Name}
-
-
-

Feedback

-
{i[0].feedback}
-
-
-
- -
-
- -
-
-
-
-
- ); - }) - ) : ( -
- -
- )} -
-
-
-
submit your feedback below
-
-
- ); - } -} From e5a3f95bc7967dbe0deafe878065f84973a962e7 Mon Sep 17 00:00:00 2001 From: samaamro20 Date: Wed, 17 Apr 2019 09:18:33 +0300 Subject: [PATCH 2/7] update style versin 2 --- client/src/components/Brand/brand.css | 7 +++++-- client/src/components/Brand/index.js | 4 +--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/src/components/Brand/brand.css b/client/src/components/Brand/brand.css index 535d47c..6fd3cf6 100644 --- a/client/src/components/Brand/brand.css +++ b/client/src/components/Brand/brand.css @@ -113,7 +113,7 @@ margin-bottom: 70px; } .MoreDetails { - margin-left: 25%; + margin-left: 10%; max-width: 100%; padding-top: 6%; text-align: left !important; @@ -141,6 +141,7 @@ border-radius: 5px; } .btn-metodolegy-brand { + margin-left: 20%; height: 40px; background-color: black; color: white; @@ -155,7 +156,7 @@ font-size: 12pt; font-family: "Roboto", sans-serif; font-weight: bold; - padding-left: -14px; + width: 24% } .score22 h3 { text-align: center; @@ -284,6 +285,8 @@ .pargrah-brand { margin-top: 10px; width: 60%; + float: right; +text-align: center; } .animal { diff --git a/client/src/components/Brand/index.js b/client/src/components/Brand/index.js index 68d00be..2dfa3ee 100644 --- a/client/src/components/Brand/index.js +++ b/client/src/components/Brand/index.js @@ -172,7 +172,6 @@ class Brand extends React.Component { -
-

{labourscore}

+

{transparencyscore}

Transparency Rating

@@ -188,7 +187,6 @@ class Brand extends React.Component { {ReasonForTransparencyScore}

-
From 8491aaebe7e6ac2e671474a1bbf1cdccad5ec7c4 Mon Sep 17 00:00:00 2001 From: samaamro20 Date: Wed, 17 Apr 2019 09:51:30 +0300 Subject: [PATCH 3/7] fix conflict --- client/src/components/Brand/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/components/Brand/index.js b/client/src/components/Brand/index.js index bda68ab..42d437e 100644 --- a/client/src/components/Brand/index.js +++ b/client/src/components/Brand/index.js @@ -96,6 +96,12 @@ class Brand extends React.Component {

{explanation || "No-Explanation "}

+

+ Product Type : {producttype || "No-Product Type "} +

+

+ Product Cost : {cost || "No-Product cost "} +

From 247717310dd977613a531996c3975fb45f1dbb65 Mon Sep 17 00:00:00 2001 From: samaamro20 Date: Wed, 17 Apr 2019 10:13:33 +0300 Subject: [PATCH 4/7] Merge branch 'master' of github.com:FACK1/wellSpent into finalbrnach --- client/src/components/Brand/brand.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/components/Brand/brand.css b/client/src/components/Brand/brand.css index c1441bf..5f7561d 100644 --- a/client/src/components/Brand/brand.css +++ b/client/src/components/Brand/brand.css @@ -158,6 +158,10 @@ font-weight: bold; width: 24% } +.name2 h3{ + text-align: center; +} + .score22 h3 { text-align: center; } From c4037411cbd21647b021024daeaa72827f901673 Mon Sep 17 00:00:00 2001 From: samaamro20 Date: Wed, 17 Apr 2019 11:02:58 +0300 Subject: [PATCH 5/7] Done --- client/src/components/Brand/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/components/Brand/index.js b/client/src/components/Brand/index.js index c0285f5..9a6e72f 100644 --- a/client/src/components/Brand/index.js +++ b/client/src/components/Brand/index.js @@ -7,6 +7,7 @@ import { Link } from "react-router-dom"; import defaultimage from "./x.jpg"; import AddFeedback from "../Feedback/add.js"; + class Brand extends React.Component { state = { info: [], From 64f5c729749d0c2de3daaef1e5cc7df69b761c9e Mon Sep 17 00:00:00 2001 From: samaamro20 Date: Wed, 17 Apr 2019 11:03:12 +0300 Subject: [PATCH 6/7] Done --- client/src/components/Brand/brand.css | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/components/Brand/brand.css b/client/src/components/Brand/brand.css index 59d93fb..dd0e1fc 100644 --- a/client/src/components/Brand/brand.css +++ b/client/src/components/Brand/brand.css @@ -152,6 +152,7 @@ margin-right: 30px; height: 70px; border-radius: 5px; } + .btn-metodolegy-brand { margin-left: 20%; height: 40px; From fd4f97be7c2616ac4c8a28d2e33fff85be5f5db8 Mon Sep 17 00:00:00 2001 From: samaamro20 Date: Wed, 17 Apr 2019 11:03:39 +0300 Subject: [PATCH 7/7] Done --- client/src/components/Header/header.css | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/components/Header/header.css b/client/src/components/Header/header.css index 4eabdd7..9812ea7 100644 --- a/client/src/components/Header/header.css +++ b/client/src/components/Header/header.css @@ -5,6 +5,7 @@ padding-left: 5px; } + .nav h3 { text-align: center; font-family: "Alegreya Sans SC", sans-serif;