From 307c05286e80a2f741bf243c87cbdad80a77334e Mon Sep 17 00:00:00 2001 From: Elsabeth Kidane Date: Tue, 21 Jul 2020 09:30:23 -0400 Subject: [PATCH 1/2] update --- src/components/SignIn/copyofindex.js | 269 --------------------------- src/components/SignIn/index.js | 6 +- 2 files changed, 5 insertions(+), 270 deletions(-) delete mode 100644 src/components/SignIn/copyofindex.js diff --git a/src/components/SignIn/copyofindex.js b/src/components/SignIn/copyofindex.js deleted file mode 100644 index 14dfb9ebf..000000000 --- a/src/components/SignIn/copyofindex.js +++ /dev/null @@ -1,269 +0,0 @@ -import React, { Component } from 'react'; -import { withRouter } from 'react-router-dom'; -import { compose } from 'recompose'; - -import { SignUpLink } from '../SignUp'; -import { PasswordForgetLink } from '../PasswordForget'; -import { withFirebase } from '../Firebase'; -import * as ROUTES from '../../constants/routes'; - -const SignInPage = () => ( -
-

SignIn

- - {/* - - */} - {/* */} - -
-); - -const INITIAL_STATE = { - email: '', - password: '', - error: null, -}; - -const ERROR_CODE_ACCOUNT_EXISTS = - 'auth/account-exists-with-different-credential'; - -const ERROR_MSG_ACCOUNT_EXISTS = ` - An account with an E-Mail address to - this social account already exists. Try to login from - this account instead and associate your social accounts on - your personal account page. -`; - -class SignInFormBase extends Component { - constructor(props) { - super(props); - - this.state = { ...INITIAL_STATE }; - } - - onSubmit = event => { - const { email, password } = this.state; - - this.props.firebase - .doSignInWithEmailAndPassword(email, password) - .then(() => { - this.setState({ ...INITIAL_STATE }); - this.props.history.push(ROUTES.HOME); - }) - .catch(error => { - this.setState({ error }); - }); - - event.preventDefault(); - }; - - onChange = event => { - this.setState({ [event.target.name]: event.target.value }); - }; - - render() { - const { email, password, error } = this.state; - - const isInvalid = password === '' || email === ''; - - return ( -
-
-
- - - - - {error &&

{error.message}

} -
-
-
- ); - } -} - -// class SignInGoogleBase extends Component { -// constructor(props) { -// super(props); - -// this.state = { error: null }; -// } - -// onSubmit = event => { -// this.props.firebase -// .doSignInWithGoogle() -// .then(socialAuthUser => { -// // Create a user in your Firebase Realtime Database too -// return this.props.firebase.user(socialAuthUser.user.uid).set( -// { -// username: socialAuthUser.user.displayName, -// email: socialAuthUser.user.email, -// roles: {}, -// }, -// { merge: true }, -// ); -// }) -// .then(() => { -// this.setState({ error: null }); -// this.props.history.push(ROUTES.HOME); -// }) -// .catch(error => { -// if (error.code === ERROR_CODE_ACCOUNT_EXISTS) { -// error.message = ERROR_MSG_ACCOUNT_EXISTS; -// } - -// this.setState({ error }); -// }); - -// event.preventDefault(); -// }; - -// render() { -// const { error } = this.state; - -// return ( -//
-// - -// {error &&

{error.message}

} -//
-// ); -// } -// } - -// class SignInFacebookBase extends Component { -// constructor(props) { -// super(props); - -// this.state = { error: null }; -// } - -// onSubmit = event => { -// this.props.firebase -// .doSignInWithFacebook() -// .then(socialAuthUser => { -// // Create a user in your Firebase Realtime Database too -// return this.props.firebase.user(socialAuthUser.user.uid).set( -// { -// username: socialAuthUser.additionalUserInfo.profile.name, -// email: socialAuthUser.additionalUserInfo.profile.email, -// roles: {}, -// }, -// { merge: true }, -// ); -// }) -// .then(() => { -// this.setState({ error: null }); -// this.props.history.push(ROUTES.HOME); -// }) -// .catch(error => { -// if (error.code === ERROR_CODE_ACCOUNT_EXISTS) { -// error.message = ERROR_MSG_ACCOUNT_EXISTS; -// } - -// this.setState({ error }); -// }); - -// event.preventDefault(); -// }; - -// render() { -// const { error } = this.state; - -// return ( -//
-// - -// {error &&

{error.message}

} -//
-// ); -// } -// } - -// class SignInTwitterBase extends Component { -// constructor(props) { -// super(props); - -// this.state = { error: null }; -// } - -// onSubmit = event => { -// this.props.firebase -// .doSignInWithTwitter() -// .then(socialAuthUser => { -// // Create a user in your Firebase Realtime Database too -// return this.props.firebase.user(socialAuthUser.user.uid).set( -// { -// username: socialAuthUser.additionalUserInfo.profile.name, -// email: socialAuthUser.additionalUserInfo.profile.email, -// roles: {}, -// }, -// { merge: true }, -// ); -// }) -// .then(() => { -// this.setState({ error: null }); -// this.props.history.push(ROUTES.HOME); -// }) -// .catch(error => { -// if (error.code === ERROR_CODE_ACCOUNT_EXISTS) { -// error.message = ERROR_MSG_ACCOUNT_EXISTS; -// } - -// this.setState({ error }); -// }); - -// event.preventDefault(); -// }; - -// render() { -// const { error } = this.state; - -// return ( -//
-// - -// {error &&

