fixed upvote undefined text and some ui enhancemnt

This commit is contained in:
ue 2018-12-11 15:20:08 +03:00
parent c39a64aae9
commit 9e89d96488
5 changed files with 18 additions and 13 deletions

View File

@ -1,7 +1,6 @@
import EStyleSheet from 'react-native-extended-stylesheet';
export default EStyleSheet.create({
wrapper: {},
touchable: {
maxWidth: '$deviceWidth',
height: 56,
@ -22,7 +21,7 @@ export default EStyleSheet.create({
},
text: {
color: 'white',
fontWeight: '400',
fontWeight: 'bold',
alignSelf: 'center',
fontSize: 14,
paddingLeft: 10,

View File

@ -59,12 +59,14 @@ class SideMenuContainer extends Component {
};
_switchAccount = (anchor = null) => {
const { dispatch, currentAccount } = this.props;
const { dispatch, currentAccount, navigation } = this.props;
const username = anchor.slice(1);
if (username !== currentAccount.name) {
switchAccount(username).then((accountData) => {
dispatch(updateCurrentAccount(accountData));
dispatch(openPinCodeModal());
navigation.closeDrawer();
});
}
};

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import {
View, Text, ImageBackground, FlatList, TouchableOpacity, Image,
View, Text, ImageBackground, FlatList, TouchableOpacity,
} from 'react-native';
import { injectIntl } from 'react-intl';
import LinearGradient from 'react-native-linear-gradient';

View File

@ -148,7 +148,6 @@ class UpvoteView extends Component {
>
<Fragment>
{isVoting ? (
// <ActivityIndicator />
<View style={{ width: 19 }}>
<PulseAnimation
color="#357ce6"
@ -167,7 +166,7 @@ class UpvoteView extends Component {
name={iconName}
/>
)}
{isShowPayoutValue && (
{isShowPayoutValue && pendingPayoutValue && (
<Text style={styles.payoutValue}>{`$${pendingPayoutValue}`}</Text>
)}
</Fragment>

View File

@ -69,14 +69,19 @@ class ApplicationContainer extends Component {
_getUserData = async () => {
const { dispatch } = this.props;
let realmData;
let authStatus;
let currentUsername;
await getAuthStatus().then((res) => {
if (res.isLoggedIn) {
getUserData().then((response) => {
if (response.length > 0) {
realmData = response;
authStatus = res;
currentUsername = res.currentUsername;
response.forEach((accountData) => {
if (authStatus.isLoggedIn) {
getUserData().then((userData) => {
if (userData.length > 0) {
realmData = userData;
userData.forEach((accountData) => {
dispatch(
addOtherAccount({ username: accountData.username, avatar: accountData.avatar }),
);
@ -87,11 +92,11 @@ class ApplicationContainer extends Component {
});
if (realmData) {
await getUser(realmData[realmData.length - 1].username)
await getUser(currentUsername)
.then((accountData) => {
dispatch(login());
const realmObject = realmData[realmData.length - 1];
const realmObject = realmData.filter(data => data.username === currentUsername);
accountData.local = realmObject;
dispatch(updateCurrentAccount(accountData));