diff --git a/src/js/components/Ballot/PositionItem.jsx b/src/js/components/Ballot/PositionItem.jsx index 417b71298..f2fa484f9 100644 --- a/src/js/components/Ballot/PositionItem.jsx +++ b/src/js/components/Ballot/PositionItem.jsx @@ -6,6 +6,7 @@ export default class PositionItem extends Component { static propTypes = { position_we_vote_id: PropTypes.string.isRequired, last_updated: PropTypes.string, + speaker_type: PropTypes.string, speaker_image_url_https: PropTypes.string, candidate_display_name: PropTypes.string.isRequired, speaker_display_name: PropTypes.string.isRequired @@ -17,8 +18,30 @@ export default class PositionItem extends Component { var dateText = moment(dateStr).startOf("day").fromNow(); var speaker_we_vote_id_link = "/voterguide/" + position.speaker_we_vote_id; + let image_placeholder = ""; + if (this.props.speaker_type == "O") { + image_placeholder = + } else if (this.props.speaker_type == "V") { + image_placeholder = + } + + let position_description = ; + if (position.vote_smart_rating) { + position_description =

+ rates {this.props.candidate_display_name} {position.vote_smart_rating}% + { position.vote_smart_time_span ? + in {position.vote_smart_time_span} : + { dateText } } +

; + } else if (position.speaker_type == "V") { + position_description =

+ {this.props.candidate_display_name} + { dateText } +

; + } + return
- {/* One organization's Position on this Candidate */} + {/* One Position on this Candidate */}
  • @@ -28,20 +51,18 @@ export default class PositionItem extends Component { src={this.props.speaker_image_url_https} width="50px" /> : - } + image_placeholder }

    - { this.props.speaker_display_name }
    + { this.props.speaker_display_name } + { position.is_support && !position.vote_smart_rating ? +  support : } + { position.is_oppose && !position.vote_smart_rating ? +  oppose : } +

    -

    rates {this.props.candidate_display_name} - { position.vote_smart_rating ? - {position.vote_smart_rating}% : - } - { position.vote_smart_time_span ? - in {position.vote_smart_time_span} : - { dateText } } -

    + { position_description }