move youtube badge to 'channel about' section
This commit is contained in:
parent
fc2a79242e
commit
c1b5280446
4 changed files with 14 additions and 16 deletions
|
@ -742,7 +742,7 @@
|
||||||
"There was an error reposting this claim. Please try again later.": "There was an error reposting this claim. Please try again later.",
|
"There was an error reposting this claim. Please try again later.": "There was an error reposting this claim. Please try again later.",
|
||||||
"Claim ID": "Claim ID",
|
"Claim ID": "Claim ID",
|
||||||
"Official YouTube Creator": "Official YouTube Creator",
|
"Official YouTube Creator": "Official YouTube Creator",
|
||||||
"Official YouTube Creator - Last checked %time_ago%": "Official YouTube Creator - Last checked %time_ago%",
|
"Last checked %time_ago%": "Last checked %time_ago%",
|
||||||
"Install Now": "Install Now",
|
"Install Now": "Install Now",
|
||||||
"Invite Link": "Invite Link",
|
"Invite Link": "Invite Link",
|
||||||
"Earn %lbc% for inviting subscribers, followers, fans, friends, etc. to join and follow you on %SITE_NAME%. You can use invites just like affiliate links.": "Earn %lbc% for inviting subscribers, followers, fans, friends, etc. to join and follow you on %SITE_NAME%. You can use invites just like affiliate links.",
|
"Earn %lbc% for inviting subscribers, followers, fans, friends, etc. to join and follow you on %SITE_NAME%. You can use invites just like affiliate links.": "Earn %lbc% for inviting subscribers, followers, fans, friends, etc. to join and follow you on %SITE_NAME%. You can use invites just like affiliate links.",
|
||||||
|
|
|
@ -7,6 +7,7 @@ import CreditAmount from 'component/common/credit-amount';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import * as PAGES from 'constants/pages';
|
import * as PAGES from 'constants/pages';
|
||||||
import DateTime from 'component/dateTime';
|
import DateTime from 'component/dateTime';
|
||||||
|
import YoutubeBadge from 'component/youtubeBadge';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
claim: ChannelClaim,
|
claim: ChannelClaim,
|
||||||
|
@ -27,6 +28,7 @@ const formatEmail = (email: string) => {
|
||||||
|
|
||||||
function ChannelAbout(props: Props) {
|
function ChannelAbout(props: Props) {
|
||||||
const { claim, uri, description, email, website } = props;
|
const { claim, uri, description, email, website } = props;
|
||||||
|
const claimId = claim && claim.claim_id;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="card">
|
<div className="card">
|
||||||
|
@ -97,6 +99,8 @@ function ChannelAbout(props: Props) {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<YoutubeBadge channelClaimId={claimId} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,18 +1,14 @@
|
||||||
// @flow
|
// @flow
|
||||||
import * as ICONS from 'constants/icons';
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import DateTime from 'component/dateTime';
|
import DateTime from 'component/dateTime';
|
||||||
import Icon from 'component/common/icon';
|
|
||||||
import { Lbryio } from 'lbryinc';
|
import { Lbryio } from 'lbryinc';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
channelClaimId: string,
|
channelClaimId: string,
|
||||||
includeSyncDate: boolean,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function YoutubeBadge(props: Props) {
|
export default function YoutubeBadge(props: Props) {
|
||||||
const { channelClaimId, includeSyncDate = true } = props;
|
const { channelClaimId } = props;
|
||||||
|
|
||||||
const [isVerified, setIsVerified] = React.useState();
|
const [isVerified, setIsVerified] = React.useState();
|
||||||
const [lastYtSyncDate, setLastYtSyncDate] = React.useState();
|
const [lastYtSyncDate, setLastYtSyncDate] = React.useState();
|
||||||
|
|
||||||
|
@ -34,15 +30,15 @@ export default function YoutubeBadge(props: Props) {
|
||||||
}, [channelClaimId]);
|
}, [channelClaimId]);
|
||||||
|
|
||||||
if (isVerified) {
|
if (isVerified) {
|
||||||
const str =
|
|
||||||
includeSyncDate && lastYtSyncDate
|
|
||||||
? __('Official YouTube Creator - Last checked %time_ago%', { time_ago: DateTime.getTimeAgoStr(lastYtSyncDate) })
|
|
||||||
: __('Official YouTube Creator');
|
|
||||||
return (
|
return (
|
||||||
<div className="media__uri--right--yt-badge">
|
<>
|
||||||
<Icon icon={ICONS.VALIDATED} size={12} />
|
<label>{__('Official YouTube Creator')}</label>
|
||||||
{str}
|
<div className="media__info-text">
|
||||||
|
<div className="media__info-text media__info-text--constrained">
|
||||||
|
{lastYtSyncDate && __('Last checked %time_ago%', { time_ago: DateTime.getTimeAgoStr(lastYtSyncDate) })}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -20,7 +20,6 @@ import ChannelEdit from 'component/channelEdit';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import HelpLink from 'component/common/help-link';
|
import HelpLink from 'component/common/help-link';
|
||||||
import ClaimSupportButton from 'component/claimSupportButton';
|
import ClaimSupportButton from 'component/claimSupportButton';
|
||||||
import YoutubeBadge from 'component/youtubeBadge';
|
|
||||||
|
|
||||||
export const PAGE_VIEW_QUERY = `view`;
|
export const PAGE_VIEW_QUERY = `view`;
|
||||||
const ABOUT_PAGE = `about`;
|
const ABOUT_PAGE = `about`;
|
||||||
|
@ -144,7 +143,6 @@ function ChannelPage(props: Props) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page noFooter>
|
<Page noFooter>
|
||||||
<YoutubeBadge channelClaimId={claimId} />
|
|
||||||
<header className="channel-cover">
|
<header className="channel-cover">
|
||||||
<div className="channel__quick-actions">
|
<div className="channel__quick-actions">
|
||||||
{isMyYouTubeChannel && (
|
{isMyYouTubeChannel && (
|
||||||
|
|
Loading…
Reference in a new issue