mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-01 09:45:10 +00:00
hide some file page buttons with SIMPLE_SITE flag
This commit is contained in:
parent
5ea87b76c9
commit
e10647b5a2
5 changed files with 52 additions and 26 deletions
|
@ -22,7 +22,7 @@ const config = {
|
||||||
SITE_CANONICAL_URL: process.env.SITE_CANONICAL_URL,
|
SITE_CANONICAL_URL: process.env.SITE_CANONICAL_URL,
|
||||||
DEFAULT_LANGUAGE: process.env.DEFAULT_LANGUAGE,
|
DEFAULT_LANGUAGE: process.env.DEFAULT_LANGUAGE,
|
||||||
AUTO_FOLLOW_CHANNELS: process.env.AUTO_FOLLOW_CHANNELS,
|
AUTO_FOLLOW_CHANNELS: process.env.AUTO_FOLLOW_CHANNELS,
|
||||||
SIMPLE_SITE: process.env.SIMPLE_SITE === 'false',
|
SIMPLE_SITE: process.env.SIMPLE_SITE === 'true',
|
||||||
PINNED_URI_1: process.env.PINNED_URI_1,
|
PINNED_URI_1: process.env.PINNED_URI_1,
|
||||||
PINNED_LABEL_1: process.env.PINNED_LABEL_1,
|
PINNED_LABEL_1: process.env.PINNED_LABEL_1,
|
||||||
PINNED_URI_2: process.env.PINNED_URI_2,
|
PINNED_URI_2: process.env.PINNED_URI_2,
|
||||||
|
|
|
@ -6,9 +6,19 @@ import Button from 'component/button';
|
||||||
type Props = {
|
type Props = {
|
||||||
href?: string,
|
href?: string,
|
||||||
navigate?: string,
|
navigate?: string,
|
||||||
|
icon?: string,
|
||||||
|
description?: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function HelpLink(props: Props) {
|
export default function HelpLink(props: Props) {
|
||||||
const { href, navigate } = props;
|
const { href, navigate, icon, description } = props;
|
||||||
return <Button className="icon--help" icon={ICONS.HELP} description={__('Help')} href={href} navigate={navigate} />;
|
return (
|
||||||
|
<Button
|
||||||
|
className="icon--help"
|
||||||
|
icon={icon || ICONS.HELP}
|
||||||
|
description={description || __('Help')}
|
||||||
|
href={href}
|
||||||
|
navigate={navigate}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
import type { Node } from 'react';
|
import type { Node } from 'react';
|
||||||
|
import { SIMPLE_SITE } from 'config';
|
||||||
import * as PAGES from 'constants/pages';
|
import * as PAGES from 'constants/pages';
|
||||||
import * as CS from 'constants/claim_search';
|
import * as CS from 'constants/claim_search';
|
||||||
import * as MODALS from 'constants/modal_types';
|
import * as MODALS from 'constants/modal_types';
|
||||||
|
@ -64,28 +65,30 @@ function FileActions(props: Props) {
|
||||||
onClick={() => openModal(MODALS.SOCIAL_SHARE, { uri, webShareable })}
|
onClick={() => openModal(MODALS.SOCIAL_SHARE, { uri, webShareable })}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="button-group">
|
{!SIMPLE_SITE && (
|
||||||
<Button
|
<div className="button-group">
|
||||||
button="alt"
|
|
||||||
icon={ICONS.REPOST}
|
|
||||||
label={__('Repost')}
|
|
||||||
requiresAuth={IS_WEB}
|
|
||||||
onClick={() => openModal(MODALS.REPOST, { uri })}
|
|
||||||
/>
|
|
||||||
{claim.meta.reposted > 0 && (
|
|
||||||
<Button
|
<Button
|
||||||
button="alt"
|
button="alt"
|
||||||
label={claim.meta.reposted}
|
icon={ICONS.REPOST}
|
||||||
|
label={__('Repost')}
|
||||||
requiresAuth={IS_WEB}
|
requiresAuth={IS_WEB}
|
||||||
navigate={`/$/${PAGES.DISCOVER}?${CS.REPOSTED_URI_KEY}=${encodeURIComponent(uri)}`}
|
onClick={() => openModal(MODALS.REPOST, { uri })}
|
||||||
/>
|
/>
|
||||||
)}
|
{claim.meta.reposted > 0 && (
|
||||||
</div>
|
<Button
|
||||||
|
button="alt"
|
||||||
|
label={claim.meta.reposted}
|
||||||
|
requiresAuth={IS_WEB}
|
||||||
|
navigate={`/$/${PAGES.DISCOVER}?${CS.REPOSTED_URI_KEY}=${encodeURIComponent(uri)}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<ClaimSupportButton uri={uri} />
|
<ClaimSupportButton uri={uri} />
|
||||||
</ActionWrapper>
|
</ActionWrapper>
|
||||||
|
|
||||||
<ActionWrapper>
|
<ActionWrapper>
|
||||||
<FileDownloadLink uri={uri} />
|
{!SIMPLE_SITE && <FileDownloadLink uri={uri} />}
|
||||||
|
|
||||||
{claimIsMine && (
|
{claimIsMine && (
|
||||||
<Button
|
<Button
|
||||||
|
@ -108,7 +111,7 @@ function FileActions(props: Props) {
|
||||||
onClick={() => openModal(MODALS.CONFIRM_FILE_REMOVE, { uri })}
|
onClick={() => openModal(MODALS.CONFIRM_FILE_REMOVE, { uri })}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!claimIsMine && (
|
{!claimIsMine && !SIMPLE_SITE && (
|
||||||
<Button
|
<Button
|
||||||
title={__('Report content')}
|
title={__('Report content')}
|
||||||
button="alt"
|
button="alt"
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { makeSelectClaimForUri, makeSelectPendingAmountByUri } from 'lbry-redux';
|
import { makeSelectClaimForUri, makeSelectPendingAmountByUri, makeSelectClaimIsMine } from 'lbry-redux';
|
||||||
import FileSubtitle from './view';
|
import FileSubtitle from './view';
|
||||||
|
|
||||||
const select = (state, props) => ({
|
const select = (state, props) => ({
|
||||||
claim: makeSelectClaimForUri(props.uri)(state),
|
claim: makeSelectClaimForUri(props.uri)(state),
|
||||||
pendingAmount: makeSelectPendingAmountByUri(props.uri)(state),
|
pendingAmount: makeSelectPendingAmountByUri(props.uri)(state),
|
||||||
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||||
});
|
});
|
||||||
export default connect(select)(FileSubtitle);
|
export default connect(select)(FileSubtitle);
|
||||||
|
|
|
@ -1,29 +1,41 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
import { SIMPLE_SITE } from 'config';
|
||||||
|
import * as ICONS from 'constants/icons';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import DateTime from 'component/dateTime';
|
import DateTime from 'component/dateTime';
|
||||||
import FileViewCount from 'component/fileViewCount';
|
import FileViewCount from 'component/fileViewCount';
|
||||||
import CreditAmount from 'component/common/credit-amount';
|
import CreditAmount from 'component/common/credit-amount';
|
||||||
|
import HelpLink from 'component/common/help-link';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
uri: string,
|
uri: string,
|
||||||
claim: StreamClaim,
|
claim: StreamClaim,
|
||||||
pendingAmount: string,
|
pendingAmount: string,
|
||||||
|
claimIsMine: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
function FileSubtitle(props: Props) {
|
function FileSubtitle(props: Props) {
|
||||||
const { uri, claim, pendingAmount } = props;
|
const { uri, claim, pendingAmount, claimIsMine } = props;
|
||||||
|
const claimId = claim && claim.claim_id;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="media__subtitle--between">
|
<div className="media__subtitle--between">
|
||||||
<DateTime uri={uri} show={DateTime.SHOW_DATE} />
|
<DateTime uri={uri} show={DateTime.SHOW_DATE} />
|
||||||
<span>
|
<span>
|
||||||
<CreditAmount
|
{!SIMPLE_SITE && (
|
||||||
badge={false}
|
<>
|
||||||
amount={parseFloat(claim.amount) + parseFloat(pendingAmount || claim.meta.support_amount)}
|
<CreditAmount
|
||||||
precision={2}
|
badge={false}
|
||||||
/>
|
amount={parseFloat(claim.amount) + parseFloat(pendingAmount || claim.meta.support_amount)}
|
||||||
{' • ' /* this is bad, but it's quick! */}
|
precision={2}
|
||||||
|
/>
|
||||||
|
{' • ' /* this is bad, but it's quick! */}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<FileViewCount uri={uri} />
|
<FileViewCount uri={uri} />
|
||||||
|
{claimId && !claimIsMine && SIMPLE_SITE && (
|
||||||
|
<HelpLink description={__('Report content')} icon={ICONS.REPORT} href={`https://lbry.com/dmca/${claimId}`} />
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue