Skip to content

Commit

Permalink
[DDW-796] Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-barros committed Dec 2, 2021
1 parent ce25a01 commit 5874e93
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 199 deletions.
100 changes: 18 additions & 82 deletions source/renderer/app/components/voting/VotingUnavailable.js
@@ -1,94 +1,30 @@
// @flow
import React, { Component } from 'react';
import React from 'react';
import { observer } from 'mobx-react';
import {
defineMessages,
intlShape,
FormattedMessage,
FormattedHTMLMessage,
} from 'react-intl';
import { FormattedHTMLMessage } from 'react-intl';
import BigNumber from 'bignumber.js';
import { Link } from 'react-polymorph/lib/components/Link';
import globalMessages from '../../i18n/global-messages';
import LoadingSpinner from '../widgets/LoadingSpinner';
import {
CURRENT_VOTING_FUND_NUMBER,
NEXT_VOTING_FUND_NUMBER,
} from '../../config/votingConfig';
import styles from './VotingUnavailable.scss';

const messages = defineMessages({
heading: {
id: 'voting.unavailable.heading',
defaultMessage: '!!!Project Catalyst voting registration',
description: 'Headline for the "Voting unavailable" screen',
},
paragraph1: {
id: 'voting.unavailable.paragraph1',
defaultMessage:
'!!!Project Catalyst Fund{currentVotingFundNumber} has now ended. Fund{nextVotingFundNumber} is currently in preparation, voting registration is not available yet.',
description: 'First paragraph on the "Voting unavailable" screen',
},
paragraph2: {
id: 'voting.unavailable.paragraph2',
defaultMessage:
'!!!Join our {link1} and {link2} Telegram channels for the latest updates (English language only).',
description: 'Second paragraph on the "Voting unavailable" screen',
},
link1Text: {
id: 'voting.unavailable.link1Text',
defaultMessage: '!!!Catalyst Announcements',
description: 'First link text on the "Voting unavailable" screen',
},
link2Text: {
id: 'voting.unavailable.link2Text',
defaultMessage: '!!!Project Catalyst Chat',
description: 'Second link text on the "Voting unavailable" screen',
},
link1Url: {
id: 'voting.unavailable.link1Url',
defaultMessage: '!!!https://t.me/cardanocatalyst',
description: 'First link URL on the "Voting unavailable" screen',
},
link2Url: {
id: 'voting.unavailable.link2Url',
defaultMessage: '!!!https://t.me/ProjectCatalystChat',
description: 'Second link URL on the "Voting unavailable" screen',
},
});

type Props = {
syncPercentage: number,
isVotingRegistrationAvailable: boolean,
onExternalLinkClick: Function,
};

@observer
export default class VotingUnavailable extends Component<Props> {
static contextTypes = {
intl: intlShape.isRequired,
};

render() {
const { intl } = this.context;
const {
syncPercentage,
isVotingRegistrationAvailable,
onExternalLinkClick,
} = this.props;

return (
<div className={styles.component}>
<LoadingSpinner big />
<div className={styles.description}>
<FormattedHTMLMessage
{...globalMessages.featureUnavailableWhileSyncing}
values={{
syncPercentage: new BigNumber(syncPercentage).toFormat(2),
}}
/>
</div>
const VotingUnavailable = ({ syncPercentage }: Props) => {
return (
<div className={styles.component}>
<LoadingSpinner big />
<div className={styles.description}>
<FormattedHTMLMessage
{...globalMessages.featureUnavailableWhileSyncing}
values={{
syncPercentage: new BigNumber(syncPercentage).toFormat(2),
}}
/>
</div>
);
}
}
</div>
);
};

