lbry-desktop/ui/component/fileTitleSection/view.jsx

95 lines
3.1 KiB
React
Raw Normal View History

2021-03-11 18:08:11 +01:00
// @flow
import * as React from 'react';
import { normalizeURI } from 'lbry-redux';
import FilePrice from 'component/filePrice';
import ClaimInsufficientCredits from 'component/claimInsufficientCredits';
import FileSubtitle from 'component/fileSubtitle';
wip wip wip - everything but publish, autoplay, and styling collection publishing add channel to collection publish cleanup wip bump clear mass add after success move collection item management controls redirect replace to published collection id bump playlist selector on create bump use new collection add ui element bump wip gitignore add content json wip bump context add to playlist basic collections page style pass wip wip: edits, buttons, styles... change fileAuthor to claimAuthor update, pending bugfixes, delete modal progress, collection header, other bugfixes bump cleaning show page bugfix builtin collection headers no playlists, no grid title wip style tweaks use normal looking claim previews for collection tiles add collection changes style library previews collection menulist for delete/view on library delete modal works for unpublished rearrange collection publish tabs clean up collection publishing and items show on odysee begin collectoin edit header and css renaming better thumbnails bump fix collection publish redirect view collection in menu does something copy and thumbs list previews, pending, context menus, list page enter to add collection, lists page empty state playable lists only, delete feature, bump put fileListDownloaded back better collection titles improve collection claim details fix horiz more icon fix up channel page style, copy, bump refactor preview overlay properties, fix reposts showing as floppydisk add watch later toast, small overlay properties on wunderbar results, fix collection actions buttons bump cleanup cleaning, refactoring bump preview thumb styling, cleanup support discover page lists search sync, bump bump, fix sync more enforce builtin order for now new lists page empty state try to indicate unpublished edits in lists bump fix autoplay and linting consts, fix autoplay bugs fixes cleanup fix, bump lists experimental ui, fixes refactor listIndex out hack in collection fallback thumb bump
2021-02-06 08:03:51 +01:00
import ClaimAuthor from 'component/claimAuthor';
2021-03-11 18:08:11 +01:00
import Card from 'component/common/card';
import * as ICONS from 'constants/icons';
import Icon from 'component/common/icon';
import I18nMessage from 'component/i18nMessage';
import Button from 'component/button';
import * as PAGES from 'constants/pages';
import FileDescription from 'component/fileDescription';
import usePersistedState from 'effects/use-persisted-state';
2021-03-11 18:08:11 +01:00
type Props = {
uri: string,
title: string,
nsfw: boolean,
isNsfwBlocked: boolean,
2021-03-18 18:21:49 +01:00
livestream?: boolean,
isLive?: boolean,
2021-06-17 20:55:23 +02:00
viewers?: number,
2021-03-11 18:08:11 +01:00
};
function FileTitleSection(props: Props) {
2021-06-17 20:55:23 +02:00
const { title, uri, nsfw, isNsfwBlocked, livestream = false, isLive = false, viewers } = props;
const [hasAcknowledgedSec, setHasAcknowledgedSec] = usePersistedState('sec-nag', false);
2021-03-11 18:08:11 +01:00
return (
<>
{!hasAcknowledgedSec && (
<div className="notice-message">
<Button button="close" icon={ICONS.REMOVE} onClick={() => setHasAcknowledgedSec(true)} />
<h1 className="section__title">{__('Help LBRY Save Crypto')}</h1>
<p className="section__subtitle">
{__('The US government is attempting to destroy the cryptocurrency industry. Can you help?')}{' '}
2021-04-02 20:39:32 +02:00
<Button label={__('Learn more and sign petition')} button="link" href="https://helplbrysavecrypto.com" />
</p>
</div>
)}
<Card
isPageTitle
noTitleWrap
title={
<React.Fragment>
{title}
{nsfw && (
<span className="media__title-badge">
<span className="badge badge--tag-mature">{__('Mature')}</span>
</span>
)}
</React.Fragment>
}
titleActions={<FilePrice uri={normalizeURI(uri)} type="filepage" />}
body={
<React.Fragment>
<ClaimInsufficientCredits uri={uri} />
2021-06-17 20:55:23 +02:00
<FileSubtitle uri={uri} isLive={isLive} livestream={livestream} activeViewers={viewers} />
</React.Fragment>
}
actions={
isNsfwBlocked ? (
<div className="main--empty">
<h2>
<Icon className="icon--hidden" icon={ICONS.EYE_OFF} />
{__('Mature content blocked.')}
</h2>
<div>
<I18nMessage
tokens={{
content_settings: (
<Button button="link" label={__('content settings')} navigate={`/$/${PAGES.SETTINGS}`} />
),
}}
>
Change this in your %content_settings%.
</I18nMessage>
</div>
2021-03-11 18:08:11 +01:00
</div>
) : (
<div className="section">
wip wip wip - everything but publish, autoplay, and styling collection publishing add channel to collection publish cleanup wip bump clear mass add after success move collection item management controls redirect replace to published collection id bump playlist selector on create bump use new collection add ui element bump wip gitignore add content json wip bump context add to playlist basic collections page style pass wip wip: edits, buttons, styles... change fileAuthor to claimAuthor update, pending bugfixes, delete modal progress, collection header, other bugfixes bump cleaning show page bugfix builtin collection headers no playlists, no grid title wip style tweaks use normal looking claim previews for collection tiles add collection changes style library previews collection menulist for delete/view on library delete modal works for unpublished rearrange collection publish tabs clean up collection publishing and items show on odysee begin collectoin edit header and css renaming better thumbnails bump fix collection publish redirect view collection in menu does something copy and thumbs list previews, pending, context menus, list page enter to add collection, lists page empty state playable lists only, delete feature, bump put fileListDownloaded back better collection titles improve collection claim details fix horiz more icon fix up channel page style, copy, bump refactor preview overlay properties, fix reposts showing as floppydisk add watch later toast, small overlay properties on wunderbar results, fix collection actions buttons bump cleanup cleaning, refactoring bump preview thumb styling, cleanup support discover page lists search sync, bump bump, fix sync more enforce builtin order for now new lists page empty state try to indicate unpublished edits in lists bump fix autoplay and linting consts, fix autoplay bugs fixes cleanup fix, bump lists experimental ui, fixes refactor listIndex out hack in collection fallback thumb bump
2021-02-06 08:03:51 +01:00
<ClaimAuthor uri={uri} />
<FileDescription uri={uri} />
</div>
)
}
/>
</>
2021-03-11 18:08:11 +01:00
);
}
export default FileTitleSection;