[redesign] groundwork

This commit is contained in:
Sean Yesmunt 2018-01-22 17:21:43 -08:00
parent b461c684b1
commit 5c3088d5ef
7 changed files with 1167 additions and 883 deletions

View file

@ -49,7 +49,6 @@ class FileCard extends React.PureComponent<Props> {
rewardedContentClaimIds, rewardedContentClaimIds,
obscureNsfw, obscureNsfw,
} = this.props; } = this.props;
const uri = normalizeURI(this.props.uri); const uri = normalizeURI(this.props.uri);
const title = metadata && metadata.title ? metadata.title : uri; const title = metadata && metadata.title ? metadata.title : uri;
const thumbnail = metadata && metadata.thumbnail ? metadata.thumbnail : null; const thumbnail = metadata && metadata.thumbnail ? metadata.thumbnail : null;

View file

@ -2,8 +2,8 @@
import React from 'react'; import React from 'react';
import Button from 'component/link'; import Button from 'component/link';
import { buildURI } from 'lbryURI'; import { buildURI } from 'lbryURI';
import { Icon } from 'component/common';
import classnames from 'classnames'; import classnames from 'classnames';
import Icon from 'component/common/icon';
type Props = { type Props = {
isResolvingUri: boolean, isResolvingUri: boolean,
@ -69,6 +69,14 @@ class UriIndicator extends React.PureComponent<Props> {
modifier = 'invalid'; modifier = 'invalid';
} }
// {!signatureIsValid ? (
// <Icon
// icon={icon}
// className={`channel-indicator__icon channel-indicator__icon--${modifier}`}
// />
// ) : (
// ''
// )}
const inner = ( const inner = (
<span> <span>
<span <span
@ -78,14 +86,6 @@ class UriIndicator extends React.PureComponent<Props> {
> >
{channelName} {channelName}
</span>{' '} </span>{' '}
{!signatureIsValid ? (
<Icon
icon={icon}
className={`channel-indicator__icon channel-indicator__icon--${modifier}`}
/>
) : (
''
)}
</span> </span>
); );

View file

@ -1,5 +1,5 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { normalizeURI } from 'lbryURI.js'; import { normalizeURI } from 'lbryURI';
import { selectState as selectSearch, selectWunderBarAddress } from 'redux/selectors/search'; import { selectState as selectSearch, selectWunderBarAddress } from 'redux/selectors/search';
import { doNavigate } from 'redux/actions/navigation'; import { doNavigate } from 'redux/actions/navigation';
import { updateSearchQuery, getSearchSuggestions } from 'redux/actions/search'; import { updateSearchQuery, getSearchSuggestions } from 'redux/actions/search';

View file

@ -279,9 +279,7 @@ export function doLoadVideo(uri) {
}); });
dispatch( dispatch(
doAlertError( doAlertError(
`Failed to download ${ `Failed to download ${uri}, please try again. If this problem persists, visit https://lbry.io/faq/support for support.`
uri
}, please try again. If this problem persists, visit https://lbry.io/faq/support for support.`
) )
); );
}); });

View file

@ -1,5 +1,5 @@
import * as ACTIONS from 'constants/action_types'; import * as ACTIONS from 'constants/action_types';
import { buildURI } from 'lbryURI'; import { normalizeURI } from 'lbryURI';
import { doResolveUri } from 'redux/actions/content'; import { doResolveUri } from 'redux/actions/content';
import { doNavigate } from 'redux/actions/navigation'; import { doNavigate } from 'redux/actions/navigation';
import { selectCurrentPage } from 'redux/selectors/navigation'; import { selectCurrentPage } from 'redux/selectors/navigation';
@ -98,7 +98,7 @@ export const getSearchSuggestions = value => dispatch => {
// If it's not a valid uri, then add a "search for {query}" result // If it's not a valid uri, then add a "search for {query}" result
const searchLabel = `Search for "${value}"`; const searchLabel = `Search for "${value}"`;
try { try {
const uri = Lbryuri.normalize(value); const uri = normalizeURI(value);
formattedSuggestions.unshift( formattedSuggestions.unshift(
{ label: uri, value: uri }, { label: uri, value: uri },
{ label: searchLabel, value: `${value}?search` } { label: searchLabel, value: `${value}?search` }

View file

@ -68,11 +68,12 @@ export function doUpdateIsNight() {
const momentNow = moment(); const momentNow = moment();
return { return {
type: ACTIONS.UPDATE_IS_NIGHT, type: ACTIONS.UPDATE_IS_NIGHT,
data: { isNight: () => { data: {
isNight: () => {
const startNightMoment = moment('19:00', 'HH:mm'); const startNightMoment = moment('19:00', 'HH:mm');
const endNightMoment = moment('8:00', 'HH:mm'); const endNightMoment = moment('8:00', 'HH:mm');
return !(momentNow.isAfter(endNightMoment) && momentNow.isBefore(startNightMoment)); return !(momentNow.isAfter(endNightMoment) && momentNow.isBefore(startNightMoment));
} },
}, },
}; };
} }

2010
yarn.lock

File diff suppressed because it is too large Load diff