From ca1d86acf11c60825e453642fc71ab6bfa6630fc Mon Sep 17 00:00:00 2001 From: Clayton Wilson Date: Thu, 31 Oct 2019 13:56:40 -0400 Subject: [PATCH] Users can be verified and have a check mark displayed on their profiles --- functions/handlers/users.js | 3 ++- twistter-frontend/src/pages/user.js | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/functions/handlers/users.js b/functions/handlers/users.js index 203aa58..1ff9298 100644 --- a/functions/handlers/users.js +++ b/functions/handlers/users.js @@ -76,7 +76,8 @@ exports.signup = (req, res) => { handle: newUser.handle, createdAt: newUser.createdAt, userId, - followedTopics: [] + followedTopics: [], + verified: false }; return db.doc(`/users/${newUser.handle}`).set(userCred); }) diff --git a/twistter-frontend/src/pages/user.js b/twistter-frontend/src/pages/user.js index 27a0c94..ef764b3 100644 --- a/twistter-frontend/src/pages/user.js +++ b/twistter-frontend/src/pages/user.js @@ -10,6 +10,8 @@ import Chip from '@material-ui/core/Chip'; import Typography from "@material-ui/core/Typography"; import AddCircle from '@material-ui/icons/AddCircle'; import TextField from '@material-ui/core/TextField'; +import VerifiedIcon from '@material-ui/icons/CheckSharp'; + // component import Userline from '../Userline'; @@ -56,7 +58,8 @@ class user extends Component { .then(res => { this.setState({ profile: res.data.credentials.handle, - imageUrl: res.data.credentials.imageUrl + imageUrl: res.data.credentials.imageUrl, + verified: res.data.credentials.verified ? res.data.credentials.verified : false }); }) .catch(err => console.log(err)); @@ -72,9 +75,9 @@ class user extends Component { render() { const classes = this.props; let profileMarkup = this.state.profile ? ( -

- {this.state.profile} -

) : (

loading username...

); +
+ {this.state.profile} {this.state.verified ? (): (null)} +
) : (

loading username...

); let topicsMarkup = this.state.topics ? (