From 90528fe75103200093e4d2d38d4103e11f0378d9 Mon Sep 17 00:00:00 2001 From: Kerry Gougeon Ducharme Date: Thu, 22 Mar 2018 19:56:17 -0400 Subject: [PATCH 1/2] Fix color and picture --- .../src/components/body/Questions/Question.js | 9 +- .../Questions/QuestionPage/QuestionPage.js | 84 +++++++++++-------- static/src/components/body/Register.js | 16 +--- static/src/styles.css | 31 +++---- static/src/styles.scss | 13 ++- 5 files changed, 79 insertions(+), 74 deletions(-) diff --git a/static/src/components/body/Questions/Question.js b/static/src/components/body/Questions/Question.js index 4223229..4662fd5 100644 --- a/static/src/components/body/Questions/Question.js +++ b/static/src/components/body/Questions/Question.js @@ -20,12 +20,11 @@ class Question extends Component { - {console.log(this.props.question)}

{this.props.question.engineer} diff --git a/static/src/components/body/Questions/QuestionPage/QuestionPage.js b/static/src/components/body/Questions/QuestionPage/QuestionPage.js index e44ce44..5031dac 100644 --- a/static/src/components/body/Questions/QuestionPage/QuestionPage.js +++ b/static/src/components/body/Questions/QuestionPage/QuestionPage.js @@ -55,6 +55,7 @@ class QuestionPage extends Component { try { fetchAPI("GET", "/api/users/" + this.state.user_id).then(response => { if (response.success) { + console.log(response.user) this.setState({ fname: response.user.fname, lname: response.user.lname, @@ -67,8 +68,11 @@ class QuestionPage extends Component { } render() { + let tags = ["stuff", "try","Ok","Node.js"]; let avatarPath = `\\images\\avatar\\`+this.state.display_image; if (!this.state.loading) { + let userLogin = !((Object.keys(this.props.user).length === 0 && this.props.user.constructor === Object)) //if no user is login + let askQuestion; let answers = this.state.question.answers.map((answer) => { return (
@@ -78,9 +82,13 @@ class QuestionPage extends Component { />
)}); - - let userLogin = !((Object.keys(this.props.user).length === 0 && this.props.user.constructor === Object)) //if no user is login - let askQuestion; + let tagsInfo = tags.map((tag)=>{ + return ( + + {tag} + + ) + }) if(userLogin){ askQuestion = @@ -92,41 +100,43 @@ class QuestionPage extends Component { - } else { - askQuestion = null; - } - return ( -
- - - - {this.state.question.engineer} - {this.state.fname} {this.state.lname} -  - {moment(this.state.question.register_date).format("LLL")} - - - - - - - -

{this.state.question.title}

-

{this.state.question.text}

- -
- {askQuestion} -
- {answers} -
-
+ } else { askQuestion = null; } + + return ( +
+ + + + {this.state.question.engineer} + {this.state.fname} {this.state.lname} +  - {moment(this.state.question.register_date).format("LLL")} + + {tagsInfo} + + + + + + + + +

{this.state.question.title}

+

{this.state.question.text}

+ +
+ {askQuestion} +
+ {answers}
- ) - } else { +
+
+ ) + } else { return

Loading...

} } diff --git a/static/src/components/body/Register.js b/static/src/components/body/Register.js index 831c023..7f4eb28 100644 --- a/static/src/components/body/Register.js +++ b/static/src/components/body/Register.js @@ -12,7 +12,7 @@ class Register extends Component { email: '', pw: '', role: '', - display_image: '', + display_image: '1', //validators validEmail: null, @@ -286,8 +286,6 @@ class Register extends Component { } }} /> - - Next - + nextButton = } else if (this.state.page === 2) { saveButton = null @@ -332,24 +330,18 @@ class Register extends Component { return ( - - {alert} {body} - - - {previousButton} {nextButton} {saveButton} - ); diff --git a/static/src/styles.css b/static/src/styles.css index 2880787..ac7ae10 100644 --- a/static/src/styles.css +++ b/static/src/styles.css @@ -1,5 +1,5 @@ @import url("https://fonts.googleapis.com/css?family=Mukta+Mahee"); -/* xsmall: (max-width: 479px), +/* xsmall: (max-width: 479px), small: (max-width: 599px), medium: (max-width: 767px), large: (max-width: 1024px), @@ -54,7 +54,7 @@ h1 { /* END HEADER */ .jumbotron { - background-color: #95a5a6; } + background-color: #ecf0f1; } /* FOOTER */ .footer { @@ -369,6 +369,16 @@ textarea { .question-box-text { margin: auto auto 2rem auto; } +.question-tags { + margin: 0.4em; + background-color: #ecf0f1; + padding: 0 0.8em 0 0.8em; + border: 1px solid #E27A3F; + border-radius: 100px; } + +.question-tags-answer { + margin-left: 10px; } + .answer-page h1 { font-size: 3rem; margin: 10px; } @@ -412,23 +422,6 @@ textarea { /*=============================== START SEARCH =================================*/ -.search { - position: relative; - float: right; - width: 20rem; - transition: all 10s; } - .search:focus { - outline: none; } - -#searchButton { - float: right; - width: 30px; - height: 30px; - border-radius: 50%; - margin-right: 10px; - padding-left: 5px; - text-align: left; } - /*========================================== END SEARCH ============================================*/ diff --git a/static/src/styles.scss b/static/src/styles.scss index 8d6bd47..0bf5074 100644 --- a/static/src/styles.scss +++ b/static/src/styles.scss @@ -72,7 +72,7 @@ h1{ } /* END HEADER */ .jumbotron{ - background-color: $gray; + background-color: $offwhite; } /* FOOTER */ .footer{ @@ -392,6 +392,17 @@ textarea{ .question-box-text{ margin: auto auto 2rem auto; } +.question-tags{ + margin:0.4em; + background-color:$offwhite; + padding: 0 0.8em 0 0.8em; + border: 1px solid $main; + border-radius: 100px; + +} +.question-tags-answer{ + margin-left:10px; +} .answer-page h1{ font-size: 3rem; margin:10px; From 148d728e51cca0f62b150cc3eaf9d92a1d7aabf8 Mon Sep 17 00:00:00 2001 From: Kerry Gougeon Ducharme Date: Thu, 22 Mar 2018 20:07:15 -0400 Subject: [PATCH 2/2] Merge branch 'feature/question-tags#46' into develop --- .../src/components/body/Questions/QuestionPage/QuestionPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/src/components/body/Questions/QuestionPage/QuestionPage.js b/static/src/components/body/Questions/QuestionPage/QuestionPage.js index 5031dac..3cc826b 100644 --- a/static/src/components/body/Questions/QuestionPage/QuestionPage.js +++ b/static/src/components/body/Questions/QuestionPage/QuestionPage.js @@ -68,7 +68,7 @@ class QuestionPage extends Component { } render() { - let tags = ["stuff", "try","Ok","Node.js"]; + let tags=[]; let avatarPath = `\\images\\avatar\\`+this.state.display_image; if (!this.state.loading) { let userLogin = !((Object.keys(this.props.user).length === 0 && this.props.user.constructor === Object)) //if no user is login