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