Skip to content

Commit

Permalink
Merge pull request #200 from SquareTable/165-viewpollpostpage-error-t…
Browse files Browse the repository at this point in the history
…ypeerror-undefined-is-not-an-object-evaluating-polldatapollupordownvoted

Refactored Poll and ViewPollPostPage code
  • Loading branch information
Sebastian-Webster authored Sep 21, 2023
2 parents 8410a1e + cf49e92 commit e0bffc4
Show file tree
Hide file tree
Showing 4 changed files with 578 additions and 1,048 deletions.
37 changes: 4 additions & 33 deletions components/Posts/PollPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,39 +140,8 @@ class Poll extends Component {

navigateToFullScreen = () => {
this.props.navigation.navigate("ViewPollPostPage", {
pollTitle: this.props.post.pollTitle,
pollSubTitle: this.props.post.pollSubTitle,
optionOne: this.props.post.optionOne,
optionOnesColor: this.props.post.optionOnesColor,
optionOnesVotes: this.props.post.optionOnesVotes,
optionOnesBarLength: this.props.post.optionOnesBarLength,
optionTwo: this.props.post.optionTwo,
optionTwosColor: this.props.post.optionTwosColor,
optionTwosVotes: this.props.post.optionTwosCotes,
optionTwosBarLength: this.props.post.optionTwosBarLength,
optionThree: this.props.post.optionThree,
optionThreesColor: this.props.post.optionThreesColor,
optionThreesVotes: this.props.post.optionThreesVotes,
optionThreesBarLength: this.props.post.optionThreesBarLength,
optionFour: this.props.post.optionFour,
optionFoursColor: this.props.post.optionFoursColor,
optionFoursVotes: this.props.post.optionFoursVotes,
optionFoursBarLength: this.props.post.optionFoursBarLength,
optionFive: this.props.post.optionFive,
optionFivesColor: this.props.post.optionFivesColor,
optionFivesVotes: this.props.post.optionFivesVotes,
optionFivesBarLength: this.props.post.optionFivesBarLength,
optionSix: this.props.post.optionSix,
optionSixesColor: this.props.post.optionSixesColor,
optionSixesVotes: this.props.post.optionSixesVotes,
optionSixesBarLength: this.props.post.optionSixesBarLength,
totalNumberOfOptions: this.props.post.totalNumberOfOptions,
pollId: this.props.post.pollId,
creatorPfpB64: this.props.post.pfpB64,
creatorName: this.props.post.creatorName,
creatorDisplayName: this.props.post.creatorDisplayName,
datePosted: this.props.post.datePosted,
votedFor: this.props.post.votedFor
post: this.props.post,
isOwner: this.props.post.isOwner
})
}

Expand Down Expand Up @@ -343,6 +312,8 @@ class Poll extends Component {
}
}

export const PollClass = Poll;

export default function(props) {
const navigation = useNavigation();
const {serverUrl} = useContext(ServerUrlContext);
Expand Down
Loading

0 comments on commit e0bffc4

Please sign in to comment.