cleanup
This commit is contained in:
parent
2c0485a7c3
commit
4420983a79
7 changed files with 49 additions and 54 deletions
|
@ -1,24 +1,9 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import SelectChannel from './view';
|
import SelectChannel from './view';
|
||||||
import {
|
import { selectMyChannelClaims } from 'lbry-redux';
|
||||||
selectBalance,
|
|
||||||
selectMyChannelClaims,
|
|
||||||
selectFetchingMyChannels,
|
|
||||||
doFetchChannelListMine,
|
|
||||||
doCreateChannel,
|
|
||||||
} from 'lbry-redux';
|
|
||||||
import { selectUserVerifiedEmail } from 'lbryinc';
|
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
channels: selectMyChannelClaims(state),
|
channels: selectMyChannelClaims(state),
|
||||||
fetchingChannels: selectFetchingMyChannels(state),
|
|
||||||
balance: selectBalance(state),
|
|
||||||
emailVerified: selectUserVerifiedEmail(state),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
export default connect(select)(SelectChannel);
|
||||||
createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)),
|
|
||||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(select, perform)(SelectChannel);
|
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { makeSelectClaimForUri, makeSelectTitleForUri, makeSelectIsUriResolving } from 'lbry-redux';
|
import { makeSelectClaimForUri, makeSelectTitleForUri } from 'lbry-redux';
|
||||||
import ClaimPreviewTitle from './view';
|
import ClaimPreviewTitle from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
claim: makeSelectClaimForUri(props.uri)(state),
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
title: makeSelectTitleForUri(props.uri)(state),
|
title: makeSelectTitleForUri(props.uri)(state),
|
||||||
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select)(ClaimPreviewTitle);
|
export default connect(select)(ClaimPreviewTitle);
|
||||||
|
|
|
@ -10,6 +10,7 @@ type Props = {
|
||||||
|
|
||||||
function ClaimPreviewTitle(props: Props) {
|
function ClaimPreviewTitle(props: Props) {
|
||||||
const { title, claim } = props;
|
const { title, claim } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="claim-preview__title">
|
<div className="claim-preview__title">
|
||||||
{claim ? <TruncatedText text={title || claim.name} lines={2} /> : <span>{__('Nothing here')}</span>}
|
{claim ? <TruncatedText text={title || claim.name} lines={2} /> : <span>{__('Nothing here')}</span>}
|
||||||
|
|
|
@ -19,7 +19,7 @@ type Props = {
|
||||||
prepareEdit: string => void,
|
prepareEdit: string => void,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function CreatorDashboardPage(props: Props) {
|
export default function CreatorAnalytics(props: Props) {
|
||||||
const { channels, prepareEdit } = props;
|
const { channels, prepareEdit } = props;
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const [stats, setStats] = React.useState();
|
const [stats, setStats] = React.useState();
|
||||||
|
@ -104,7 +104,10 @@ export default function CreatorDashboardPage(props: Props) {
|
||||||
subtitle={
|
subtitle={
|
||||||
<div className="card__data-subtitle">
|
<div className="card__data-subtitle">
|
||||||
<span>
|
<span>
|
||||||
{stats.ChannelSubChange > 0 ? '+' : '-'} {stats.ChannelSubChange || 0} this week
|
{stats.ChannelSubChange > 0 ? '+' : '-'}{' '}
|
||||||
|
{__('%follower_count_weekly_change% this week', {
|
||||||
|
follower_count_weekly_change: stats.ChannelSubChange || 0,
|
||||||
|
})}
|
||||||
</span>
|
</span>
|
||||||
{stats.ChannelSubChange > 0 && <Icon icon={ICONS.SUPPORT} iconColor="green" size={18} />}
|
{stats.ChannelSubChange > 0 && <Icon icon={ICONS.SUPPORT} iconColor="green" size={18} />}
|
||||||
</div>
|
</div>
|
||||||
|
@ -112,33 +115,36 @@ export default function CreatorDashboardPage(props: Props) {
|
||||||
/>
|
/>
|
||||||
<Card
|
<Card
|
||||||
icon={ICONS.EYE}
|
icon={ICONS.EYE}
|
||||||
title={<span>{stats.AllContentViews} views</span>}
|
title={<span>{__('%all_content_views% views', { all_content_views: stats.AllContentViews })}</span>}
|
||||||
subtitle={<span>{stats.AllContentViewsChange || 0} this week</span>}
|
subtitle={
|
||||||
|
<span>
|
||||||
|
{__('%all_content_views_weekly_change% this week', {
|
||||||
|
all_content_views_weekly_change: stats.AllContentViewsChange || 0,
|
||||||
|
})}
|
||||||
|
</span>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Card
|
<Card
|
||||||
title={
|
title={
|
||||||
<div className="card__data-subtitle">
|
<div className="card__data-subtitle">
|
||||||
<span>Most Viewed Claim</span>
|
<span>{__('Most Viewed Claim')}</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
body={
|
body={
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className="card--inline">
|
<div className="card--inline">
|
||||||
<ClaimPreview
|
<ClaimPreview uri={stats.VideoURITopAllTime} />
|
||||||
uri={stats.VideoURITopAllTime}
|
</div>
|
||||||
properties={
|
<div className="section__subtitle card__data-subtitle">
|
||||||
<div className="section__subtitle card__data-subtitle">
|
<span>
|
||||||
<span>
|
{__('%all_time_top_views% views - %all_time_views_weekly_change% this week', {
|
||||||
{stats.VideoViewsTopAllTime} views - {stats.VideoViewChangeTopAllTime} this week
|
all_time_top_views: stats.VideoViewsTopAllTime,
|
||||||
</span>
|
all_time_views_weekly_change: stats.VideoViewChangeTopAllTime,
|
||||||
{stats.VideoViewChangeTopAllTime > 0 && (
|
})}
|
||||||
<Icon icon={ICONS.SUPPORT} iconColor="green" size={18} />
|
</span>
|
||||||
)}
|
{stats.VideoViewChangeTopAllTime > 0 && <Icon icon={ICONS.SUPPORT} iconColor="green" size={18} />}
|
||||||
</div>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,10 +160,9 @@ $metadata-z-index: 1;
|
||||||
|
|
||||||
.channel__list-item {
|
.channel__list-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
background-color: var(--color-card-background);
|
background-color: var(--color-card-background);
|
||||||
padding: var(--spacing-small);
|
padding: var(--spacing-small);
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
border-bottom: 1px solid var(--color-border);
|
border-bottom: 1px solid var(--color-border);
|
||||||
|
|
||||||
.channel-thumbnail {
|
.channel-thumbnail {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
Pmenu// Extends reach-ui menu button base stylesheet
|
// Extends reach-ui menu button base stylesheet
|
||||||
/* Used to detect in JavaScript if apps have loaded styles or not. */
|
/* Used to detect in JavaScript if apps have loaded styles or not. */
|
||||||
:root {
|
:root {
|
||||||
--reach-menu-button: 1;
|
--reach-menu-button: 1;
|
||||||
|
@ -76,7 +76,6 @@ Pmenu// Extends reach-ui menu button base stylesheet
|
||||||
|
|
||||||
.badge {
|
.badge {
|
||||||
margin-left: var(--spacing-small);
|
margin-left: var(--spacing-small);
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
32
yarn.lock
32
yarn.lock
|
@ -928,9 +928,9 @@
|
||||||
version "0.1.3"
|
version "0.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/@reach/component-component/-/component-component-0.1.3.tgz#5d156319572dc38995b246f81878bc2577c517e5"
|
resolved "https://registry.yarnpkg.com/@reach/component-component/-/component-component-0.1.3.tgz#5d156319572dc38995b246f81878bc2577c517e5"
|
||||||
|
|
||||||
"@reach/menu-button@^0.1.18":
|
"@reach/menu-button@0.7.4":
|
||||||
version "0.1.18"
|
version "0.7.4"
|
||||||
resolved "https://registry.yarnpkg.com/@reach/menu-button/-/menu-button-0.1.18.tgz#cb9e3bf1c2a2bdb5d618697b87ad353dfbca123e"
|
resolved "https://registry.yarnpkg.com/@reach/menu-button/-/menu-button-0.7.4.tgz#6b2cb91e5471dfc67aa10380c2779eb3d21d98bf"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@reach/auto-id" "^0.7.4"
|
"@reach/auto-id" "^0.7.4"
|
||||||
"@reach/popover" "^0.7.4"
|
"@reach/popover" "^0.7.4"
|
||||||
|
@ -942,9 +942,13 @@
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/@reach/observe-rect/-/observe-rect-1.0.5.tgz#28bf3c5c35da7fef72cd124af4ac32308d0c3f15"
|
resolved "https://registry.yarnpkg.com/@reach/observe-rect/-/observe-rect-1.0.5.tgz#28bf3c5c35da7fef72cd124af4ac32308d0c3f15"
|
||||||
|
|
||||||
"@reach/portal@^0.2.1":
|
"@reach/observe-rect@^1.0.5":
|
||||||
version "0.2.1"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/@reach/portal/-/portal-0.2.1.tgz#07720b999e0063a9e179c14dbdc60fd991cfc9fa"
|
resolved "https://registry.yarnpkg.com/@reach/observe-rect/-/observe-rect-1.1.0.tgz#4e967a93852b6004c3895d9ed8d4e5b41895afde"
|
||||||
|
|
||||||
|
"@reach/popover@^0.7.4":
|
||||||
|
version "0.7.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@reach/popover/-/popover-0.7.4.tgz#def055c588a76ef4a48ac81f0b4e7373e2781b28"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@reach/portal" "^0.7.4"
|
"@reach/portal" "^0.7.4"
|
||||||
"@reach/rect" "^0.7.4"
|
"@reach/rect" "^0.7.4"
|
||||||
|
@ -981,11 +985,9 @@
|
||||||
version "0.2.3"
|
version "0.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/@reach/utils/-/utils-0.2.3.tgz#820f6a6af4301b4c5065cfc04bb89e6a3d1d723f"
|
resolved "https://registry.yarnpkg.com/@reach/utils/-/utils-0.2.3.tgz#820f6a6af4301b4c5065cfc04bb89e6a3d1d723f"
|
||||||
|
|
||||||
"@reach/window-size@^0.1.4":
|
"@reach/utils@^0.7.4":
|
||||||
version "0.1.4"
|
version "0.7.4"
|
||||||
resolved "https://registry.yarnpkg.com/@reach/window-size/-/window-size-0.1.4.tgz#3257b646548f61c2708a661a683620fbe0a706cb"
|
resolved "https://registry.yarnpkg.com/@reach/utils/-/utils-0.7.4.tgz#cdd0cff8c57445ce9c2b11204e6a62868f1093a1"
|
||||||
dependencies:
|
|
||||||
"@reach/component-component" "^0.1.3"
|
|
||||||
|
|
||||||
"@samverschueren/stream-to-observable@^0.3.0":
|
"@samverschueren/stream-to-observable@^0.3.0":
|
||||||
version "0.3.0"
|
version "0.3.0"
|
||||||
|
@ -6136,9 +6138,9 @@ lazy-val@^1.0.4:
|
||||||
yargs "^13.2.2"
|
yargs "^13.2.2"
|
||||||
zstd-codec "^0.1.1"
|
zstd-codec "^0.1.1"
|
||||||
|
|
||||||
lbry-redux@lbryio/lbry-redux#2f896bac53a2424a6820e1a63aa81d6f755dd4f2:
|
lbry-redux@lbryio/lbry-redux#6ed0dde5cbd7c25aa02631d5fa31fb6a4de76876:
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/2f896bac53a2424a6820e1a63aa81d6f755dd4f2"
|
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/6ed0dde5cbd7c25aa02631d5fa31fb6a4de76876"
|
||||||
dependencies:
|
dependencies:
|
||||||
proxy-polyfill "0.1.6"
|
proxy-polyfill "0.1.6"
|
||||||
reselect "^3.0.0"
|
reselect "^3.0.0"
|
||||||
|
@ -10107,6 +10109,10 @@ symbol-observable@^1.0.3, symbol-observable@^1.1.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804"
|
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804"
|
||||||
|
|
||||||
|
tabbable@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-4.0.0.tgz#5bff1d1135df1482cf0f0206434f15eadbeb9261"
|
||||||
|
|
||||||
table@^5.0.2, table@^5.2.3:
|
table@^5.0.2, table@^5.2.3:
|
||||||
version "5.4.6"
|
version "5.4.6"
|
||||||
resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e"
|
resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e"
|
||||||
|
|
Loading…
Reference in a new issue