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 = { var store = {
error: null, error: null,
flowOptions: [ flowOptions: [
'status', 'check',
'--color=always', '--color=always',
], ],
options: { options: {

View file

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

View file

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

View file

@ -13,12 +13,12 @@ class WalletAddress extends React.PureComponent {
return ( return (
<section className="card"> <section className="card">
<div className="card__title-primary"> <div className="card__title-primary">
<h3>{__("Wallet Address")}</h3> <h3>{__("Receive Credits")}</h3>
</div> </div>
<div className="card__content"> <div className="card__content">
<p> <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> </p>
<Address address={receiveAddress} /> <Address address={receiveAddress} />

View file

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

View file

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

View file

@ -23,7 +23,7 @@ module.exports = {
}; };
if (process.env.NODE_ENV === 'development') { 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 = [ module.exports.plugins = [
new FLOW_BABEL_WEBPACK_PLUGIN({ new FLOW_BABEL_WEBPACK_PLUGIN({