-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #390 from SquareTable/389-feat-add-vote-view-page-…
…for-polls feat: added poll vote view page
- Loading branch information
Showing
3 changed files
with
75 additions
and
18 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import ItemAutoList from '../components/ItemAutoList'; | ||
import TopNavBar from '../components/TopNavBar'; | ||
import useItemReducer from '../hooks/useItemReducer'; | ||
import UserItem from "../components/Users/UserItem"; | ||
|
||
export default function PollVoteViewPage({route}) { | ||
const {pollId, pollOption} = route.params; | ||
const [state, dispatch] = useItemReducer(); | ||
|
||
return ( | ||
<> | ||
<TopNavBar screenName={`Votes on Option ${pollOption}`}/> | ||
<ItemAutoList | ||
noItemsFoundText="No votes could be found." | ||
centreIfNoItems | ||
url="/tempRoute/getpollvoteusers" | ||
extraPOSTData={{ | ||
pollId, | ||
pollOption | ||
}} | ||
DisplayComponent={UserItem} | ||
extraProps={{ | ||
getItemLayout: (data, index) => { | ||
return { | ||
length: 70, | ||
offset: 70 * index, | ||
index | ||
} | ||
} | ||
}} | ||
state={state} | ||
dispatch={dispatch} | ||
noMoreItemsText="No more votes left." | ||
/> | ||
</> | ||
) | ||
} |