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.
This commit is contained in:
@@ -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 (
|
||||
<div className="profile-page">
|
||||
<div className="bg-banner bg-program-micro-masters d-none d-md-block p-relative" />
|
||||
@@ -165,7 +169,7 @@ export class ProfilePage extends React.Component {
|
||||
lg={{ size: 8, offset: 1 }}
|
||||
className="mt-4 mt-md-n5"
|
||||
>
|
||||
{this.props.requiresParentalConsent ? <AgeMessage accountURL="#account" /> : null}
|
||||
{shouldShowAgeMessage ? <AgeMessage accountURL="#account" /> : null}
|
||||
<Bio
|
||||
bio={bio}
|
||||
visibilityBio={visibilityBio}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { UncontrolledAlert } from 'reactstrap';
|
||||
import { Alert } from 'reactstrap';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import { configuration } from '../../config/environment';
|
||||
@@ -8,7 +8,7 @@ const { ACCOUNT_SETTINGS_URL } = configuration;
|
||||
|
||||
function AgeMessage() {
|
||||
return (
|
||||
<UncontrolledAlert color="info">
|
||||
<Alert color="info">
|
||||
<FormattedMessage
|
||||
id="profile.age.headline"
|
||||
defaultMessage="Your profile cannot be shared."
|
||||
@@ -28,7 +28,7 @@ function AgeMessage() {
|
||||
description="label on a link to set birthday"
|
||||
/>
|
||||
</a>
|
||||
</UncontrolledAlert>
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user