Skip to content

Commit

Permalink
[DDW-460] Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
thedanheller committed Mar 13, 2019
1 parent 1ebc66c commit 926ed5a
Show file tree
Hide file tree
Showing 12 changed files with 529 additions and 109 deletions.
1 change: 0 additions & 1 deletion source/renderer/app/components/loading/Loading.js
Expand Up @@ -464,7 +464,6 @@ export default class Loading extends Component<Props, State> {
isNodeTimeCorrect={isNodeTimeCorrect}
isNodeSyncing={isNodeSyncing}
/>

</div>
);
}
Expand Down
38 changes: 19 additions & 19 deletions source/renderer/app/components/loading/StatusIcons.js
@@ -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';
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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',
},
});

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

export default class StatusIcon extends Component<Props> {

static contextTypes = {
intl: intlShape.isRequired,
};
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 3 additions & 5 deletions source/renderer/app/components/loading/StatusIcons.scss
@@ -1,4 +1,3 @@

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

}

.icon-on path:nth-of-type(2) {
Expand All @@ -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);
Expand All @@ -35,6 +34,5 @@
}
}
.icon-unknown {
opacity: .3;
opacity: 0.3;
}

5 changes: 2 additions & 3 deletions source/renderer/app/containers/Root.js
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions source/renderer/app/i18n/locales/de-DE.json
Expand Up @@ -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",
Expand Down

0 comments on commit 926ed5a

Please sign in to comment.