From 438dcdb641852e71bbcd883a2644f57e28228b9e Mon Sep 17 00:00:00 2001 From: Adam Butterworth Date: Thu, 7 Mar 2019 15:20:23 -0500 Subject: [PATCH] fix: Do not show age message when viewing other's profiles (#64) remove close button on age message. do not show age message for other users. --- src/components/ProfilePage.jsx | 6 +++++- src/components/ProfilePage/AgeMessage.jsx | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/ProfilePage.jsx b/src/components/ProfilePage.jsx index 0ed1ebb..c71a800 100644 --- a/src/components/ProfilePage.jsx +++ b/src/components/ProfilePage.jsx @@ -92,6 +92,8 @@ export class ProfilePage extends React.Component { visibilityCourseCertificates, bio, visibilityBio, + requiresParentalConsent, + isCurrentUserProfile, } = this.props; const commonFormProps = { @@ -101,6 +103,8 @@ export class ProfilePage extends React.Component { changeHandler: this.handleChange, }; + const shouldShowAgeMessage = requiresParentalConsent && isCurrentUserProfile; + return (
@@ -165,7 +169,7 @@ export class ProfilePage extends React.Component { lg={{ size: 8, offset: 1 }} className="mt-4 mt-md-n5" > - {this.props.requiresParentalConsent ? : null} + {shouldShowAgeMessage ? : null} + - + ); }