add helplbrysavecrypto prompt and fix file page UI bugs

This commit is contained in:
Sean Yesmunt 2021-03-30 12:00:30 -04:00
parent 3cdeb98ea8
commit 21ad5077f7
5 changed files with 93 additions and 55 deletions

View file

@ -197,7 +197,7 @@ function Comment(props: Props) {
{!author ? ( {!author ? (
<span className="comment__author">{__('Anonymous')}</span> <span className="comment__author">{__('Anonymous')}</span>
) : ( ) : (
<UriIndicator link external={livestream} uri={authorUri} /> <UriIndicator className="comment__author" link external={livestream} uri={authorUri} />
)} )}
{!livestream && ( {!livestream && (
<Button <Button

View file

@ -12,6 +12,7 @@ import I18nMessage from 'component/i18nMessage';
import Button from 'component/button'; import Button from 'component/button';
import * as PAGES from 'constants/pages'; import * as PAGES from 'constants/pages';
import FileDescription from 'component/fileDescription'; import FileDescription from 'component/fileDescription';
import usePersistedState from 'effects/use-persisted-state';
type Props = { type Props = {
uri: string, uri: string,
@ -25,8 +26,22 @@ type Props = {
function FileTitleSection(props: Props) { function FileTitleSection(props: Props) {
const { title, uri, nsfw, isNsfwBlocked, livestream = false, activeViewers, stateOfViewers } = props; const { title, uri, nsfw, isNsfwBlocked, livestream = false, activeViewers, stateOfViewers } = props;
const [hasAcknowledgedSec, setHasAcknowledgedSec] = usePersistedState('sec-nag', false);
return ( 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 SEC doesnt understand blockchain. The claims made in SEC vs. LBRY would destroy the United States cryptocurrency industry.'
)}{' '}
<Button label={__('Learn more')} button="link" href="https://helplbrysavecrypto.com" />
</p>
</div>
)}
<Card <Card
isPageTitle isPageTitle
noTitleWrap noTitleWrap
@ -44,7 +59,12 @@ function FileTitleSection(props: Props) {
body={ body={
<React.Fragment> <React.Fragment>
<ClaimInsufficientCredits uri={uri} /> <ClaimInsufficientCredits uri={uri} />
<FileSubtitle uri={uri} livestream={livestream} activeViewers={activeViewers} stateOfViewers={stateOfViewers} /> <FileSubtitle
uri={uri}
livestream={livestream}
activeViewers={activeViewers}
stateOfViewers={stateOfViewers}
/>
</React.Fragment> </React.Fragment>
} }
actions={ actions={
@ -74,6 +94,7 @@ function FileTitleSection(props: Props) {
) )
} }
/> />
</>
); );
} }

View file

@ -18,6 +18,7 @@ type Props = {
children: ?Node, children: ?Node,
inline: boolean, inline: boolean,
external?: boolean, external?: boolean,
className?: string,
}; };
class UriIndicator extends React.PureComponent<Props> { class UriIndicator extends React.PureComponent<Props> {
@ -38,7 +39,16 @@ class UriIndicator extends React.PureComponent<Props> {
}; };
render() { render() {
const { link, isResolvingUri, claim, children, inline, hideAnonymous = false, external = false } = this.props; const {
link,
isResolvingUri,
claim,
children,
inline,
hideAnonymous = false,
external = false,
className,
} = this.props;
if (!claim) { if (!claim) {
return <span className="empty">{isResolvingUri ? 'Validating...' : 'Unused'}</span>; return <span className="empty">{isResolvingUri ? 'Validating...' : 'Unused'}</span>;
@ -52,7 +62,7 @@ class UriIndicator extends React.PureComponent<Props> {
} }
return ( return (
<span dir="auto" className={classnames('channel-name', { 'channel-name--inline': inline })}> <span dir="auto" className={classnames('channel-name', className, { 'channel-name--inline': inline })}>
Anonymous Anonymous
</span> </span>
); );
@ -76,13 +86,17 @@ class UriIndicator extends React.PureComponent<Props> {
if (children) { if (children) {
return ( return (
<Button target={external ? '_blank' : undefined} navigate={channelLink}> <Button className={className} target={external ? '_blank' : undefined} navigate={channelLink}>
{children} {children}
</Button> </Button>
); );
} else { } else {
return ( return (
<Button className="button--uri-indicator" navigate={channelLink} target={external ? '_blank' : undefined}> <Button
className={classnames(className, 'button--uri-indicator')}
navigate={channelLink}
target={external ? '_blank' : undefined}
>
{inner} {inner}
</Button> </Button>
); );

View file

@ -111,17 +111,15 @@
width: 35rem; width: 35rem;
margin-left: var(--spacing-m); margin-left: var(--spacing-m);
@media (max-width: $breakpoint-small) {
margin-left: 0;
}
@media (max-width: $breakpoint-medium) { @media (max-width: $breakpoint-medium) {
width: 100%; width: 100%;
margin-left: 0;
margin-top: var(--spacing-l); margin-top: var(--spacing-l);
} }
} }
@media (max-width: $breakpoint-medium) { @media (max-width: $breakpoint-medium) {
flex-direction: column;
> :first-child { > :first-child {
margin-right: 0; margin-right: 0;
} }

View file

@ -366,9 +366,14 @@ textarea {
} }
.notice-message { .notice-message {
position: relative;
border-radius: var(--border-radius); border-radius: var(--border-radius);
padding: var(--spacing-l); padding: var(--spacing-l);
background-color: var(--color-primary-alt); background-color: var(--color-primary-alt);
~ .card {
margin-top: var(--spacing-m);
}
} }
.notice-message--loud { .notice-message--loud {