first pass at wallet styles

This commit is contained in:
Sean Yesmunt 2019-09-30 17:48:30 -04:00
parent b2cc11b4e4
commit 07c5278f44
23 changed files with 206 additions and 69 deletions

View file

@ -264,6 +264,14 @@ export const icons = {
<path d="M7 11V7a5 5 0 0 1 9.9-1" /> <path d="M7 11V7a5 5 0 0 1 9.9-1" />
</g> </g>
), ),
[ICONS.LOCK]: buildIcon(
<g>
<rect x="3" y="11" width="18" height="11" rx="2" ry="2" />
<path d="M7 11V7a5 5 0 0 1 10 0v4" />
</g>
),
[ICONS.TAG]: buildIcon( [ICONS.TAG]: buildIcon(
<g> <g>
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z" /> <path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z" />

View file

@ -68,6 +68,13 @@ const Header = (props: Props) => {
<header className={classnames('header', { 'header--minimal': minimal })}> <header className={classnames('header', { 'header--minimal': minimal })}>
<div className="header__contents"> <div className="header__contents">
<div className="header__navigation"> <div className="header__navigation">
<Button
className="header__navigation-item header__navigation-item--lbry"
label={__('LBRY')}
icon={ICONS.LBRY}
navigate="/"
/>
{/* @if TARGET='app' */} {/* @if TARGET='app' */}
{!minimal && ( {!minimal && (
<div className="header__navigation-arrows"> <div className="header__navigation-arrows">
@ -90,13 +97,6 @@ const Header = (props: Props) => {
)} )}
{/* @endif */} {/* @endif */}
<Button
className="header__navigation-item header__navigation-item--lbry"
label={__('LBRY')}
icon={ICONS.LBRY}
navigate="/"
/>
{!minimal && <WunderBar />} {!minimal && <WunderBar />}
</div> </div>

View file

@ -17,6 +17,8 @@ import InvitePage from 'page/invite';
import SearchPage from 'page/search'; import SearchPage from 'page/search';
import LibraryPage from 'page/library'; import LibraryPage from 'page/library';
import WalletPage from 'page/wallet'; import WalletPage from 'page/wallet';
import WalletSendPage from 'page/walletSend';
import WalletReceivePage from 'page/walletReceive';
import TagsPage from 'page/tags'; import TagsPage from 'page/tags';
import FollowingPage from 'page/following'; import FollowingPage from 'page/following';
import ListBlockedPage from 'page/listBlocked'; import ListBlockedPage from 'page/listBlocked';
@ -83,8 +85,10 @@ function AppRouter(props: Props) {
<PrivateRoute {...props} path={`/$/${PAGES.LIBRARY}`} component={LibraryPage} /> <PrivateRoute {...props} path={`/$/${PAGES.LIBRARY}`} component={LibraryPage} />
<PrivateRoute {...props} path={`/$/${PAGES.ACCOUNT}`} component={AccountPage} /> <PrivateRoute {...props} path={`/$/${PAGES.ACCOUNT}`} component={AccountPage} />
<PrivateRoute {...props} path={`/$/${PAGES.FOLLOWING}`} component={FollowingPage} /> <PrivateRoute {...props} path={`/$/${PAGES.FOLLOWING}`} component={FollowingPage} />
<PrivateRoute {...props} path={`/$/${PAGES.WALLET}`} component={WalletPage} />
<PrivateRoute {...props} path={`/$/${PAGES.BLOCKED}`} component={ListBlockedPage} /> <PrivateRoute {...props} path={`/$/${PAGES.BLOCKED}`} component={ListBlockedPage} />
<PrivateRoute {...props} path={`/$/${PAGES.WALLET}`} exact component={WalletPage} />
<PrivateRoute {...props} path={`/$/${PAGES.WALLET_SEND}`} exact component={WalletSendPage} />
<PrivateRoute {...props} path={`/$/${PAGES.WALLET_RECEIVE}`} exact component={WalletReceivePage} />
{/* Below need to go at the end to make sure we don't match any of our pages first */} {/* Below need to go at the end to make sure we don't match any of our pages first */}
<Route path="/:claimName" exact component={ShowPage} /> <Route path="/:claimName" exact component={ShowPage} />

View file

@ -49,15 +49,8 @@ function TransactionList(props: Props) {
{loading && <Spinner type="small" />} {loading && <Spinner type="small" />}
</span> </span>
<div className="card__actions--inline"> <div className="card__actions--inline">
{slim && (
<Button
button="link"
className="button--alt"
navigate={`/$/${PAGES.TRANSACTIONS}`}
label={__('Full History')}
/>
)}
<RefreshTransactionButton /> <RefreshTransactionButton />
{slim && <Button button="primary" navigate={`/$/${PAGES.TRANSACTIONS}`} label={__('Full History')} />}
</div> </div>
</h2> </h2>
</header> </header>

View file

@ -49,9 +49,7 @@ class WalletAddress extends React.PureComponent<Props, State> {
return ( return (
<Card <Card
title={__('Receive Credits')} title={__('Receive Credits')}
subtitle={__( subtitle={__('Use this address to receive LBC.')}
'Use this address to receive LBC. You can generate a new address at any time, and any previous addresses will continue to work.'
)}
actions={ actions={
<React.Fragment> <React.Fragment>
<CopyableText label={__('Your Address')} copyable={receiveAddress} snackMessage={__('Address copied.')} /> <CopyableText label={__('Your Address')} copyable={receiveAddress} snackMessage={__('Address copied.')} />
@ -67,6 +65,9 @@ class WalletAddress extends React.PureComponent<Props, State> {
)} )}
<Button button="link" label={showQR ? __('Hide QR code') : __('Show QR code')} onClick={this.toggleQR} /> <Button button="link" label={showQR ? __('Hide QR code') : __('Show QR code')} onClick={this.toggleQR} />
</div> </div>
<p className="help">
{__('You can generate a new address at any time, and any previous addresses will continue to work.')}
</p>
{showQR && <QRCode value={receiveAddress} paddingTop />} {showQR && <QRCode value={receiveAddress} paddingTop />}
</React.Fragment> </React.Fragment>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View file

@ -6,17 +6,16 @@ import {
selectSupportsBalance, selectSupportsBalance,
selectTipsBalance, selectTipsBalance,
} from 'lbry-redux'; } from 'lbry-redux';
import { selectClaimedRewards } from 'lbryinc';
import WalletBalance from './view'; import WalletBalance from './view';
const select = state => ({ const select = state => ({
balance: selectBalance(state), balance: selectBalance(state),
totalBalance: selectTotalBalance(state), totalBalance: selectTotalBalance(state),
claimsBalance: selectClaimsBalance(state), claimsBalance: selectClaimsBalance(state) || 0,
supportsBalance: selectSupportsBalance(state), supportsBalance: selectSupportsBalance(state) || 0,
tipsBalance: selectTipsBalance(state), tipsBalance: selectTipsBalance(state) || 0,
rewards: selectClaimedRewards(state),
}); });
export default connect( export default connect(select)(WalletBalance);
select,
null
)(WalletBalance);

View file

@ -1,7 +1,10 @@
// @flow // @flow
import * as ICONS from 'constants/icons';
import * as PAGES from 'constants/pages';
import React from 'react'; import React from 'react';
import CreditAmount from 'component/common/credit-amount'; import CreditAmount from 'component/common/credit-amount';
import BalanceBackground from './balance-background.png'; import Button from 'component/button';
import Icon from 'component/common/icon';
type Props = { type Props = {
balance: number, balance: number,
@ -9,40 +12,79 @@ type Props = {
claimsBalance: number, claimsBalance: number,
supportsBalance: number, supportsBalance: number,
tipsBalance: number, tipsBalance: number,
rewards: Array<Reward>,
}; };
const WalletBalance = (props: Props) => { const WalletBalance = (props: Props) => {
const { balance, totalBalance, claimsBalance, supportsBalance, tipsBalance } = props; const { balance, claimsBalance, supportsBalance, tipsBalance, rewards } = props;
const rewardTotal = rewards.reduce((acc, val) => acc + val.reward_amount, 0);
return ( return (
<section <React.Fragment>
className="card card--section card--wallet-balance" <section className="section__flex-wrap">
style={{ backgroundImage: `url(${BalanceBackground})` }} <div>
> <h2 className="section__title">{__('Available Balance')}</h2>
<h2 className="card__title">{__('Balance')}</h2> <span className="section__title--large">
<span className="card__content--large"> {(balance || balance === 0) && <CreditAmount badge={false} amount={balance} precision={8} />}
{(balance || balance === 0) && <CreditAmount badge={false} amount={balance} precision={8} />} </span>
</span>
{tipsBalance > 0 && ( <div className="section__actions">
<div className="card__content--small"> <Button button="inverse" label={__('Send Credits')} navigate={`$/${PAGES.WALLET_SEND}`} />
Locked in Tips: <CreditAmount badge={false} amount={tipsBalance} precision={8} /> <Button button="inverse" label={__('Your Address')} navigate={`$/${PAGES.WALLET_RECEIVE}`} />
</div>
</div> </div>
)}
{claimsBalance > 0 && ( <div>
<div className="card__content--small"> <div className="section">
Locked in claims: <CreditAmount badge={false} amount={claimsBalance} precision={8} /> <div className="section__flex">
<Icon sectionIcon icon={ICONS.FEATURED} />
<h2 className="section__title--small">
<strong>
<CreditAmount badge={false} amount={rewardTotal} precision={8} />
</strong>{' '}
{__('Earned From Rewards')}
</h2>
</div>
</div>
<div className="section">
<div className="section__flex">
<Icon sectionIcon icon={ICONS.TIP} />
<h2 className="section__title--small">
<strong>
<CreditAmount badge={false} amount={tipsBalance} precision={8} />
</strong>{' '}
{__('Earned From Tips')}
</h2>
</div>
</div>
<div className="section">
<div className="section__flex">
<Icon sectionIcon icon={ICONS.LOCK} />
<div>
<h2 className="section__title--small">
<strong>{(claimsBalance + supportsBalance).toFixed(2)}</strong> {__('LBC Currently Staked')}
</h2>
<div className="section__subtitle">
<dl>
<dt>{__('Your Publishes')}</dt>
<dd>
<CreditAmount badge={false} amount={claimsBalance} precision={8} />
</dd>
<dt>{__('Your Supports')}</dt>
<dd>
<CreditAmount badge={false} amount={supportsBalance} precision={8} />
</dd>
</dl>
</div>
</div>
</div>
</div>
</div> </div>
)} </section>
{supportsBalance > 0 && ( </React.Fragment>
<div className="card__content--small">
Locked in supports: <CreditAmount badge={false} amount={supportsBalance} precision={8} />
</div>
)}
{totalBalance > 0 && (
<div className="card__content--small">
Total account value: <CreditAmount badge={false} amount={totalBalance} precision={8} />
</div>
)}
</section>
); );
}; };

View file

@ -31,6 +31,7 @@ export const COMPLETED = 'CheckCircle';
export const SUBSCRIBE = 'Heart'; export const SUBSCRIBE = 'Heart';
export const UNSUBSCRIBE = 'BrokenHeart'; export const UNSUBSCRIBE = 'BrokenHeart';
export const UNLOCK = 'Unlock'; export const UNLOCK = 'Unlock';
export const LOCK = 'Lock';
export const WEB = 'Globe'; export const WEB = 'Globe';
export const SHARE = 'Share2'; export const SHARE = 'Share2';
export const EXTERNAL = 'ExternalLink'; export const EXTERNAL = 'ExternalLink';

View file

@ -20,4 +20,6 @@ export const SEARCH = 'search';
export const TRANSACTIONS = 'transactions'; export const TRANSACTIONS = 'transactions';
export const TAGS = 'tags'; export const TAGS = 'tags';
export const WALLET = 'wallet'; export const WALLET = 'wallet';
export const WALLET_SEND = 'wallet/send';
export const WALLET_RECEIVE = 'wallet/receive';
export const BLOCKED = 'blocked'; export const BLOCKED = 'blocked';

View file

@ -158,7 +158,7 @@ function ChannelPage(props: Props) {
onClick={() => openModal(MODALS.SEND_TIP, { uri, channelIsMine, isSupport: true })} onClick={() => openModal(MODALS.SEND_TIP, { uri, channelIsMine, isSupport: true })}
/> />
)} )}
{!channelIsBlocked && !channelIsBlackListed && <SubscribeButton uri={permanentUrl} />} {!channelIsBlocked && (!channelIsBlackListed || isSubscribed) && <SubscribeButton uri={permanentUrl} />}
{!isSubscribed && <BlockButton uri={permanentUrl} />} {!isSubscribed && <BlockButton uri={permanentUrl} />}
</div> </div>
{!editing && cover && ( {!editing && cover && (

View file

@ -1,15 +1,11 @@
import React from 'react'; import React from 'react';
import WalletBalance from 'component/walletBalance'; import WalletBalance from 'component/walletBalance';
import WalletSend from 'component/walletSend';
import WalletAddress from 'component/walletAddress';
import TransactionListRecent from 'component/transactionListRecent'; import TransactionListRecent from 'component/transactionListRecent';
import Page from 'component/page'; import Page from 'component/page';
const WalletPage = () => ( const WalletPage = () => (
<Page> <Page>
<WalletBalance /> <WalletBalance />
<WalletSend />
<WalletAddress />
<TransactionListRecent /> <TransactionListRecent />
</Page> </Page>
); );

View file

@ -0,0 +1,11 @@
import { connect } from 'react-redux';
import WalletReceive from './view';
const select = state => ({});
const perform = dispatch => ({});
export default connect(
select,
perform
)(WalletReceive);

View file

@ -0,0 +1,11 @@
import React from 'react';
import WalletAddress from 'component/walletAddress';
import Page from 'component/page';
const WalletAddressPage = () => (
<Page className="main--contained">
<WalletAddress />
</Page>
);
export default WalletAddressPage;

View file

@ -0,0 +1,11 @@
import { connect } from 'react-redux';
import WalletSend from './view';
const select = state => ({});
const perform = dispatch => ({});
export default connect(
select,
perform
)(WalletSend);

View file

@ -0,0 +1,11 @@
import React from 'react';
import WalletSend from 'component/walletSend';
import Page from 'component/page';
const WalletSendPage = () => (
<Page className="main--contained">
<WalletSend />
</Page>
);
export default WalletSendPage;

View file

@ -194,7 +194,8 @@
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: var(--spacing-small); margin-bottom: var(--spacing-small);
font-size: var(--font-title); font-size: var(--font-section-title);
font-weight: 300;
& > *:not(:last-child) { & > *:not(:last-child) {
margin-right: var(--spacing-medium); margin-right: var(--spacing-medium);

View file

@ -335,5 +335,5 @@ fieldset-section {
} }
.form-field--address { .form-field--address {
width: 370px; min-width: 18em;
} }

View file

@ -21,6 +21,7 @@
.main { .main {
position: relative; position: relative;
width: calc(100% - var(--side-nav-width) - var(--spacing-large)); width: calc(100% - var(--side-nav-width) - var(--spacing-large));
margin-right: var(--spacing-main-padding);
@media (max-width: 600px) { @media (max-width: 600px) {
width: 100%; width: 100%;

View file

@ -6,7 +6,7 @@
align-items: center; align-items: center;
position: relative; position: relative;
z-index: 1; z-index: 1;
margin-right: var(--spacing-large); margin-right: var(--spacing-main-padding);
font-size: var(--font-label); font-size: var(--font-label);
@media (max-width: 600px) { @media (max-width: 600px) {

View file

@ -1,5 +1,5 @@
.section { .section {
margin-top: var(--spacing-medium); margin-top: var(--spacing-large);
&:first-of-type { &:first-of-type {
margin-top: 0; margin-top: 0;
@ -23,14 +23,32 @@
} }
} }
.section__flex-wrap {
@extend .section__flex;
flex-wrap: wrap;
margin-bottom: var(--spacing-large);
& > * {
margin-bottom: var(--spacing-large);
}
}
.section__title { .section__title {
text-align: left; text-align: left;
font-size: var(--font-section-title); font-size: var(--font-section-title);
font-weight: 300; font-weight: 300;
} }
.section__title--small {
@extend .section__title;
font-size: var(--font-body);
margin-top: var(--spacing-small);
}
.section__title--large { .section__title--large {
@extend .section__title; @extend .section__title;
margin-right: var(--spacing-medium);
display: inline-block;
font-weight: 700; font-weight: 700;
font-size: var(--font-heading); font-size: var(--font-heading);
} }

View file

@ -46,10 +46,6 @@ p {
font-size: var(--font-body); font-size: var(--font-body);
} }
ul,
ol {
}
ul, ul,
ol { ol {
list-style: initial; list-style: initial;
@ -70,6 +66,37 @@ ol {
} }
} }
dl {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin-top: var(--spacing-medium);
}
dt {
flex-basis: 40%;
text-align: left;
font-weight: bold;
}
dd {
flex-basis: 55%;
flex-grow: 1;
margin: 0;
text-align: right;
}
dt,
dd {
padding: var(--spacing-medium) var(--spacing-small);
border-top: 1px solid $lbry-gray-1;
&:last-of-type {
border-bottom: 1px solid $lbry-gray-1;
}
}
input, input,
label { label {
user-select: none; user-select: none;