1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 03:08:30 +00:00

Remove unused imports & cleanup

This commit is contained in:
Vasek Mlejnsky 2018-09-05 11:43:54 +02:00
parent 61b8a882f3
commit 936daeed74
2 changed files with 9 additions and 15 deletions

View File

@ -1,3 +1,4 @@
import React from 'react'; import React from 'react';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
@ -7,7 +8,6 @@ import Icon from 'components/Icon';
import icons from 'config/icons'; import icons from 'config/icons';
import { FONT_SIZE, FONT_WEIGHT } from 'config/variables'; import { FONT_SIZE, FONT_WEIGHT } from 'config/variables';
import * as NOTIFICATION from 'actions/constants/notification';
import * as NotificationActions from 'actions/NotificationActions'; import * as NotificationActions from 'actions/NotificationActions';
import Loader from 'components/Loader'; import Loader from 'components/Loader';
import NotificationButton from './components/NotificationButton'; import NotificationButton from './components/NotificationButton';

View File

@ -1,14 +1,8 @@
/* @flow */ /* @flow */
import * as React from 'react'; import * as React from 'react';
import { Notification } from 'components/Notification'; import { Notification } from 'components/Notification';
import type { import type { State } from 'flowtype';
State, TrezorDevice, Action, ThunkAction,
} from 'flowtype';
import type { Account } from 'reducers/AccountsReducer';
import type { Discovery } from 'reducers/DiscoveryReducer';
export type StateProps = { export type StateProps = {
className: string; className: string;
@ -63,7 +57,7 @@ const SelectedAccount = (props: Props) => {
return ( return (
<section> <section>
<Notification <Notification
className="info" type="info"
title={`Device ${device.instanceLabel} is disconnected`} title={`Device ${device.instanceLabel} is disconnected`}
message="Connect device to load accounts" message="Connect device to load accounts"
/> />
@ -73,34 +67,34 @@ const SelectedAccount = (props: Props) => {
// case 4: backend is not working // case 4: backend is not working
return ( return (
<section> <section>
<Notification className="warning" title="Backend not working" /> <Notification type="warning" title="Backend not working" />
</section> </section>
); );
} if (discovery.completed) { } if (discovery.completed) {
// case 5: account not found and discovery is completed // case 5: account not found and discovery is completed
return ( return (
<section> <section>
<Notification className="warning" title="Account does not exist" /> <Notification type="warning" title="Account does not exist" />
</section> </section>
); );
} }
// case 6: discovery is not completed yet // case 6: discovery is not completed yet
return ( return (
<section> <section>
<Notification className="info" title="Loading accounts..." /> <Notification type="info" title="Loading accounts..." />
</section> </section>
); );
} }
let notification: ?React$Element<typeof Notification> = null; let notification: ?React$Element<typeof Notification> = null;
if (!device.connected) { if (!device.connected) {
notification = <Notification className="info" title={`Device ${device.instanceLabel} is disconnected`} />; notification = <Notification type="info" title={`Device ${device.instanceLabel} is disconnected`} />;
} else if (!device.available) { } else if (!device.available) {
notification = <Notification className="info" title={`Device ${device.instanceLabel} is unavailable`} message="Change passphrase settings to use this device" />; notification = <Notification type="info" title={`Device ${device.instanceLabel} is unavailable`} message="Change passphrase settings to use this device" />;
} }
if (discovery && !discovery.completed && !notification) { if (discovery && !discovery.completed && !notification) {
notification = <Notification className="info" title="Loading accounts..." />; notification = <Notification type="info" title="Loading accounts..." />;
} }
return ( return (