Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nt/voters list fix #2884

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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>}
Expand Down Expand Up @@ -80,7 +80,7 @@ const UserListItem = ({
<Text style={[styles.date, descriptionStyle]}>{description}</Text>
)}
</View>
{middleText && (
{!!middleText && (
<View style={styles.middleWrapper}>
<Text
style={[
Expand Down Expand Up @@ -132,7 +132,7 @@ const UserListItem = ({
>
{rightText}
</Text>
{subRightText && <Text style={styles.text}>{subRightText}</Text>}
{!!subRightText && <Text style={styles.text}>{subRightText}</Text>}
</>
</TouchableOpacity>
<Popover
Expand Down
2 changes: 1 addition & 1 deletion src/components/votersDisplay/view/votersDisplayView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down