Merge branch 'master' into issue/839

This commit is contained in:
Igor Gassmann 2017-12-12 17:49:50 -03:00
commit 93cb925169
7 changed files with 27 additions and 21 deletions

View file

@ -5,7 +5,7 @@ var merge = require('lodash.merge');
var store = {
error: null,
flowOptions: [
'status',
'check',
'--color=always',
],
options: {

View file

@ -21,8 +21,7 @@
"dist": "yarn compile && electron-builder",
"dist:dir": "yarn dist -- --dir -c.compression=store -c.mac.identity=null",
"postinstall": "electron-builder install-app-deps",
"precommit": "lint-staged",
"prettier": "prettier --trailing-comma es5 --write src/renderer/**/*.{js,jsx}"
"precommit": "lint-staged"
},
"main": "src/main/index.js",
"keywords": [
@ -100,7 +99,7 @@
},
"license": "MIT",
"lint-staged": {
"src/renderer/**/*.{jsx,js}": [
"src/**/*.{js,jsx}": [
"prettier --trailing-comma es5 --write",
"git add"
]

View file

@ -1,9 +1,14 @@
// @flow
import React from "react";
import Link from "component/link";
import { CreditAmount } from "component/common";
const RewardSummary = props => {
const { balance, unclaimedRewardAmount } = props;
type Props = {
unclaimedRewardAmount: number,
};
const RewardSummary = (props: Props) => {
const { unclaimedRewardAmount } = props;
return (
<section className="card">
@ -11,11 +16,17 @@ const RewardSummary = props => {
<h3>{__("Rewards")}</h3>
</div>
<div className="card__content">
{unclaimedRewardAmount > 0 && (
{unclaimedRewardAmount > 0 ? (
<p>
You have{" "}
<CreditAmount amount={unclaimedRewardAmount} precision={8} /> in
unclaimed rewards.
{__("You have")}{" "}
<CreditAmount amount={unclaimedRewardAmount} precision={8} />{" "}
{__("in unclaimed rewards")}.
</p>
) : (
<p>
{__(
"There are no rewards available at this time, please check back later"
)}.
</p>
)}
</div>

View file

@ -13,12 +13,12 @@ class WalletAddress extends React.PureComponent {
return (
<section className="card">
<div className="card__title-primary">
<h3>{__("Wallet Address")}</h3>
<h3>{__("Receive Credits")}</h3>
</div>
<div className="card__content">
<p>
{__(
"Use this address to receive credits sent by another user (or yourself)."
"Use this wallet address to receive credits sent by another user (or yourself)."
)}
</p>
<Address address={receiveAddress} />

View file

@ -9,6 +9,7 @@ import {
} from "redux/selectors/navigation";
import { doSearch } from "redux/actions/search";
import { toQueryString } from "util/query_params";
import amplitude from "amplitude-js";
export function doNavigate(path, params = {}, options = {}) {
return function(dispatch, getState) {
@ -23,6 +24,8 @@ export function doNavigate(path, params = {}, options = {}) {
const scrollY = options.scrollY;
amplitude.getInstance().logEvent("NAVIGATION", { destination: url });
dispatch({
type: types.HISTORY_NAVIGATE,
data: { url, index: options.index, scrollY },

View file

@ -1,6 +1,5 @@
import * as types from "constants/action_types";
import { parseQueryParams } from "util/query_params";
import amplitude from "amplitude-js";
const currentPath = () => {
const hash = document.location.hash;
@ -71,13 +70,7 @@ reducers[types.WINDOW_SCROLLED] = (state, action) => {
export default function reducer(state = defaultState, action) {
const handler = reducers[action.type];
if (handler) {
let nextState = handler(state, action);
if (nextState.currentPath !== state.currentPath) {
amplitude
.getInstance()
.logEvent("NAVIGATION", { destination: nextState.currentPath });
}
return nextState;
return handler(state, action);
}
return state;
}

View file

@ -23,7 +23,7 @@ module.exports = {
};
if (process.env.NODE_ENV === 'development') {
const FLOW_BABEL_WEBPACK_PLUGIN = require('./src/renderer/flowtype-plugin');
const FLOW_BABEL_WEBPACK_PLUGIN = require('./flowtype-plugin');
module.exports.plugins = [
new FLOW_BABEL_WEBPACK_PLUGIN({