migrated voters screen

This commit is contained in:
Nouman Tahir 2022-08-07 13:21:23 +05:00
parent 054d724d6e
commit 62c0c5b579

View File

@ -1,5 +1,4 @@
import React, { useState, useEffect } from 'react';
import { SafeAreaView } from 'react-native';
import { useIntl } from 'react-intl';
import get from 'lodash/get';
import forEach from 'lodash/forEach';
@ -16,9 +15,10 @@ import { getResizedAvatar } from '../../../utils/image';
const filterOptions = ['rewards', 'percent', 'time'];
const VotersScreen = ({ navigation }) => {
const VotersScreen = ({ route, navigation }) => {
const intl = useIntl();
const [content, setContent] = useState(get(navigation, 'state.params.content'));
const [content, setContent] = useState(route.params?.content ?? null);
const [activeVotes, setActiveVotes] = useState(get(content, 'active_votes') || []);
const [isLoading, setIsLoading] = useState(false);
@ -49,9 +49,6 @@ const VotersScreen = ({ navigation }) => {
}
}, [content]);
//const activeVotes = get(navigation, 'state.params.activeVotes');
//const content = get(navigation, 'state.params.content');
return (
<AccountListContainer data={activeVotes}>
{({ data, filterResult, filterIndex, handleOnVotersDropdownSelect, handleSearch }) => (