clear up about page
This commit is contained in:
parent
71894daf49
commit
18ec09c5b0
2 changed files with 6 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { makeSelectMetadataItemForUri, makeSelectClaimForUri } from 'redux/selectors/claims';
|
||||
import { selectUser } from 'redux/selectors/user';
|
||||
import ChannelAbout from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
|
@ -8,6 +9,7 @@ const select = (state, props) => ({
|
|||
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),
|
||||
email: makeSelectMetadataItemForUri(props.uri, 'email')(state),
|
||||
languages: makeSelectMetadataItemForUri(props.uri, 'languages')(state),
|
||||
user: selectUser(state),
|
||||
});
|
||||
|
||||
export default connect(select, null)(ChannelAbout);
|
||||
|
|
|
@ -17,6 +17,7 @@ type Props = {
|
|||
email: ?string,
|
||||
website: ?string,
|
||||
languages: Array<string>,
|
||||
user: ?User,
|
||||
};
|
||||
|
||||
const formatEmail = (email: string) => {
|
||||
|
@ -29,8 +30,9 @@ const formatEmail = (email: string) => {
|
|||
};
|
||||
|
||||
function ChannelAbout(props: Props) {
|
||||
const { claim, uri, description, email, website, languages } = props;
|
||||
const { claim, uri, description, email, website, languages, user } = props;
|
||||
const claimId = claim && claim.claim_id;
|
||||
const canView = user && user.global_mod;
|
||||
|
||||
return (
|
||||
<div className="card">
|
||||
|
@ -111,8 +113,7 @@ function ChannelAbout(props: Props) {
|
|||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<YoutubeBadge channelClaimId={claimId} />
|
||||
{canView && <YoutubeBadge channelClaimId={claimId} />}
|
||||
</Fragment>
|
||||
</section>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue