Merge pull request #255 from esteemapp/bugfix/profile

Bugfix/profile
This commit is contained in:
uğur erdal 2018-12-18 16:58:34 +03:00 committed by GitHub
commit a89a72d8d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 21 deletions

View File

@ -12,15 +12,15 @@ import styles from './percentBarStyles';
class PercentBarView extends Component {
/* Props
* ------------------------------------------------
* @prop { string } barColor - Bar color proferties
* @prop { string } barPercentColor - Bar background color properties
* @prop { number } margin - If you use with margin right and left you should declare that if it neccessary
* @prop { number } percent - Percent for bar (ex: %32 just send 32)
* @prop { string } text - Text string
* @prop { string } textColor - Text color
*
*/
* ------------------------------------------------
* @prop { string } barColor - Bar color proferties
* @prop { string } barPercentColor - Bar background color properties
* @prop { number } margin - If you use with margin right and left you should declare that if it neccessary
* @prop { number } percent - Percent for bar (ex: %32 just send 32)
* @prop { string } text - Text string
* @prop { string } textColor - Text color
*
*/
constructor(props) {
super(props);
@ -33,8 +33,7 @@ class PercentBarView extends Component {
_calculateWidth = (percent, margin = null) => {
if (percent) {
const per = 100 / percent;
return Dimensions.get('window').width / per - margin;
return (Dimensions.get('window').width - margin) / per;
}
return null;
};

View File

@ -36,6 +36,7 @@
"post": "Post",
"details": "Profile Details",
"comments": "Comments",
"replies": "Replies",
"wallet": "Wallet",
"wallet_details": "Wallet Details",
"unclaimed_rewards": "Unclaimed Rewards",

View File

@ -36,6 +36,7 @@
"post": "Gönderi",
"details": "Profil Detayları",
"comments": "Yorumlar",
"replies": "Yorumlar",
"wallet": "Cüzdan",
"wallet_details": "Cüzdan Detayları",
"unclaimed_rewards": "Sahipsiz Ödül",

View File

@ -274,6 +274,20 @@ export const getUserComments = async (query) => {
}
};
export const getRepliesByLastUpdate = async (query) => {
try {
let replies = await client.database.call('get_replies_by_last_update', [
query.start_author,
query.start_permlink,
query.limit,
]);
replies = parseComments(replies);
return replies;
} catch (error) {
return error;
}
};
/**
* @method getUser get user data
* @param user post author

View File

@ -15,9 +15,9 @@ import styles from './followScreenStyles';
class FollowsScreen extends Component {
/* Props
* ------------------------------------------------
* @prop { type } name - Description....
*/
* ------------------------------------------------
* @prop { type } name - Description....
*/
constructor(props) {
super(props);
@ -59,10 +59,10 @@ class FollowsScreen extends Component {
render() {
const {
loadMore, data, isFollowers, count, filterResult, handleSearch, intl,
loadMore, data, isFollowing, count, filterResult, handleSearch, intl,
} = this.props;
const title = intl.formatMessage({
id: !isFollowers ? 'profile.follower' : 'profile.following',
id: !isFollowing ? 'profile.follower' : 'profile.following',
});
const headerTitle = `${title} (${count})`;

View File

@ -10,7 +10,7 @@ import {
unfollowUser,
ignoreUser,
getFollows,
getUserComments,
getRepliesByLastUpdate,
getUser,
getIsFollowing,
getIsMuted,
@ -65,8 +65,8 @@ class ProfileContainer extends Component {
}
}
_getComments = async (user) => {
await getUserComments({ start_author: user, limit: 10 })
_getReplies = async (user) => {
await getRepliesByLastUpdate({ start_author: user, limit: 10 })
.then((result) => {
this.setState({
isReady: true,
@ -205,7 +205,7 @@ class ProfileContainer extends Component {
username: selectedUser,
},
() => {
this._getComments(selectedUser);
this._getReplies(selectedUser);
},
);
};

View File

@ -138,7 +138,7 @@ class ProfileScreen extends Component {
</View>
<View
tabLabel={intl.formatMessage({
id: 'profile.comments',
id: 'profile.replies',
})}
style={styles.commentsTabBar}
>