Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cfbbbd7
commit 83a22dd
Showing
4 changed files
with
18 additions
and
199 deletions.
There are no files selected for viewing
100 changes: 18 additions & 82 deletions
100
source/renderer/app/components/voting/VotingUnavailable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters