Merge branch 'master' into markdown-fix

This commit is contained in:
Baltazar Gomez 2018-05-08 11:55:05 -06:00 committed by GitHub
commit cd769856fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 57 additions and 80 deletions

View file

@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
### Changed
* Add flair to snackbar ([#1313](https://github.com/lbryio/lbry-app/pull/1313))
* Made font in price badge larger ([#1420](https://github.com/lbryio/lbry-app/pull/1420))
### Fixed
* Fix content-type not shown correctly in file description ([#863](https://github.com/lbryio/lbry-app/pull/863))
@ -24,10 +25,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
* Fix dark theme ([#1034](https://github.com/lbryio/lbry-app/issues/1034))
* Fix download percentage indicator overlay ([#1271](https://github.com/lbryio/lbry-app/issues/1271))
* Fix alternate row shading for transactions on dark theme ([#1355](https://github.com/lbryio/lbry-app/issues/#1355))
* Fix Description box on Publish (dark theme) ([#1356](https://github.com/lbryio/lbry-app/issues/#1356))
* Fix don't allow dark mode with automatic night mode enabled ([#1005](https://github.com/lbryio/lbry-app/issues/1005))
* Fix description box on Publish (dark theme) ([#1356](https://github.com/lbryio/lbry-app/issues/#1356))
* Fix price wrapping in price badge ([#1420](https://github.com/lbryio/lbry-app/pull/1420))
* Fix spacing in search suggestions ([#1422](https://github.com/lbryio/lbry-app/pull/1422))
* Fix text/HTML files don't display correctly in-app anymore ([#1379](https://github.com/lbryio/lbry-app/issues/1379)
* Fix markdown render ([#1179](https://github.com/lbryio/lbry-app/issues/1179)
* Fix text/HTML files don't display correctly in-app anymore ([#1379](https://github.com/lbryio/lbry-app/issues/1379))
* Fix markdown render ([#1179](https://github.com/lbryio/lbry-app/issues/1179))
## [0.21.3] - 2018-04-23

View file

@ -2,7 +2,7 @@
import React from 'react';
import Button from 'component/button';
import FileDownloadLink from 'component/fileDownloadLink';
import * as modals from 'constants/modal_types';
import { MODALS } from 'lbry-redux';
import classnames from 'classnames';
import * as icons from 'constants/icons';
@ -33,7 +33,7 @@ class FileActions extends React.PureComponent<Props> {
className="btn--file-actions"
icon={icons.TRASH}
description={__('Delete')}
onClick={() => openModal({ id: modals.CONFIRM_FILE_REMOVE }, { uri })}
onClick={() => openModal({ id: MODALS.CONFIRM_FILE_REMOVE }, { uri })}
/>
)}
{!claimIsMine && (

View file

@ -1,10 +1,9 @@
import * as React from 'react';
import { Lbry } from 'lbry-redux';
import { Lbry, MODALS } from 'lbry-redux';
import LoadScreen from './internal/load-screen';
import ModalIncompatibleDaemon from 'modal/modalIncompatibleDaemon';
import ModalUpgrade from 'modal/modalUpgrade';
import ModalDownloading from 'modal/modalDownloading';
import * as modals from 'constants/modal_types';
type Props = {
checkDaemonVersion: () => Promise<any>,
@ -115,9 +114,9 @@ export class SplashScreen extends React.PureComponent<Props, State> {
in the modals won't work. */}
{isRunning && (
<React.Fragment>
{notificationId === modals.INCOMPATIBLE_DAEMON && <ModalIncompatibleDaemon />}
{notificationId === modals.UPGRADE && <ModalUpgrade />}
{notificationId === modals.DOWNLOADING && <ModalDownloading />}
{notificationId === MODALS.INCOMPATIBLE_DAEMON && <ModalIncompatibleDaemon />}
{notificationId === MODALS.UPGRADE && <ModalUpgrade />}
{notificationId === MODALS.DOWNLOADING && <ModalDownloading />}
</React.Fragment>
)}
</React.Fragment>

View file

@ -1,6 +1,6 @@
// @flow
import React from 'react';
import * as modals from 'constants/modal_types';
import { MODALS } from 'lbry-redux';
import * as icons from 'constants/icons';
import Button from 'component/button';
import type { Subscription } from 'redux/reducers/subscriptions';
@ -42,7 +42,7 @@ export default (props: Props) => {
label={subscriptionLabel}
onClick={() => {
if (!subscriptions.length) {
doNotify({ id: modals.FIRST_SUBSCRIPTION });
doNotify({ id: MODALS.FIRST_SUBSCRIPTION });
}
subscriptionHandler({
channelName,

View file

@ -4,7 +4,7 @@ import { FormField } from 'component/common/form';
import Button from 'component/button';
import FileExporter from 'component/common/file-exporter';
import * as icons from 'constants/icons';
import * as modals from 'constants/modal_types';
import { MODALS } from 'lbry-redux';
import TransactionListItem from './internal/transaction-list-item';
export type Transaction = {
@ -65,7 +65,7 @@ class TransactionList extends React.PureComponent<Props, State> {
}
revokeClaim(txid: string, nout: number) {
this.props.openModal({ id: modals.CONFIRM_CLAIM_REVOKE }, { txid, nout });
this.props.openModal({ id: MODALS.CONFIRM_CLAIM_REVOKE }, { txid, nout });
}
render() {

View file

@ -8,8 +8,7 @@ import {
selectIdentityVerifyErrorMessage,
} from 'redux/selectors/user';
import UserVerify from './view';
import { doNotify } from 'lbry-redux';
import { PHONE_COLLECTION } from 'constants/modal_types';
import { doNotify, MODALS } from 'lbry-redux';
const select = (state, props) => {
const selectReward = makeSelectRewardByType();
@ -24,7 +23,7 @@ const select = (state, props) => {
const perform = dispatch => ({
navigate: uri => dispatch(doNavigate(uri)),
verifyUserIdentity: token => dispatch(doUserIdentityVerify(token)),
verifyPhone: () => dispatch(doNotify({ id: PHONE_COLLECTION })),
verifyPhone: () => dispatch(doNotify({ id: MODALS.PHONE_COLLECTION })),
});
export default connect(select, perform)(UserVerify);

View file

@ -1,11 +1,10 @@
import * as MODALS from 'constants/modal_types';
import { connect } from 'react-redux';
import { normalizeURI } from 'lbry-redux';
import {
selectSearchState as selectSearch,
selectWunderBarAddress,
doUpdateSearchQuery,
doNotify,
MODALS,
} from 'lbry-redux';
import { doNavigate } from 'redux/actions/navigation';
import Wunderbar from './view';

View file

@ -1,22 +0,0 @@
export const CONFIRM_FILE_REMOVE = 'confirm_file_remove';
export const INCOMPATIBLE_DAEMON = 'incompatible_daemon';
export const FILE_TIMEOUT = 'file_timeout';
export const DOWNLOADING = 'downloading';
export const AUTO_UPDATE_DOWNLOADED = 'auto_update_downloaded';
export const AUTO_UPDATE_CONFIRM = 'auto_update_confirm';
export const ERROR = 'error';
export const INSUFFICIENT_CREDITS = 'insufficient_credits';
export const UPGRADE = 'upgrade';
export const WELCOME = 'welcome';
export const EMAIL_COLLECTION = 'email_collection';
export const PHONE_COLLECTION = 'phone_collection';
export const FIRST_REWARD = 'first_reward';
export const AUTHENTICATION_FAILURE = 'auth_failure';
export const TRANSACTION_FAILED = 'transaction_failed';
export const REWARD_APPROVAL_REQUIRED = 'reward_approval_required';
export const AFFIRM_PURCHASE = 'affirm_purchase';
export const CONFIRM_CLAIM_REVOKE = 'confirm_claim_revoke';
export const FIRST_SUBSCRIPTION = 'firstSubscription';
export const SEND_TIP = 'send_tip';
export const PUBLISH = 'publish';
export const SEARCH = 'search';

View file

@ -1,4 +1,5 @@
import React from 'react';
import { MODALS } from 'lbry-redux';
import ModalError from 'modal/modalError';
import ModalAuthFailure from 'modal/modalAuthFailure';
import ModalDownloading from 'modal/modalDownloading';
@ -20,7 +21,6 @@ import ModalFirstSubscription from 'modal/modalFirstSubscription';
import ModalSendTip from '../modalSendTip';
import ModalPublish from '../modalPublish';
import ModalSearch from '../modalSearch';
import * as modals from 'constants/modal_types';
class ModalRouter extends React.PureComponent {
constructor(props) {
@ -68,7 +68,7 @@ class ModalRouter extends React.PureComponent {
checkShowWelcome(props) {
const { isWelcomeAcknowledged, user } = props;
if (!isWelcomeAcknowledged && user && !user.is_reward_approved && !user.is_identity_verified) {
return modals.WELCOME;
return MODALS.WELCOME;
}
}
@ -80,7 +80,7 @@ class ModalRouter extends React.PureComponent {
user &&
!user.has_verified_email
) {
return modals.EMAIL_COLLECTION;
return MODALS.EMAIL_COLLECTION;
}
}
@ -92,7 +92,7 @@ class ModalRouter extends React.PureComponent {
!isCreditIntroAcknowledged &&
(['send', 'publish'].includes(page) || this.isPaidShowPage(props))
) {
return modals.INSUFFICIENT_CREDITS;
return MODALS.INSUFFICIENT_CREDITS;
}
}
@ -113,47 +113,47 @@ class ModalRouter extends React.PureComponent {
}
switch (notification.id) {
case modals.UPGRADE:
case MODALS.UPGRADE:
return <ModalUpgrade {...notificationProps} />;
case modals.DOWNLOADING:
case MODALS.DOWNLOADING:
return <ModalDownloading {...notificationProps} />;
case modals.AUTO_UPDATE_DOWNLOADED:
case MODALS.AUTO_UPDATE_DOWNLOADED:
return <ModalAutoUpdateDownloaded {...notificationProps} />;
case modals.AUTO_UPDATE_CONFIRM:
case MODALS.AUTO_UPDATE_CONFIRM:
return <ModalAutoUpdateConfirm {...notificationProps} />;
case modals.ERROR:
case MODALS.ERROR:
return <ModalError {...notificationProps} />;
case modals.FILE_TIMEOUT:
case MODALS.FILE_TIMEOUT:
return <ModalFileTimeout {...notificationProps} />;
case modals.INSUFFICIENT_CREDITS:
case MODALS.INSUFFICIENT_CREDITS:
return <ModalCreditIntro {...notificationProps} />;
case modals.WELCOME:
case MODALS.WELCOME:
return <ModalWelcome {...notificationProps} />;
case modals.FIRST_REWARD:
case MODALS.FIRST_REWARD:
return <ModalFirstReward {...notificationProps} />;
case modals.AUTHENTICATION_FAILURE:
case MODALS.AUTHENTICATION_FAILURE:
return <ModalAuthFailure {...notificationProps} />;
case modals.TRANSACTION_FAILED:
case MODALS.TRANSACTION_FAILED:
return <ModalTransactionFailed {...notificationProps} />;
case modals.REWARD_APPROVAL_REQUIRED:
case MODALS.REWARD_APPROVAL_REQUIRED:
return <ModalRewardApprovalRequired {...notificationProps} />;
case modals.CONFIRM_FILE_REMOVE:
case MODALS.CONFIRM_FILE_REMOVE:
return <ModalRemoveFile {...notificationProps} />;
case modals.AFFIRM_PURCHASE:
case MODALS.AFFIRM_PURCHASE:
return <ModalAffirmPurchase {...notificationProps} />;
case modals.CONFIRM_CLAIM_REVOKE:
case MODALS.CONFIRM_CLAIM_REVOKE:
return <ModalRevokeClaim {...notificationProps} />;
case modals.PHONE_COLLECTION:
case MODALS.PHONE_COLLECTION:
return <ModalPhoneCollection {...notificationProps} />;
case modals.EMAIL_COLLECTION:
case MODALS.EMAIL_COLLECTION:
return <ModalEmailCollection {...notificationProps} />;
case modals.FIRST_SUBSCRIPTION:
case MODALS.FIRST_SUBSCRIPTION:
return <ModalFirstSubscription {...notificationProps} />;
case modals.SEND_TIP:
case MODALS.SEND_TIP:
return <ModalSendTip {...notificationProps} />;
case modals.PUBLISH:
case MODALS.PUBLISH:
return <ModalPublish {...notificationProps} />;
case modals.SEARCH:
case MODALS.SEARCH:
return <ModalSearch {...notificationProps} />;
default:
return null;

View file

@ -1,6 +1,6 @@
// @flow
import * as React from 'react';
import { Lbry, buildURI, normalizeURI } from 'lbry-redux';
import { Lbry, buildURI, normalizeURI, MODALS } from 'lbry-redux';
import Video from 'component/video';
import Thumbnail from 'component/common/thumbnail';
import FilePrice from 'component/filePrice';
@ -14,7 +14,6 @@ import Button from 'component/button';
import SubscribeButton from 'component/subscribeButton';
import Page from 'component/page';
import player from 'render-media';
import * as modals from 'constants/modal_types';
type Props = {
claim: {
@ -171,7 +170,7 @@ class FilePage extends React.Component<Props> {
button="alt"
iconRight="Send"
label={__('Enjoy this? Send a tip')}
onClick={() => openModal({ id: modals.SEND_TIP }, { uri })}
onClick={() => openModal({ id: MODALS.SEND_TIP }, { uri })}
/>
<SubscribeButton uri={subscriptionUri} channelName={channelName} />
</React.Fragment>

View file

@ -141,6 +141,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
} = this.props;
const noDaemonSettings = !daemonSettings || Object.keys(daemonSettings).length === 0;
const isDarkModeEnabled = currentTheme === 'dark';
return (
<Page>
@ -294,6 +295,7 @@ class SettingsPage extends React.PureComponent<Props, State> {
name="automatic_dark_mode"
onChange={e => this.onAutomaticDarkModeChange(e.target.checked)}
checked={automaticDarkModeEnabled}
disabled={isDarkModeEnabled}
postfix={__('Automatic dark mode (9pm to 8am)')}
/>
</section>

View file

@ -1,7 +1,6 @@
import { execSync } from 'child_process';
import isDev from 'electron-is-dev';
import path from 'path';
import * as MODALS from 'constants/modal_types';
import { ipcRenderer, remote } from 'electron';
import {
ACTIONS,
@ -10,6 +9,7 @@ import {
doFetchFileInfosAndPublishedClaims,
doNotify,
selectNotification,
MODALS,
} from 'lbry-redux';
import Native from 'native';
import { doFetchRewardedContent } from 'redux/actions/content';

View file

@ -1,8 +1,6 @@
import * as MODALS from 'constants/modal_types';
import * as NOTIFICATION_TYPES from 'constants/notification_types';
import { ipcRenderer } from 'electron';
import Lbryio from 'lbryio';
import { doNotify } from 'lbry-redux';
import { doAlertError } from 'redux/actions/app';
import { doClaimEligiblePurchaseRewards } from 'redux/actions/rewards';
import { doNavigate } from 'redux/actions/navigation';
@ -27,6 +25,8 @@ import {
selectDownloadingByOutpoint,
selectTotalDownloadProgress,
selectBalance,
MODALS,
doNotify,
} from 'lbry-redux';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import setBadge from 'util/setBadge';

View file

@ -1,6 +1,5 @@
// @flow
import * as MODALS from 'constants/modal_types';
import { ACTIONS, Lbry, selectMyClaimsWithoutChannels, doNotify } from 'lbry-redux';
import { ACTIONS, Lbry, selectMyClaimsWithoutChannels, doNotify, MODALS } from 'lbry-redux';
import { selectPendingPublishes } from 'redux/selectors/publish';
import type {
UpdatePublishFormData,

View file

@ -1,5 +1,5 @@
import * as ACTIONS from 'constants/action_types';
import * as MODALS from 'constants/modal_types';
import { MODALS } from 'lbry-redux';
import Lbryio from 'lbryio';
import { selectUnclaimedRewardsByType } from 'redux/selectors/rewards';
import { selectUserIsRewardApproved } from 'redux/selectors/user';

View file

@ -1,7 +1,6 @@
import * as ACTIONS from 'constants/action_types';
import * as MODALS from 'constants/modal_types';
import Lbryio from 'lbryio';
import { doNotify } from 'lbry-redux';
import { doNotify, MODALS } from 'lbry-redux';
import { doClaimRewardType, doRewardList } from 'redux/actions/rewards';
import {
selectEmailToVerify,

View file

@ -1,7 +1,7 @@
// @flow
import * as ACTIONS from 'constants/action_types';
import * as MODALS from 'constants/modal_types';
import { MODALS } from 'lbry-redux';
import { remote } from 'electron';

View file

@ -252,10 +252,10 @@ p {
}
.credit-amount {
padding: 5px;
border-radius: 5px;
font-family: 'metropolis-bold';
font-size: 8px;
font-size: 10px;
padding: 5px;
}
.credit-amount--large {