use correct aspect ratio and add price to search results

This commit is contained in:
Sean Yesmunt 2018-05-10 19:41:17 -04:00
parent c806d10f1e
commit fcdfa238b3
5 changed files with 19 additions and 7 deletions

View file

@ -59,7 +59,7 @@ class FileListSearch extends React.PureComponent<Props> {
query && ( query && (
<div className="search__results"> <div className="search__results">
<div className="search-result__column"> <div className="search-result__column">
<div className="file-list__header">{__('Files')}</div> <div className="file-list__header">{__('Content')}</div>
{!isSearching && {!isSearching &&
(fileResults.length ? ( (fileResults.length ? (
fileResults.map(uri => <FileTile key={uri} uri={uri} />) fileResults.map(uri => <FileTile key={uri} uri={uri} />)

View file

@ -1,12 +1,13 @@
// @flow // @flow
import * as React from 'react'; import * as React from 'react';
import * as icons from 'constants/icons'; import * as icons from 'constants/icons';
import { normalizeURI, isURIClaimable, parseURI } from 'lbry-redux'; import { normalizeURI, parseURI } from 'lbry-redux';
import CardMedia from 'component/cardMedia'; import CardMedia from 'component/cardMedia';
import TruncatedText from 'component/common/truncated-text'; import TruncatedText from 'component/common/truncated-text';
import Icon from 'component/common/icon'; import Icon from 'component/common/icon';
import Button from 'component/button'; import Button from 'component/button';
import classnames from 'classnames'; import classnames from 'classnames';
import FilePrice from 'component/filePrice';
type Props = { type Props = {
fullWidth: boolean, // removes the max-width css fullWidth: boolean, // removes the max-width css
@ -21,11 +22,14 @@ type Props = {
channel_name: string, channel_name: string,
claim_id: string, claim_id: string,
}, },
metadata: {}, metadata: ?{
title: ?string,
thumbnail: ?string,
},
resolveUri: string => void, resolveUri: string => void,
navigate: (string, ?{}) => void, navigate: (string, ?{}) => void,
clearPublish: () => void, clearPublish: () => void,
updatePublishForm: () => void, updatePublishForm: ({}) => void,
}; };
class FileTile extends React.PureComponent<Props> { class FileTile extends React.PureComponent<Props> {
@ -98,6 +102,9 @@ class FileTile extends React.PureComponent<Props> {
{showUri ? uri : channel || __('Anonymous')} {showUri ? uri : channel || __('Anonymous')}
{isRewardContent && <Icon icon={icons.FEATURED} />} {isRewardContent && <Icon icon={icons.FEATURED} />}
{showLocal && isDownloaded && <Icon icon={icons.LOCAL} />} {showLocal && isDownloaded && <Icon icon={icons.LOCAL} />}
<div className="card__subtitle-price">
<FilePrice uri={uri} />
</div>
</div> </div>
{!name && ( {!name && (
<React.Fragment> <React.Fragment>

View file

@ -146,7 +146,8 @@ $large-breakpoint: 1760px;
--success-msg-bg: var(--color-green-light); --success-msg-bg: var(--color-green-light);
/* File Tile Card */ /* File Tile Card */
--file-tile--media-size: 60px; --file-tile--media-height: 60px;
--file-tile--media-width: 94px; // 60 * (1 + 9/16)
/* Modal */ /* Modal */
--modal-width: 440px; --modal-width: 440px;

View file

@ -131,6 +131,10 @@
} }
} }
.card__subtitle-price {
padding-top: $spacing-vertical * 1/3;
}
.card__subtitle--file-info { .card__subtitle--file-info {
display: flex; display: flex;
align-items: center; align-items: center;

View file

@ -20,10 +20,10 @@
display: flex; display: flex;
margin-top: $spacing-vertical; margin-top: $spacing-vertical;
max-width: 260px; max-width: 260px;
height: var(--file-tile--media-size);
.card__media { .card__media {
flex: 0 0 var(--file-tile--media-size); height: var(--file-tile--media-height);
flex: 0 0 var(--file-tile--media-width);
} }
.card__subtitle { .card__subtitle {