Merge pull request #2884 from ecency/nt/voters-list-fix

Nt/voters list fix
This commit is contained in:
Feruz M 2024-06-07 17:37:04 +03:00 committed by GitHub
commit a95a0b9707
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -49,7 +49,7 @@ const UserListItem = ({
>
<View style={[styles.voteItemWrapper, index % 2 === 1 && styles.voteItemWrapperGray]}>
{leftItemRenderer && leftItemRenderer()}
{itemIndex && <Text style={styles.itemIndex}>{itemIndex}</Text>}
{!!itemIndex && <Text style={styles.itemIndex}>{itemIndex}</Text>}
<UserAvatar noAction={true} style={styles.avatar} username={username} />
<View style={styles.userDescription}>
{!searchValue && <Text style={styles.name}>{text || username}</Text>}
@ -80,7 +80,7 @@ const UserListItem = ({
<Text style={[styles.date, descriptionStyle]}>{description}</Text>
)}
</View>
{middleText && (
{!!middleText && (
<View style={styles.middleWrapper}>
<Text
style={[
@ -132,7 +132,7 @@ const UserListItem = ({
>
{rightText}
</Text>
{subRightText && <Text style={styles.text}>{subRightText}</Text>}
{!!subRightText && <Text style={styles.text}>{subRightText}</Text>}
</>
</TouchableOpacity>
<Popover

View File

@ -29,7 +29,7 @@ const VotersDisplayView = ({ votes, createdAt = '2010-01-01T00:00:00' }) => {
const _renderItem = ({ item, index }) => {
const value = item.reward && `$ ${item.reward}`;
const percent = item.percent100 && `${item.percent100}%`;
const percent = !isNaN(item.percent100) && `${item.percent100}%`;
// snippet to avoid rendering time form long past
const minTimestamp = new Date(createdAt).getTime();