Skip to content

Commit 919aa78

Browse files
author
Lucas Araujo
committed
[DDW-796] Review changes
1 parent 754d5e4 commit 919aa78

File tree

13 files changed

+63
-81
lines changed

13 files changed

+63
-81
lines changed

source/renderer/app/components/voting/VotingUnavailable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import React from 'react';
33
import { observer } from 'mobx-react';
44
import { FormattedHTMLMessage } from 'react-intl';
5-
import BigNumber from 'bignumber.js';
65
import globalMessages from '../../i18n/global-messages';
76
import LoadingSpinner from '../widgets/LoadingSpinner';
87
import styles from './VotingUnavailable.scss';
8+
import { formattedNumber } from '../../utils/formatters';
99

1010
type Props = {
1111
syncPercentage: number,
@@ -19,7 +19,7 @@ const VotingUnavailable = ({ syncPercentage }: Props) => {
1919
<FormattedHTMLMessage
2020
{...globalMessages.featureUnavailableWhileSyncing}
2121
values={{
22-
syncPercentage: new BigNumber(syncPercentage).toFormat(2),
22+
syncPercentage: formattedNumber(syncPercentage, 2),
2323
}}
2424
/>
2525
</div>

source/renderer/app/components/voting/voting-info/RegisterToVote.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import {
1313
} from '../../../utils/formatters';
1414
import type { Locale } from '../../../../../common/types/locales.types';
1515
import type { Intl } from '../../../types/i18nTypes';
16-
import styles from './RegisterToVote.scss';
1716
import { messages } from './RegisterToVote.messages';
17+
import { messages as votingMessages } from './VotingInfo.messages';
18+
import styles from './RegisterToVote.scss';
19+
import votingStyles from './VotingInfo.scss';
1820

1921
type Props = {
2022
currentLocale: Locale,
@@ -46,15 +48,15 @@ function RegisterToVote({
4648
return (
4749
<div className={styles.root}>
4850
<span className={styles.title}>
49-
{intl.formatMessage(messages.name, {
50-
nextVotingFundNumber: NEXT_VOTING_FUND_NUMBER,
51+
{intl.formatMessage(votingMessages.fundName, {
52+
votingFundNumber: NEXT_VOTING_FUND_NUMBER,
5153
})}
5254
</span>
5355
<span className={styles.dateLabel}>
5456
{intl.formatMessage(messages.dateLabel)}
5557
</span>
5658
<span className={styles.date}>{castEndDate}</span>
57-
<hr />
59+
<hr className={votingStyles.separator} />
5860
<span className={styles.stepsTitle}>
5961
{intl.formatMessage(messages.stepsTitle)}
6062
</span>

source/renderer/app/components/voting/voting-info/RegisterToVote.messages.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
import { defineMessages } from 'react-intl';
33

44
export const messages = defineMessages({
5-
name: {
6-
id: 'voting.registerToVote.name',
7-
defaultMessage: '!!!Fund{nextVotingFundNumber}',
8-
description: 'Regiter to fund name',
9-
},
105
dateLabel: {
116
id: 'voting.registerToVote.dateLabel',
127
defaultMessage: '!!!Snapshot date:',

source/renderer/app/components/voting/voting-info/ResultsPhase.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import {
1313
import type { Locale } from '../../../../../common/types/locales.types';
1414
import { ExternalLinkButton } from '../../widgets/ExternalLinkButton';
1515
import type { Intl } from '../../../types/i18nTypes';
16-
import styles from './CurrentPhase.scss';
1716
import { messages } from './ResultsPhase.messages';
18-
import { messages as currentPhaseMessages } from './CurrentPhase.messages';
17+
import { messages as votingMessages } from './VotingInfo.messages';
18+
import styles from './CurrentPhase.scss';
1919

2020
type Props = {
2121
currentLocale: Locale,
@@ -47,8 +47,8 @@ function ResultsPhase({
4747
return (
4848
<section className={styles.root}>
4949
<h1 className={styles.fundName}>
50-
{intl.formatMessage(currentPhaseMessages.currentFundName, {
51-
currentVotingFundNumber: CURRENT_VOTING_FUND_NUMBER,
50+
{intl.formatMessage(votingMessages.fundName, {
51+
votingFundNumber: CURRENT_VOTING_FUND_NUMBER,
5252
})}
5353
</h1>
5454

source/renderer/app/components/voting/voting-info/ResultsPhase.messages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export const messages = defineMessages({
1010
viewResultsLinkLabel: {
1111
id: 'voting.resultsPhase.viewResultsLinkLabel',
1212
defaultMessage: '!!!View results',
13-
description: 'View resuls link label for Fund{currentVotingFundNumber}',
13+
description: 'View results link label',
1414
},
1515
viewResultsLinkURL: {
1616
id: 'voting.resultsPhase.viewResultsLinkURL',
1717
defaultMessage: 'https://cardano.ideascale.com/a/pages/results',
18-
description: 'View results from Fund{currentVotingFundNumber}',
18+
description: 'View results link',
1919
},
2020
});

source/renderer/app/components/voting/voting-info/SnapshotPhase.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type { Locale } from '../../../../../common/types/locales.types';
1616
import type { Intl } from '../../../types/i18nTypes';
1717
import styles from './CurrentPhase.scss';
1818
import { messages } from './SnapshotPhase.messages';
19-
import { messages as currentPhase } from './CurrentPhase.messages';
19+
import { messages as votingMessages } from './VotingInfo.messages';
2020

2121
type Props = {
2222
currentLocale: Locale,
@@ -56,8 +56,8 @@ function SnapshotPhase({
5656
return (
5757
<section className={styles.root}>
5858
<h1 className={styles.fundName}>
59-
{intl.formatMessage(currentPhase.currentFundName, {
60-
currentVotingFundNumber: CURRENT_VOTING_FUND_NUMBER,
59+
{intl.formatMessage(votingMessages.fundName, {
60+
votingFundNumber: CURRENT_VOTING_FUND_NUMBER,
6161
})}
6262
</h1>
6363
<div className={styles.block}>

source/renderer/app/components/voting/voting-info/TallyingPhase.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type { Locale } from '../../../../../common/types/locales.types';
1515
import type { Intl } from '../../../types/i18nTypes';
1616
import styles from './CurrentPhase.scss';
1717
import { messages } from './TallyingPhase.messages';
18-
import { messages as currentPhaseMessages } from './CurrentPhase.messages';
18+
import { messages as votingMessages } from './VotingInfo.messages';
1919

2020
type Props = {
2121
currentLocale: Locale,
@@ -49,8 +49,8 @@ function TallyingPhase({
4949
return (
5050
<section className={styles.root}>
5151
<h1 className={styles.fundName}>
52-
{intl.formatMessage(currentPhaseMessages.currentFundName, {
53-
currentVotingFundNumber: CURRENT_VOTING_FUND_NUMBER,
52+
{intl.formatMessage(votingMessages.fundName, {
53+
votingFundNumber: CURRENT_VOTING_FUND_NUMBER,
5454
})}
5555
</h1>
5656
<div className={styles.block}>

source/renderer/app/components/voting/voting-info/CurrentPhase.messages.js renamed to source/renderer/app/components/voting/voting-info/VotingInfo.messages.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import { defineMessages } from 'react-intl';
33

44
export const messages = defineMessages({
5-
currentFundName: {
6-
id: 'voting.currentPhase.fundName',
7-
defaultMessage: '!!!Fund{currentVotingFundNumber}',
5+
fundName: {
6+
id: 'voting.fundName',
7+
defaultMessage: '!!!Fund{votingFundNumber}',
88
description: 'Current fund name',
99
},
1010
});

source/renderer/app/components/voting/voting-info/VotingInfo.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
flex: 1 0 0;
55
padding: 20px;
66

7-
hr {
7+
.separator {
88
border: 1px solid var(--theme-voting-separator-color);
99
border-bottom-width: 0;
1010
margin: 20px 0;

source/renderer/app/components/voting/voting-info/VotingPhase.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ import {
1313
} from '../../../utils/formatters';
1414
import type { Locale } from '../../../../../common/types/locales.types';
1515
import type { Intl } from '../../../types/i18nTypes';
16-
import styles from './CurrentPhase.scss';
1716
import { messages } from './VotingPhase.messages';
18-
import { messages as currentPhase } from './CurrentPhase.messages';
17+
import { messages as votingMessages } from './VotingInfo.messages';
18+
import styles from './CurrentPhase.scss';
19+
import votingStyles from './VotingInfo.scss';
1920

2021
type Props = {
2122
currentLocale: Locale,
@@ -49,8 +50,8 @@ function VotingPhase({
4950
return (
5051
<section className={styles.root}>
5152
<h1 className={styles.fundName}>
52-
{intl.formatMessage(currentPhase.currentFundName, {
53-
currentVotingFundNumber: CURRENT_VOTING_FUND_NUMBER,
53+
{intl.formatMessage(votingMessages.fundName, {
54+
votingFundNumber: CURRENT_VOTING_FUND_NUMBER,
5455
})}
5556
</h1>
5657
<div className={styles.block}>
@@ -61,7 +62,7 @@ function VotingPhase({
6162
{startDate}{endDate}
6263
</span>
6364
</div>
64-
<hr />
65+
<hr className={votingStyles.separator} />
6566
<div className={styles.block}>
6667
<span className={styles.value}>
6768
{intl.formatMessage(messages.instruction)}

0 commit comments

Comments
 (0)