// @flow import * as React from 'react'; import {Avatar, Card, Paragraph, withTheme} from 'react-native-paper'; import {StyleSheet} from 'react-native'; import i18n from 'i18n-js'; import type {CustomThemeType} from '../../../managers/ThemeManager'; import type {CardTitleIconPropsType} from '../../../constants/PaperStyles'; type PropsType = { startDate: string | null, justVoted: boolean, hasVoted: boolean, isVoteRunning: boolean, theme: CustomThemeType, }; const styles = StyleSheet.create({ card: { margin: 10, }, icon: { backgroundColor: 'transparent', }, }); class VoteWait extends React.Component { shouldComponentUpdate(): boolean { return false; } render(): React.Node { const {props} = this; const {startDate} = props; return ( ( )} /> {props.justVoted ? ( {i18n.t('screens.vote.wait.messageSubmitted')} ) : null} {props.hasVoted ? ( {i18n.t('screens.vote.wait.messageVoted')} ) : null} {startDate != null ? ( {`${i18n.t('screens.vote.wait.messageDate')} ${startDate}`} ) : ( {i18n.t('screens.vote.wait.messageDateUndefined')} )} ); } } export default withTheme(VoteWait);