clear up about page

This commit is contained in:
Thomas Zarebczan 2022-05-10 14:10:31 -04:00
parent 71894daf49
commit 18ec09c5b0
No known key found for this signature in database
GPG key ID: 767B41E1BB7346F2
2 changed files with 6 additions and 3 deletions

View file

@ -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);

View file

@ -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>