Skip to content

Commit

Permalink
Merge pull request #1539 from MyCryptoHQ/develop
Browse files Browse the repository at this point in the history
1.0.0 RC
  • Loading branch information
dternyak authored Apr 17, 2018
2 parents ac94ba5 + 699e4d6 commit 6f32bdc
Show file tree
Hide file tree
Showing 227 changed files with 20,904 additions and 1,149 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ v8-compile-cache-0/
package-lock.json

# Favicon cache
.wwp-cache
.wwp-cache

# MacOSX
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MyCrypto Beta (VISIT [MyCryptoHQ/mycrypto.com](https://github.com/MyCryptoHQ/mycrypto.com) for the current site)<br/>Just looking to download? Grab our [latest release](https://github.com/MyCryptoHQ/MyCrypto/releases)
# MyCrypto Beta RC (VISIT [MyCryptoHQ/mycrypto.com](https://github.com/MyCryptoHQ/mycrypto.com) for the current site)<br/>Just looking to download? Grab our [latest release](https://github.com/MyCryptoHQ/MyCrypto/releases)

[![Greenkeeper badge](https://badges.greenkeeper.io/MyCryptoHq/MyCrypto.svg)](https://greenkeeper.io/)
[![Coverage Status](https://coveralls.io/repos/github/MyCryptoHQ/MyCrypto/badge.svg?branch=develop)](https://coveralls.io/github/MyCryptoHQ/MyCrypto?branch=develop)
Expand Down
46 changes: 36 additions & 10 deletions common/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import Swap from 'containers/Tabs/Swap';
import SignAndVerifyMessage from 'containers/Tabs/SignAndVerifyMessage';
import BroadcastTx from 'containers/Tabs/BroadcastTx';
import CheckTransaction from 'containers/Tabs/CheckTransaction';
import SupportPage from 'containers/Tabs/SupportPage';
import ErrorScreen from 'components/ErrorScreen';
import PageNotFound from 'components/PageNotFound';
import LogOutPrompt from 'components/LogOutPrompt';
import QrSignerModal from 'containers/QrSignerModal';
import { TitleBar } from 'components/ui';
import { Store } from 'redux';
import { pollOfflineStatus, TPollOfflineStatus } from 'actions/config';
Expand Down Expand Up @@ -50,6 +52,7 @@ class RootClass extends Component<Props, State> {
public componentDidMount() {
this.props.pollOfflineStatus();
this.props.setUnitMeta(this.props.networkUnit);
this.addBodyClasses();
}

public componentDidCatch(error: Error) {
Expand Down Expand Up @@ -84,6 +87,7 @@ class RootClass extends Component<Props, State> {
<Route path="/sign-and-verify-message" component={SignAndVerifyMessage} />
<Route path="/tx-status" component={CheckTransaction} exact={true} />
<Route path="/pushTx" component={BroadcastTx} />
<Route path="/support-us" component={SupportPage} exact={true} />
<RouteNotFound />
</Switch>
</CaptureRouteNotFound>
Expand All @@ -95,18 +99,40 @@ class RootClass extends Component<Props, State> {
: BrowserRouter;

return (
<Provider store={store} key={Math.random()}>
<Router key={Math.random()}>
<React.Fragment>
{process.env.BUILD_ELECTRON && <TitleBar />}
{routes}
<LegacyRoutes />
<LogOutPrompt />
</React.Fragment>
</Router>
</Provider>
<React.Fragment>
<Provider store={store} key={Math.random()}>
<Router key={Math.random()}>
<React.Fragment>
{process.env.BUILD_ELECTRON && <TitleBar />}
{routes}
<LegacyRoutes />
<LogOutPrompt />
<QrSignerModal />
</React.Fragment>
</Router>
</Provider>
<div id="ModalContainer" />
</React.Fragment>
);
}

private addBodyClasses() {
const classes = [];

if (process.env.BUILD_ELECTRON) {
classes.push('is-electron');

if (navigator.appVersion.includes('Win')) {
classes.push('is-windows');
} else if (navigator.appVersion.includes('Mac')) {
classes.push('is-osx');
} else {
classes.push('is-linux');
}
}

document.body.className += ` ${classes.join(' ')}`;
}
}

const LegacyRoutes = withRouter(props => {
Expand Down
19 changes: 16 additions & 3 deletions common/actions/config/actionCreators.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import * as interfaces from './actionTypes';
import { TypeKeys } from './constants';

export type TToggleOffline = typeof toggleOffline;
export function toggleOffline(): interfaces.ToggleOfflineAction {
export function setOnline(): interfaces.SetOnlineAction {
return {
type: TypeKeys.CONFIG_TOGGLE_OFFLINE
type: TypeKeys.CONFIG_SET_ONLINE
};
}

export function setOffline(): interfaces.SetOfflineAction {
return {
type: TypeKeys.CONFIG_SET_OFFLINE
};
}

Expand Down Expand Up @@ -48,6 +53,14 @@ export function changeNodeIntent(payload: string): interfaces.ChangeNodeIntentAc
};
}

export type TChangeNodeIntentOneTime = typeof changeNodeIntentOneTime;
export function changeNodeIntentOneTime(payload: string): interfaces.ChangeNodeIntentOneTimeAction {
return {
type: TypeKeys.CONFIG_NODE_CHANGE_INTENT_ONETIME,
payload
};
}

export type TChangeNodeForce = typeof changeNodeForce;
export function changeNodeForce(payload: string): interfaces.ChangeNodeForceAction {
return {
Expand Down
19 changes: 15 additions & 4 deletions common/actions/config/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ import { TypeKeys } from './constants';
import { CustomNodeConfig, StaticNodeConfig } from 'types/node';
import { CustomNetworkConfig } from 'types/network';

/*** Toggle Offline ***/
export interface ToggleOfflineAction {
type: TypeKeys.CONFIG_TOGGLE_OFFLINE;
export interface SetOnlineAction {
type: TypeKeys.CONFIG_SET_ONLINE;
}

export interface SetOfflineAction {
type: TypeKeys.CONFIG_SET_OFFLINE;
}

export interface ToggleAutoGasLimitAction {
Expand Down Expand Up @@ -36,6 +39,13 @@ export interface ChangeNodeIntentAction {
type: TypeKeys.CONFIG_NODE_CHANGE_INTENT;
payload: string;
}

/*** Change Node Onetime ***/
export interface ChangeNodeIntentOneTimeAction {
type: TypeKeys.CONFIG_NODE_CHANGE_INTENT_ONETIME;
payload: string;
}

/*** Force Change Node ***/
export interface ChangeNodeForceAction {
type: TypeKeys.CONFIG_NODE_CHANGE_FORCE;
Expand Down Expand Up @@ -95,7 +105,8 @@ export type NodeAction =

export type MetaAction =
| ChangeLanguageAction
| ToggleOfflineAction
| SetOnlineAction
| SetOfflineAction
| ToggleAutoGasLimitAction
| PollOfflineStatus
| SetLatestBlockAction;
Expand Down
4 changes: 4 additions & 0 deletions common/actions/config/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
export enum TypeKeys {
CONFIG_LANGUAGE_CHANGE = 'CONFIG_LANGUAGE_CHANGE',

CONFIG_SET_ONLINE = 'CONFIG_SET_ONLINE',
CONFIG_SET_OFFLINE = 'CONFIG_SET_OFFLINE',

CONFIG_TOGGLE_OFFLINE = 'CONFIG_TOGGLE_OFFLINE',
CONFIG_TOGGLE_AUTO_GAS_LIMIT = 'CONFIG_TOGGLE_AUTO_GAS_LIMIT',
CONFIG_POLL_OFFLINE_STATUS = 'CONFIG_POLL_OFFLINE_STATUS',
Expand All @@ -10,6 +13,7 @@ export enum TypeKeys {
CONFIG_NODE_WEB3_UNSET = 'CONFIG_NODE_WEB3_UNSET',
CONFIG_NODE_CHANGE = 'CONFIG_NODE_CHANGE',
CONFIG_NODE_CHANGE_INTENT = 'CONFIG_NODE_CHANGE_INTENT',
CONFIG_NODE_CHANGE_INTENT_ONETIME = 'CONFIG_NODE_CHANGE_INTENT_ONETIME',
CONFIG_NODE_CHANGE_FORCE = 'CONFIG_NODE_CHANGE_FORCE',

CONFIG_ADD_CUSTOM_NODE = 'CONFIG_ADD_CUSTOM_NODE',
Expand Down
117 changes: 117 additions & 0 deletions common/actions/schedule/actionCreators/fields.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import {
SetTimeBountyFieldAction,
SetWindowSizeFieldAction,
SetWindowStartFieldAction,
SetScheduleTimestampFieldAction,
SetScheduleTypeAction,
SetSchedulingToggleAction,
SetScheduleTimezoneAction,
SetScheduleGasPriceFieldAction,
SetScheduleGasLimitFieldAction,
SetScheduleDepositFieldAction,
SetScheduleParamsValidityAction
} from '../actionTypes';
import { TypeKeys } from 'actions/schedule/constants';

type TSetTimeBountyField = typeof setTimeBountyField;
const setTimeBountyField = (
payload: SetTimeBountyFieldAction['payload']
): SetTimeBountyFieldAction => ({
type: TypeKeys.TIME_BOUNTY_FIELD_SET,
payload
});

type TSetWindowSizeField = typeof setWindowSizeField;
const setWindowSizeField = (
payload: SetWindowSizeFieldAction['payload']
): SetWindowSizeFieldAction => ({
type: TypeKeys.WINDOW_SIZE_FIELD_SET,
payload
});

type TSetWindowStartField = typeof setWindowStartField;
const setWindowStartField = (
payload: SetWindowStartFieldAction['payload']
): SetWindowStartFieldAction => ({
type: TypeKeys.WINDOW_START_FIELD_SET,
payload
});

type TSetScheduleTimestampField = typeof setScheduleTimestampField;
const setScheduleTimestampField = (
payload: SetScheduleTimestampFieldAction['payload']
): SetScheduleTimestampFieldAction => ({
type: TypeKeys.SCHEDULE_TIMESTAMP_FIELD_SET,
payload
});

type TSetScheduleType = typeof setScheduleType;
const setScheduleType = (payload: SetScheduleTypeAction['payload']): SetScheduleTypeAction => ({
type: TypeKeys.SCHEDULE_TYPE_SET,
payload
});

type TSetSchedulingToggle = typeof setSchedulingToggle;
const setSchedulingToggle = (
payload: SetSchedulingToggleAction['payload']
): SetSchedulingToggleAction => ({
type: TypeKeys.SCHEDULING_TOGGLE_SET,
payload
});

type TSetScheduleTimezone = typeof setScheduleTimezone;
const setScheduleTimezone = (
payload: SetScheduleTimezoneAction['payload']
): SetScheduleTimezoneAction => ({
type: TypeKeys.SCHEDULE_TIMEZONE_SET,
payload
});

type TSetScheduleGasPriceField = typeof setScheduleGasPriceField;
const setScheduleGasPriceField = (payload: SetScheduleGasPriceFieldAction['payload']) => ({
type: TypeKeys.SCHEDULE_GAS_PRICE_FIELD_SET,
payload
});

type TSetScheduleGasLimitField = typeof setScheduleGasLimitField;
const setScheduleGasLimitField = (payload: SetScheduleGasLimitFieldAction['payload']) => ({
type: TypeKeys.SCHEDULE_GAS_LIMIT_FIELD_SET,
payload
});

type TSetScheduleDepositField = typeof setScheduleDepositField;
const setScheduleDepositField = (payload: SetScheduleDepositFieldAction['payload']) => ({
type: TypeKeys.SCHEDULE_DEPOSIT_FIELD_SET,
payload
});

type TSetScheduleParamsValidity = typeof setScheduleParamsValidity;
const setScheduleParamsValidity = (payload: SetScheduleParamsValidityAction['payload']) => ({
type: TypeKeys.SCHEDULE_PARAMS_VALIDITY_SET,
payload
});

export {
TSetWindowSizeField,
TSetWindowStartField,
TSetTimeBountyField,
TSetScheduleTimestampField,
TSetScheduleType,
TSetSchedulingToggle,
TSetScheduleTimezone,
TSetScheduleGasPriceField,
TSetScheduleGasLimitField,
TSetScheduleDepositField,
TSetScheduleParamsValidity,
setTimeBountyField,
setWindowSizeField,
setWindowStartField,
setScheduleTimestampField,
setScheduleType,
setSchedulingToggle,
setScheduleTimezone,
setScheduleGasPriceField,
setScheduleGasLimitField,
setScheduleDepositField,
setScheduleParamsValidity
};
7 changes: 7 additions & 0 deletions common/actions/schedule/actionCreators/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export * from './fields';
export * from './scheduleTimestamp';
export * from './scheduleType';
export * from './schedulingToggle';
export * from './timeBounty';
export * from './windowSize';
export * from './windowStart';
21 changes: 21 additions & 0 deletions common/actions/schedule/actionCreators/scheduleTimestamp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { TypeKeys } from 'actions/schedule';
import {
SetCurrentScheduleTimestampAction,
SetCurrentScheduleTimezoneAction
} from '../actionTypes/scheduleTimestamp';

export type TSetCurrentScheduleTimestamp = typeof setCurrentScheduleTimestamp;
export const setCurrentScheduleTimestamp = (
payload: SetCurrentScheduleTimestampAction['payload']
): SetCurrentScheduleTimestampAction => ({
type: TypeKeys.CURRENT_SCHEDULE_TIMESTAMP_SET,
payload
});

export type TSetCurrentScheduleTimezone = typeof setCurrentScheduleTimezone;
export const setCurrentScheduleTimezone = (
payload: SetCurrentScheduleTimezoneAction['payload']
): SetCurrentScheduleTimezoneAction => ({
type: TypeKeys.CURRENT_SCHEDULE_TIMEZONE_SET,
payload
});
10 changes: 10 additions & 0 deletions common/actions/schedule/actionCreators/scheduleType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { TypeKeys } from 'actions/schedule';
import { SetCurrentScheduleTypeAction } from '../actionTypes/scheduleType';

export type TSetCurrentScheduleType = typeof setCurrentScheduleType;
export const setCurrentScheduleType = (
payload: SetCurrentScheduleTypeAction['payload']
): SetCurrentScheduleTypeAction => ({
type: TypeKeys.CURRENT_SCHEDULE_TYPE,
payload
});
12 changes: 12 additions & 0 deletions common/actions/schedule/actionCreators/schedulingToggle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { SetCurrentSchedulingToggleAction } from '../actionTypes/schedulingToggle';
import { TypeKeys } from 'actions/schedule';

type TSetCurrentSchedulingToggle = typeof setCurrentSchedulingToggle;
const setCurrentSchedulingToggle = (
payload: SetCurrentSchedulingToggleAction['payload']
): SetCurrentSchedulingToggleAction => ({
type: TypeKeys.CURRENT_SCHEDULING_TOGGLE,
payload
});

export { TSetCurrentSchedulingToggle, setCurrentSchedulingToggle };
12 changes: 12 additions & 0 deletions common/actions/schedule/actionCreators/timeBounty.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { SetCurrentTimeBountyAction } from '../actionTypes/timeBounty';
import { TypeKeys } from 'actions/schedule';

type TSetCurrentTimeBounty = typeof setCurrentTimeBounty;
const setCurrentTimeBounty = (
payload: SetCurrentTimeBountyAction['payload']
): SetCurrentTimeBountyAction => ({
type: TypeKeys.CURRENT_TIME_BOUNTY_SET,
payload
});

export { setCurrentTimeBounty, TSetCurrentTimeBounty };
12 changes: 12 additions & 0 deletions common/actions/schedule/actionCreators/windowSize.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { SetCurrentWindowSizeAction } from '../actionTypes/windowSize';
import { TypeKeys } from 'actions/schedule';

type TSetCurrentWindowSize = typeof setCurrentWindowSize;
const setCurrentWindowSize = (
payload: SetCurrentWindowSizeAction['payload']
): SetCurrentWindowSizeAction => ({
type: TypeKeys.CURRENT_WINDOW_SIZE_SET,
payload
});

export { setCurrentWindowSize, TSetCurrentWindowSize };
12 changes: 12 additions & 0 deletions common/actions/schedule/actionCreators/windowStart.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { SetCurrentWindowStartAction } from '../actionTypes/windowStart';
import { TypeKeys } from 'actions/schedule';

type TSetCurrentWindowStart = typeof setCurrentWindowStart;
const setCurrentWindowStart = (
payload: SetCurrentWindowStartAction['payload']
): SetCurrentWindowStartAction => ({
type: TypeKeys.CURRENT_WINDOW_START_SET,
payload
});

export { setCurrentWindowStart, TSetCurrentWindowStart };
Loading

0 comments on commit 6f32bdc

Please sign in to comment.