Skip to content
Permalink
Browse files

[DDW-460] Lint

  • Loading branch information...
daniloprates committed Mar 13, 2019
1 parent 1ebc66c commit 926ed5a97ae522673fe2dfbe3e0a2a18e1b47b1f
@@ -464,7 +464,6 @@ export default class Loading extends Component<Props, State> {
isNodeTimeCorrect={isNodeTimeCorrect}
isNodeSyncing={isNodeSyncing}
/>

</div>
);
}
@@ -1,7 +1,6 @@
// @flow
import React, { Component } from 'react';
import { defineMessages, intlShape, FormattedHTMLMessage, FormattedMessage } from 'react-intl';
import { camelCase } from 'lodash';
import { defineMessages, intlShape, FormattedHTMLMessage } from 'react-intl';
import SVGInline from 'react-svg-inline';
import { Tooltip } from 'react-polymorph/lib/components/Tooltip';
import { TooltipSkin } from 'react-polymorph/lib/skins/simple/TooltipSkin';
@@ -80,7 +79,8 @@ const messages = defineMessages({
checkingIfNodeIsResponding: {
id: 'status.icons.checkingIfNodeIsResponding',
defaultMessage: 'Checking if Node is responding!',
description: 'Message "Checking if Node is responding" on the status icon tooltip',
description:
'Message "Checking if Node is responding" on the status icon tooltip',
},
nodeIsSubscribed: {
id: 'status.icons.nodeIsSubscribed',
@@ -95,12 +95,14 @@ const messages = defineMessages({
checkYourInternetConnection: {
id: 'status.icons.checkYourInternetConnection',
defaultMessage: 'Check your Internet connection!',
description: 'Message "Check your Internet connection" on the status icon tooltip',
description:
'Message "Check your Internet connection" on the status icon tooltip',
},
checkingIfNodeIsSubscribed: {
id: 'status.icons.checkingIfNodeIsSubscribed',
defaultMessage: 'Checking if Node is subscribed!',
description: 'Message "Checking if Node is subscribed" on the status icon tooltip',
description:
'Message "Checking if Node is subscribed" on the status icon tooltip',
},
nodeTimeIsCorrect: {
id: 'status.icons.nodeTimeIsCorrect',
@@ -110,12 +112,14 @@ const messages = defineMessages({
nodeTimeIsNotCorrect: {
id: 'status.icons.nodeTimeIsNotCorrect',
defaultMessage: 'Node time is not correct!',
description: 'Message "Node time is not correct" on the status icon tooltip',
description:
'Message "Node time is not correct" on the status icon tooltip',
},
checkingIfNodeTimeIsCorrect: {
id: 'status.icons.checkingIfNodeTimeIsCorrect',
defaultMessage: 'Checking if Node time is correct!',
description: 'Message "Checking if Node time is correct" on the status icon tooltip',
description:
'Message "Checking if Node time is correct" on the status icon tooltip',
},
nodeIsSyncing: {
id: 'status.icons.nodeIsSyncing',
@@ -130,7 +134,8 @@ const messages = defineMessages({
checkingIfNodeIsSyncing: {
id: 'status.icons.checkingIfNodeIsSyncing',
defaultMessage: 'Checking if Node is syncing!',
description: 'Message "Checking if Node is syncing" on the status icon tooltip',
description:
'Message "Checking if Node is syncing" on the status icon tooltip',
},
});

@@ -186,7 +191,6 @@ const MESSAGES = {
};

export default class StatusIcon extends Component<Props> {

static contextTypes = {
intl: intlShape.isRequired,
};
@@ -195,12 +199,8 @@ export default class StatusIcon extends Component<Props> {
let paramPrefix = paramName;
if (paramName === 'nodeState' && paramValue) paramPrefix = '';
const message = MESSAGES[`${paramPrefix}${String(paramValue)}`];
return message && (
<FormattedHTMLMessage
{...message}
/>
);
}
return message && <FormattedHTMLMessage {...message} />;
};

getClassName = (paramName: string) => {
// If node is not running, it displays the icons with opacity
@@ -225,11 +225,11 @@ export default class StatusIcon extends Component<Props> {
typeof paramValue === 'undefined' ? tooltipStyles.ellipsis : null,
this.isDisabled(paramName) ? tooltipStyles.disabled : null,
]);
}
};

isDisabled = (paramName: string) => (
paramName !== 'nodeState' && this.props.nodeState !== CardanoNodeStates.RUNNING
);
isDisabled = (paramName: string) =>
paramName !== 'nodeState' &&
this.props.nodeState !== CardanoNodeStates.RUNNING;

getIconWithToolTip = (icon: string, paramName: string) => (
<Tooltip
@@ -1,4 +1,3 @@

.component {
bottom: 20px;
display: flex;
@@ -13,7 +12,6 @@
height: 24px;
}
}

}

.icon-on path:nth-of-type(2) {
@@ -22,7 +20,8 @@
.icon-off path:nth-of-type(2) {
fill: var(--theme-loading-status-icons-off-color);
}
.icon-unloaded, .icon-unknown {
.icon-unloaded,
.icon-unknown {
&.syncing {
path:nth-of-type(2) {
fill: var(--theme-loading-status-icons-unloaded-syncing-color);
@@ -35,6 +34,5 @@
}
}
.icon-unknown {
opacity: .3;
opacity: 0.3;
}

@@ -25,10 +25,9 @@ export default class Root extends Component<Props> {
isNotEnoughDiskSpace,
} = networkStatus;

const isPageThatDoesntNeedWallets = (
const isPageThatDoesntNeedWallets =
isBlockConsolidationStatusPage ||
(isAdaRedemptionPage && hasLoadedWallets && isSynced)
);
(isAdaRedemptionPage && hasLoadedWallets && isSynced);

// In case node is in stopping sequence we must show the "Connecting" screen
// with the "Stopping Cardano node..." and "Cardano node stopped" messages
@@ -178,6 +178,29 @@
"static.about.copyright": "!!!Input Output HK Limited. Licensed under",
"static.about.license": "!!!MIT licence",
"static.about.title": "!!!Daedalus",
"status.icons.checkYourInternetConnection": "Check your Internet connection!",
"status.icons.checkingIfNodeIsResponding": "Checking if Node is responding!",
"status.icons.checkingIfNodeIsSubscribed": "Checking if Node is subscribed!",
"status.icons.checkingIfNodeIsSyncing": "Checking if Node is syncing!",
"status.icons.checkingIfNodeTimeIsCorrect": "Checking if Node time is correct!",
"status.icons.nodeHasBeenUpdated": "Node has been updated!",
"status.icons.nodeHasCrashed": "Node has crashed!",
"status.icons.nodeHasErrored": "Node has errored!",
"status.icons.nodeHasStopped": "Node has stopped!",
"status.icons.nodeIsExiting": "Node is exiting!",
"status.icons.nodeIsNotResponding": "Node is not responding!",
"status.icons.nodeIsNotSubscribed": "Node is not subscribed!",
"status.icons.nodeIsNotSyncing": "Node is not syncing!",
"status.icons.nodeIsResponding": "Node is responding!",
"status.icons.nodeIsRunning": "Node is running!",
"status.icons.nodeIsStarting": "Node is starting!",
"status.icons.nodeIsStopping": "Node is stopping!",
"status.icons.nodeIsSubscribed": "Node is subscribed!",
"status.icons.nodeIsSyncing": "Node is syncing!",
"status.icons.nodeIsUnrecoverable": "Node is unrecoverable!",
"status.icons.nodeIsUpdating": "Node is updating!",
"status.icons.nodeTimeIsCorrect": "Node time is correct!",
"status.icons.nodeTimeIsNotCorrect": "Node time is not correct!",
"systemTime.error.ntpUnreachableTextP1": "!!!Attention, Daedalus is unable to check if the clock on your computer is synchronized with global time because NTP (Network Time Protocol) servers are unreachable, possibly due to firewalls on your network.",
"systemTime.error.ntpUnreachableTextP2": "!!!If your computer clock is off by more than 15 seconds, Daedalus will be unable to connect to the network. If you have this issue, please read our Support Portal article to synchronize the time on your machine.",
"systemTime.error.onCheckTheTimeAgainLink": "!!!Check the time again",
Oops, something went wrong.

0 comments on commit 926ed5a

Please sign in to comment.
You can’t perform that action at this time.