Merge pull request #1173 from esteemapp/bugfix/profile-summary

Fixed percent bar and cover image issues
This commit is contained in:
uğur erdal 2019-10-01 21:24:52 +03:00 committed by GitHub
commit bec5c01fc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View File

@ -103,7 +103,15 @@ class ProfileSummaryView extends PureComponent {
const isColumn = rowLength && DEVICE_WIDTH / rowLength <= 7.3;
const followButtonIcon = !isFollowing ? 'account-plus' : 'account-minus';
const coverImageUrl = getResizedImage(get(about, 'cover_image'), 400);
let coverImageUrl = getResizedImage(get(about, 'cover_image'), 400);
if (!coverImageUrl) {
coverImageUrl = isDarkTheme
? require('../../../assets/dark_cover_image.png')
: require('../../../assets/default_cover_image.png');
} else {
coverImageUrl = { uri: coverImageUrl };
}
dropdownOptions.push(!isMuted ? 'MUTE' : 'UNMUTE');
@ -126,7 +134,7 @@ class ProfileSummaryView extends PureComponent {
</View>
<Image
style={styles.longImage}
source={{ uri: coverImageUrl }}
source={coverImageUrl}
defaultSource={isDarkTheme ? DARK_COVER_IMAGE : LIGHT_COVER_IMAGE}
/>
<TouchableOpacity

View File

@ -330,7 +330,6 @@ class ProfileContainer extends Component {
quickProfile,
user,
username,
selectedUser,
} = this.state;
const { currency, isDarkTheme, isLoggedIn, navigation, children } = this.props;
const activePage = get(navigation.state.params, 'state', 0);
@ -339,9 +338,9 @@ class ProfileContainer extends Component {
let votingPower;
let resourceCredits;
if (selectedUser) {
votingPower = getVotingPower(selectedUser).toFixed(1);
resourceCredits = getRcPower(selectedUser).toFixed(1);
if (user) {
votingPower = getVotingPower(user).toFixed(1);
resourceCredits = getRcPower(user).toFixed(1);
}
return (