update modal / message / styles

This commit is contained in:
btzr-io 2018-05-09 20:47:08 -06:00
parent 481f85cd02
commit 31b1494a5e
6 changed files with 25 additions and 20 deletions

View file

@ -95,6 +95,7 @@ class Button extends React.PureComponent<Props> {
</a> </a>
) : ( ) : (
<button <button
title={title}
aria-label={description || label || title} aria-label={description || label || title}
className={combinedClassName} className={combinedClassName}
onClick={extendedOnClick} onClick={extendedOnClick}

View file

@ -1,4 +1,3 @@
import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { doNotify } from 'lbry-redux'; import { doNotify } from 'lbry-redux';
import ExternalLink from './view'; import ExternalLink from './view';

View file

@ -1,5 +1,5 @@
// @flow // @flow
import React from 'react'; import * as React from 'react';
import { MODALS } from 'lbry-redux'; import { MODALS } from 'lbry-redux';
import Button from 'component/button'; import Button from 'component/button';
@ -7,7 +7,7 @@ type Props = {
href?: string, href?: string,
title?: string, title?: string,
children: React.Node, children: React.Node,
openModal: string => void, openModal: ({ id: string }, { url: string }) => void,
}; };
class ExternalLink extends React.PureComponent<Props> { class ExternalLink extends React.PureComponent<Props> {
@ -20,6 +20,7 @@ class ExternalLink extends React.PureComponent<Props> {
return href ? ( return href ? (
<Button <Button
button="link" button="link"
className="btn--external-link"
title={title} title={title}
onClick={() => openModal({ id: MODALS.CONFIRM_EXTERNAL_LINK }, { url: href })} onClick={() => openModal({ id: MODALS.CONFIRM_EXTERNAL_LINK }, { url: href })}
> >

View file

@ -2,10 +2,8 @@ import { connect } from 'react-redux';
import { doHideNotification } from 'lbry-redux'; import { doHideNotification } from 'lbry-redux';
import ModalOpenExternalLink from './view'; import ModalOpenExternalLink from './view';
const select = () => ({});
const perform = dispatch => ({ const perform = dispatch => ({
closeModal: () => dispatch(doHideNotification()), closeModal: () => dispatch(doHideNotification()),
}); });
export default connect(select, perform)(ModalOpenExternalLink); export default connect(null, perform)(ModalOpenExternalLink);

View file

@ -10,9 +10,12 @@ type Props = {
class ModalOpenExternalLink extends React.PureComponent<Props> { class ModalOpenExternalLink extends React.PureComponent<Props> {
openExternalLink() { openExternalLink() {
const { url } = this.props; const { url, closeModal } = this.props;
const { openExternal } = shell; const { openExternal } = shell;
openExternal(url); if (url) {
openExternal(url);
}
closeModal();
} }
render() { render() {
@ -23,13 +26,16 @@ class ModalOpenExternalLink extends React.PureComponent<Props> {
contentLabel={__('Confirm External Link')} contentLabel={__('Confirm External Link')}
type="confirm" type="confirm"
confirmButtonLabel={__('Continue')} confirmButtonLabel={__('Continue')}
onConfirmed={() => this.openExternalLink(url)} onConfirmed={() => this.openExternalLink()}
onAborted={closeModal} onAborted={closeModal}
> >
<h1>Warning!</h1>
<p>{__('This link leads to an external website.')}</p>
<blockquote>{url}</blockquote>
<p> <p>
{__('This link leads to an external website:')} {__(
<cite>{url}</cite> 'LBRY Inc is not responsible for its content, click continue to proceed at your own risk.'
{__('LBRY Inc is not responsible for its content, click OK to proceed at your own risk.')} )}
</p> </p>
</Modal> </Modal>
); );

View file

@ -8,14 +8,6 @@
margin: 16px 0; margin: 16px 0;
} }
.markdown-preview blockquote {
padding: 8px;
margin: 16px 0;
color: var(--color-help);
border-left: 2px solid var(--color-help);
background-color: var(--color-bg-alt);
}
.markdown-preview table { .markdown-preview table {
padding: 8px; padding: 8px;
margin: 16px 0; margin: 16px 0;
@ -48,3 +40,11 @@
.markdown-preview del { .markdown-preview del {
color: var(--color-help); color: var(--color-help);
} }
blockquote {
padding: 8px;
margin: 16px 0;
color: var(--color-help);
border-left: 2px solid var(--color-help);
background-color: var(--color-bg-alt);
}