mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 03:11:38 +03:00
Comment changes
This commit is contained in:
parent
12de7fb619
commit
9578dfa4fd
@ -53,12 +53,12 @@ class UpvoteContainer extends PureComponent {
|
||||
} = this.props;
|
||||
|
||||
const author = get(content, 'author');
|
||||
const isVoted = get(content, 'is_voted')
|
||||
? parseInt(get(content, 'is_voted'), 10) / 10000
|
||||
: false;
|
||||
const isDownVoted = get(content, 'is_down_voted')
|
||||
? (parseInt(get(content, 'is_down_voted', false), 10) / 10000) * -1
|
||||
: false;
|
||||
const isVoted =
|
||||
get(content, 'is_voted', false) && parseInt(get(content, 'is_voted'), 10) / 10000;
|
||||
const isDownVoted =
|
||||
get(content, 'is_down_voted', false) &&
|
||||
(parseInt(get(content, 'is_down_voted'), 10) / 10000) * -1;
|
||||
|
||||
const totalPayout = get(content, 'total_payout');
|
||||
const isDecinedPayout = get(content, 'is_declined_payout');
|
||||
const permlink = get(content, 'permlink');
|
||||
|
@ -224,7 +224,7 @@ class UpvoteView extends Component {
|
||||
const _percent = `${downvote ? '-' : ''}${(sliderValue * 100).toFixed(0)}%`;
|
||||
const _amount = `$${amount}`;
|
||||
const _totalPayout = totalPayout || '0.000';
|
||||
const _sliderColor = downvote ? '#ec8b88' : '#357ce6';
|
||||
const sliderColor = downvote ? '#ec8b88' : '#357ce6';
|
||||
|
||||
return (
|
||||
<PopoverController>
|
||||
@ -249,20 +249,12 @@ class UpvoteView extends Component {
|
||||
isShow={!isVoting}
|
||||
/>
|
||||
</View>
|
||||
) : isDownVoted ? (
|
||||
<Icon
|
||||
size={20}
|
||||
style={[styles.upvoteIcon, { color: '#ec8b88' }]}
|
||||
active={!isLoggedIn}
|
||||
iconType="AntDesign"
|
||||
name="downcircle"
|
||||
/>
|
||||
) : (
|
||||
<Icon
|
||||
style={[styles.upvoteIcon]}
|
||||
style={[styles.upvoteIcon, isDownVoted && { color: '#ec8b88' }]}
|
||||
active={!isLoggedIn}
|
||||
iconType={iconType}
|
||||
name={iconName}
|
||||
iconType={isDownVoted ? 'AntDesign' : iconType}
|
||||
name={isDownVoted ? 'downcircle' : iconName}
|
||||
/>
|
||||
)}
|
||||
</Fragment>
|
||||
@ -342,7 +334,7 @@ class UpvoteView extends Component {
|
||||
<Text style={styles.amount}>{_amount}</Text>
|
||||
<Slider
|
||||
style={styles.slider}
|
||||
minimumTrackTintColor={_sliderColor}
|
||||
minimumTrackTintColor={sliderColor}
|
||||
trackStyle={styles.track}
|
||||
thumbStyle={styles.thumb}
|
||||
thumbTintColor="#007ee5"
|
||||
|
@ -160,7 +160,7 @@ const isVoted = (activeVotes, currentUserName) => {
|
||||
|
||||
const isDownVoted = (activeVotes, currentUserName) => {
|
||||
const result = activeVotes.find(
|
||||
element => element.voter === currentUserName && element.percent < 0,
|
||||
element => get(element, 'voter') === currentUserName && get(element, 'percent') < 0,
|
||||
);
|
||||
if (result) {
|
||||
return result.percent;
|
||||
|
Loading…
Reference in New Issue
Block a user