export default observer(VotingUnavailable);
103 changes: 0 additions & 103 deletions source/renderer/app/i18n/locales/defaultMessages.json
Expand Up @@ -9013,109 +9013,6 @@
],
"path": "source/renderer/app/components/voting/VotingNoWallets.json"
},
{
"descriptors": [
{
"defaultMessage": "!!!Project Catalyst voting registration",
"description": "Headline for the \"Voting unavailable\" screen",
"end": {
"column": 3,
"line": 25
},
"file": "source/renderer/app/components/voting/VotingUnavailable.js",
"id": "voting.unavailable.heading",
"start": {
"column": 11,
"line": 21
}
},
{
"defaultMessage": "!!!Project Catalyst Fund{currentVotingFundNumber} has now ended. Fund{nextVotingFundNumber} is currently in preparation, voting registration is not available yet.",
"description": "First paragraph on the \"Voting unavailable\" screen",
"end": {
"column": 3,
"line": 31
},
"file": "source/renderer/app/components/voting/VotingUnavailable.js",
"id": "voting.unavailable.paragraph1",
"start": {
"column": 14,
"line": 26
}
},
{
"defaultMessage": "!!!Join our {link1} and {link2} Telegram channels for the latest updates (English language only).",
"description": "Second paragraph on the \"Voting unavailable\" screen",
"end": {
"column": 3,
"line": 37
},
"file": "source/renderer/app/components/voting/VotingUnavailable.js",
"id": "voting.unavailable.paragraph2",
"start": {
"column": 14,
"line": 32
}
},
{
"defaultMessage": "!!!Catalyst Announcements",
"description": "First link text on the \"Voting unavailable\" screen",
"end": {
"column": 3,
"line": 42
},
"file": "source/renderer/app/components/voting/VotingUnavailable.js",
"id": "voting.unavailable.link1Text",
"start": {
"column": 13,
"line": 38
}
},
{
"defaultMessage": "!!!Project Catalyst Chat",
"description": "Second link text on the \"Voting unavailable\" screen",
"end": {
"column": 3,
"line": 47
},
"file": "source/renderer/app/components/voting/VotingUnavailable.js",
"id": "voting.unavailable.link2Text",
"start": {
"column": 13,
"line": 43
}
},
{
"defaultMessage": "!!!https://t.me/cardanocatalyst",
"description": "First link URL on the \"Voting unavailable\" screen",
"end": {
"column": 3,
"line": 52
},
"file": "source/renderer/app/components/voting/VotingUnavailable.js",
"id": "voting.unavailable.link1Url",
"start": {
"column": 12,
"line": 48
}
},
{
"defaultMessage": "!!!https://t.me/ProjectCatalystChat",
"description": "Second link URL on the \"Voting unavailable\" screen",
"end": {
"column": 3,
"line": 57
},
"file": "source/renderer/app/components/voting/VotingUnavailable.js",
"id": "voting.unavailable.link2Url",
"start": {
"column": 12,
"line": 53
}
}
],
"path": "source/renderer/app/components/voting/VotingUnavailable.json"
},
{
"descriptors": [
{
Expand Down
7 changes: 0 additions & 7 deletions source/renderer/app/i18n/locales/en-US.json
Expand Up @@ -649,13 +649,6 @@
"voting.snapshotPhase.votingDateLabel": "Next voting period:",
"voting.tallyingPhase.endDateLabel": "Voting ended:",
"voting.tallyingPhase.resultsLabel": "Check back for results:",
"voting.unavailable.heading": "Project Catalyst voting registration",
"voting.unavailable.link1Text": "Catalyst Announcements",
"voting.unavailable.link1Url": "https://t.me/cardanocatalyst",
"voting.unavailable.link2Text": "Project Catalyst Chat",
"voting.unavailable.link2Url": "https://t.me/ProjectCatalystChat",
"voting.unavailable.paragraph1": "Project Catalyst Fund{currentVotingFundNumber} has now ended. Fund{nextVotingFundNumber} is currently in preparation, voting registration is not available yet.",
"voting.unavailable.paragraph2": "Join our {link1} and {link2} Telegram channels for the latest updates (English language only).",
"voting.votingOpenPhase.dateLabel": "Voting period is open:",
"voting.votingOpenPhase.instruction": "Use mobile app to vote",
"voting.votingRegistration.chooseWallet.step.continueButtonLabel": "Continue",
Expand Down
7 changes: 0 additions & 7 deletions source/renderer/app/i18n/locales/ja-JP.json
Expand Up @@ -649,13 +649,6 @@
"voting.snapshotPhase.votingDateLabel": "!!!Next voting period:",
"voting.tallyingPhase.endDateLabel": "!!!Voting ended:",
"voting.tallyingPhase.resultsLabel": "!!!Check back for results:",
"voting.unavailable.heading": "Project Catalyst有権者登録",
"voting.unavailable.link1Text": "Catalyst案内",
"voting.unavailable.link1Url": "https://t.me/cardanocatalyst",
"voting.unavailable.link2Text": "Project Catalyst Chat",
"voting.unavailable.link2Url": "https://t.me/ProjectCatalystChat",
"voting.unavailable.paragraph1": "Project Catalyst Fund{currentVotingFundNumber}は終了しました。現在Fund{nextVotingFundNumber}は準備中です。有権者登録の開始までしばらくお待ちください。",
"voting.unavailable.paragraph2": "!最新情報は、{link1}やTelegramの{link2}でチェックしてください(英語のみ)。",
"voting.votingOpenPhase.dateLabel": "!!!Voting period is open:",
"voting.votingOpenPhase.instruction": "!!!Use mobile app to vote",
"voting.votingRegistration.chooseWallet.step.continueButtonLabel": "続ける",
Expand Down

0 comments on commit 5874e93

Please sign in to comment.