{error.message}

} -//
-// ); -// } -// } - -const SignInForm = compose( - withRouter, - withFirebase, -)(SignInFormBase); - -// const SignInGoogle = compose( -// withRouter, -// withFirebase, -// )(SignInGoogleBase); - -// const SignInFacebook = compose( -// withRouter, -// withFirebase, -// )(SignInFacebookBase); - -// const SignInTwitter = compose( -// withRouter, -// withFirebase, -// )(SignInTwitterBase); - -export default SignInPage; - -export { SignInForm }; \ No newline at end of file diff --git a/src/components/SignIn/index.js b/src/components/SignIn/index.js index dc7f96337..ef7d128a8 100644 --- a/src/components/SignIn/index.js +++ b/src/components/SignIn/index.js @@ -10,13 +10,16 @@ import * as ROUTES from '../../constants/routes'; const SignInPage = () => ( +
+ +

SignIn

- {/*
*/} +

Or sign in manually:

@@ -27,6 +30,7 @@ const SignInPage = () => (
+ ); const INITIAL_STATE = { From bd87bfd404fad03280a161d73bd342c1f3b268e4 Mon Sep 17 00:00:00 2001 From: aster Date: Fri, 24 Jul 2020 12:15:51 -0400 Subject: [PATCH 2/2] new change after merging to master --- src/assets/styles/_ViewArticle.scss | 34 ++---- src/assets/styles/_create_article.scss | 9 +- src/assets/styles/_searchbar.scss | 29 +---- src/components/AddReplys/index.js | 23 ++-- src/components/Comment/index.js | 13 +-- src/components/ReplyComment/index.js | 22 +--- src/components/SignIn/index.js | 127 ++++++++++++---------- src/components/Userprofile/index.js | 53 +++++---- src/containers/Create-article/index.js | 69 ++++-------- src/containers/IndividualView/index.js | 47 ++------ src/containers/IndividualView/sidebar.css | 4 +- 11 files changed, 164 insertions(+), 266 deletions(-) diff --git a/src/assets/styles/_ViewArticle.scss b/src/assets/styles/_ViewArticle.scss index 4755d121f..2062a9442 100644 --- a/src/assets/styles/_ViewArticle.scss +++ b/src/assets/styles/_ViewArticle.scss @@ -2,37 +2,31 @@ box-sizing: border-box; content: width= device-width, initial-scale=1; } -// body { -// background-color: #e8eeef; - -// } //MAIN CONTAINER CODE .container-individual { margin: auto; display: grid; grid-gap: 10px; padding: 30px 10px 20px 10px; - width: 100%; - //justify-content: center; - max-width: 1000px; +width: 100%; +max-width: 1000px; align-self: center; margin-bottom: 1px; font-family: Helvetica; margin-top: 3em; - // overflow: auto; - + // margin-left: 25%; + // margin-right: 25%; } + //THIS IS THE INDUVIDWAL VIWE CSS .card-individual { - // box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); background-color: ghostwhite; border-bottom: solid 0.1px lightgrey; - overflow: auto; + //overflow: auto; border-radius: 10px; - // width: 900px; } .auther-name-individual { @@ -47,9 +41,7 @@ } .grid-subject2 { - padding: 12px 40px; - // background-color: white; border-bottom-style: hidden; text-align: left; font-weight: bold; @@ -72,7 +64,6 @@ font-size: 9pt; background-color: white; border: hidden; - //font-weight: bold; border-radius: 1px; position: relative; font-weight: bold; @@ -83,7 +74,6 @@ font-size: 9pt; background-color: white; border: hidden; - //font-weight: bold; border-radius: 1px; position: relative; font-weight: bold; @@ -94,7 +84,6 @@ } //THIS IS ADD COMMENT CSS .card-addcomment { - // box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); background-color: ghostwhite; padding: 4px 4px 30px 4px; transform: 1.5; @@ -102,7 +91,6 @@ border-radius: 10px; } .card-addcomment:hover { - // box-shadow: 5px 10px 20px 1px rgba(0, 0, 0, 0.9) !important; border: solid 1px gray; } @@ -116,7 +104,7 @@ float: right; color: #fae596; display: inline-block; - margin:2px; + margin: 2px; } textarea { @@ -129,7 +117,6 @@ textarea { //THIS IS THE LIST OF COMMENTS CSS .card-comment { - //box-shadow: 0 1px 2px rgba(0,0,0, 0.4); background-color: ghostwhite; margin-top: 4px; border-bottom: solid 0.2px lightgray; @@ -159,7 +146,6 @@ textarea { .likes-individual { position: absolute; - // background-color: lightgrey; padding-top: 0; padding-right: 0.3em; padding-left: 0.3em; @@ -175,10 +161,6 @@ textarea { background-color: deepskyblue; background-size: 10px; } -.commentdescription{ +.commentdescription { padding-left: 1.5em; - } -.usernamepost{ - // padding-left: 1em; -} \ No newline at end of file diff --git a/src/assets/styles/_create_article.scss b/src/assets/styles/_create_article.scss index 07d2bd2e8..49bcf5c13 100644 --- a/src/assets/styles/_create_article.scss +++ b/src/assets/styles/_create_article.scss @@ -64,9 +64,8 @@ font-weight: bold; align-self: flex-end; background: $main-color; - // background: $secondary-color; color: lightgray; - // background-color: yellow; + } .modal-wrapper-postarticle { background: rgba(0, 0, 0, 0.5); @@ -115,9 +114,7 @@ flex-direction: column; transform: translate(-35%, -35%); } - //.devedit-form-legend1 { - // font-size: 1em; - //} + } .autosuggest_list{ font-size: 0.5em; @@ -125,5 +122,5 @@ letter-spacing: -0.08em; text-align: start; align-self: flex-start; - // padding: 1em; + } diff --git a/src/assets/styles/_searchbar.scss b/src/assets/styles/_searchbar.scss index 0a7bed71b..a8ea379b6 100644 --- a/src/assets/styles/_searchbar.scss +++ b/src/assets/styles/_searchbar.scss @@ -9,7 +9,6 @@ } .mainSearch { display: flex; - //position:relative; overflow: hidden; } @media only screen { @@ -31,9 +30,6 @@ } @media screen and (min-width: 320px) { .input-field { - // padding: 10px 10px 10px 30px; - // text-align: left; - // width: 30em; display: flex; padding: 5px 10px 10px 30px; text-align: left; @@ -42,18 +38,11 @@ margin-left: 24em; margin-right: 0.5em; border-radius: solid 6px; - //background-color: whitesmoke; + } - // .input-icons i { - // position: absolute; - // float: left; - // margin-top: 20px; - // // margin-right: 10em; - // margin-left: -10.5em; - // } + .popover__wrapper { position: relative; - //margin-top: 1.5rem; display: inline-block; } .popover__content { @@ -84,9 +73,7 @@ z-index: 10; opacity: 1; visibility: visible; - //transform: translate(0, -0.4px); transition: all 0.5s cubic-bezier(0.75, -0.02, 0.2, 0.97); - //width: 120em; } .popover__message { text-align: left; @@ -102,16 +89,9 @@ border-radius: 10px; margin-right: 0.2em; } - // .input-icons i { - // position: absolute; - // float: left; - // margin-top: 20px; - // // margin-right: 5em; - // margin-left: 10.5em; - //} + .popover__wrapper { position: relative; - //margin-top: 1.5rem; display: inline-block; } .popover__content { @@ -141,9 +121,8 @@ z-index: 10; opacity: 1; visibility: visible; - //transform: translate(0, -0.4px); transition: all 0.5s cubic-bezier(0.75, -0.02, 0.2, 0.97); - //width: 120em; + } .popover__message { text-align: left; diff --git a/src/components/AddReplys/index.js b/src/components/AddReplys/index.js index 44b0ee858..2a7956913 100644 --- a/src/components/AddReplys/index.js +++ b/src/components/AddReplys/index.js @@ -2,7 +2,7 @@ import React from "react"; import { withFirebase } from "../Firebase"; import { withRouter } from "react-router-dom"; import { compose } from "recompose"; -//import * as ROUTES from "../../constants/routes"; + import { AuthUserContext } from "../Session"; const moment = require("moment"); class AddReplys extends React.Component { @@ -16,11 +16,11 @@ class AddReplys extends React.Component { } togglePopup = () => { - //const{commentId}=this.props + this.setState({ showPopup: !this.state.showPopup }); - //console.log("this is the commentId", commentId) + }; cancle = () => { this.setState({ showPopup: false }); @@ -29,12 +29,12 @@ class AddReplys extends React.Component { handleSubmit =(e,authUser)=> { e.preventDefault(); const commentId = this.props.commentId; - // console.log("this is the commentId for the reply", commentId) + this.props.firebase - //.replys(commentId) + .comments() .add({ - // commentId:commentId, + reply: this.state.reply, timeCreated: moment().format(` MMMM DD, YYYY -- hh:mm:ss A `), userId:authUser.uid, @@ -44,8 +44,7 @@ class AddReplys extends React.Component { console.log('DOC REF', docRef.id) this.props.firebase.comment(commentId).update({ childCommentId: docRef.id - //console.log(" this is the replysID ", docRef.id) - //console.log(" this is the replysID ", docRef.id) + }); this.setState({ @@ -62,9 +61,9 @@ class AddReplys extends React.Component { }; render() { - // const { comment, limited, timeCreated,commentId } = this.props; + const { commentId} = this.props; - //console .log("this is the comment Id i have from comment",commentId) + return ( {authUser => ( @@ -79,10 +78,10 @@ class AddReplys extends React.Component {