mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-31 09:21:27 +00:00
Merge pull request #925 from lbryio/icon-spacing
Fix icon spacing on home page
This commit is contained in:
commit
a568e90bfb
12 changed files with 30 additions and 30 deletions
|
@ -3,23 +3,6 @@ import PropTypes from 'prop-types';
|
||||||
import { formatCredits, formatFullPrice } from 'util/formatCredits';
|
import { formatCredits, formatFullPrice } from 'util/formatCredits';
|
||||||
import lbry from '../lbry.js';
|
import lbry from '../lbry.js';
|
||||||
|
|
||||||
// component/icon.js
|
|
||||||
export class Icon extends React.PureComponent {
|
|
||||||
static propTypes = {
|
|
||||||
icon: PropTypes.string.isRequired,
|
|
||||||
className: PropTypes.string,
|
|
||||||
fixed: PropTypes.bool,
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { fixed, className } = this.props;
|
|
||||||
const spanClassName = `icon ${'fixed' in this.props ? 'icon-fixed-width ' : ''}${
|
|
||||||
this.props.icon
|
|
||||||
} ${this.props.className || ''}`;
|
|
||||||
return <span className={spanClassName} />;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class TruncatedText extends React.PureComponent {
|
export class TruncatedText extends React.PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
lines: PropTypes.number,
|
lines: PropTypes.number,
|
||||||
|
|
|
@ -87,8 +87,8 @@ class FileCard extends React.PureComponent {
|
||||||
</div>
|
</div>
|
||||||
<div className="card__subtitle">
|
<div className="card__subtitle">
|
||||||
<span className="card__indicators card--file-subtitle">
|
<span className="card__indicators card--file-subtitle">
|
||||||
<FilePrice uri={uri} /> {isRewardContent && <Icon icon={icons.FEATURED} />}{' '}
|
<FilePrice uri={uri} /> {isRewardContent && <Icon icon={icons.FEATURED} leftPad />}{' '}
|
||||||
{fileInfo && <Icon icon={icons.LOCAL} />}
|
{fileInfo && <Icon icon={icons.LOCAL} leftPad />}
|
||||||
</span>
|
</span>
|
||||||
<span className="card--file-subtitle">
|
<span className="card--file-subtitle">
|
||||||
<UriIndicator uri={uri} link span smallCard />
|
<UriIndicator uri={uri} link span smallCard />
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Icon, BusyMessage } from 'component/common';
|
import { BusyMessage } from 'component/common';
|
||||||
|
import Icon from 'component/icon';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
|
|
||||||
class FileDownloadLink extends React.PureComponent {
|
class FileDownloadLink extends React.PureComponent {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import FormField from 'component/formField';
|
import FormField from 'component/formField';
|
||||||
import { Icon } from 'component/common.js';
|
import Icon from 'component/icon';
|
||||||
|
|
||||||
let formFieldCounter = 0;
|
let formFieldCounter = 0;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import * as icons from 'constants/icons';
|
import * as icons from 'constants/icons';
|
||||||
|
import classnames from 'classnames';
|
||||||
|
|
||||||
export default class Icon extends React.PureComponent {
|
export default class Icon extends React.PureComponent {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -30,10 +31,19 @@ export default class Icon extends React.PureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const className = this.getIconClass(),
|
const { icon, fixed, className, leftPad } = this.props;
|
||||||
title = this.getIconTitle();
|
const iconClass = this.getIconClass();
|
||||||
|
const title = this.getIconTitle();
|
||||||
|
|
||||||
const spanClassName = `icon ${className}${this.props.fixed ? ' icon-fixed-width ' : ''}`;
|
const spanClassName = classnames(
|
||||||
|
'icon',
|
||||||
|
iconClass,
|
||||||
|
{
|
||||||
|
'icon-fixed-width': fixed,
|
||||||
|
'icon--left-pad': leftPad,
|
||||||
|
},
|
||||||
|
className
|
||||||
|
);
|
||||||
|
|
||||||
return <span className={spanClassName} title={title} />;
|
return <span className={spanClassName} title={title} />;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Icon } from 'component/common';
|
import Icon from 'component/icon';
|
||||||
import RewardLink from 'component/rewardLink';
|
import RewardLink from 'component/rewardLink';
|
||||||
import rewards from 'rewards.js';
|
import rewards from 'rewards.js';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Icon } from './common.js';
|
import Icon from 'component/icon';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
|
|
||||||
export class DropDownMenuItem extends React.PureComponent {
|
export class DropDownMenuItem extends React.PureComponent {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Icon } from 'component/common';
|
import Icon from 'component/icon';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import lbryuri from 'lbryuri';
|
import lbryuri from 'lbryuri';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import lbryuri from 'lbryuri.js';
|
import lbryuri from 'lbryuri.js';
|
||||||
import { Icon } from 'component/common.js';
|
import Icon from 'component/icon';
|
||||||
import { parseQueryParams } from 'util/query_params';
|
import { parseQueryParams } from 'util/query_params';
|
||||||
|
|
||||||
class WunderBar extends React.PureComponent {
|
class WunderBar extends React.PureComponent {
|
||||||
|
|
|
@ -2,7 +2,8 @@ import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import lbryuri from 'lbryuri';
|
import lbryuri from 'lbryuri';
|
||||||
import FileCard from 'component/fileCard';
|
import FileCard from 'component/fileCard';
|
||||||
import { Icon, BusyMessage } from 'component/common.js';
|
import { BusyMessage } from 'component/common.js';
|
||||||
|
import Icon from 'component/icon';
|
||||||
import ToolTip from 'component/tooltip.js';
|
import ToolTip from 'component/tooltip.js';
|
||||||
import SubHeader from 'component/subHeader';
|
import SubHeader from 'component/subHeader';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
|
@ -3,7 +3,8 @@ import React from 'react';
|
||||||
import lbry from 'lbry.js';
|
import lbry from 'lbry.js';
|
||||||
import Link from 'component/link';
|
import Link from 'component/link';
|
||||||
import SubHeader from 'component/subHeader';
|
import SubHeader from 'component/subHeader';
|
||||||
import { BusyMessage, Icon } from 'component/common';
|
import { BusyMessage } from 'component/common';
|
||||||
|
import Icon from 'component/icon';
|
||||||
|
|
||||||
class HelpPage extends React.PureComponent {
|
class HelpPage extends React.PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -81,6 +81,10 @@ body {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon--left-pad {
|
||||||
|
padding-left: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 1.75em;
|
font-size: 1.75em;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue