mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-16 09:02:24 +03:00
commit
a89a72d8d1
@ -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;
|
||||
};
|
||||
|
@ -36,6 +36,7 @@
|
||||
"post": "Post",
|
||||
"details": "Profile Details",
|
||||
"comments": "Comments",
|
||||
"replies": "Replies",
|
||||
"wallet": "Wallet",
|
||||
"wallet_details": "Wallet Details",
|
||||
"unclaimed_rewards": "Unclaimed Rewards",
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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})`;
|
||||
|
@ -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);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
@ -138,7 +138,7 @@ class ProfileScreen extends Component {
|
||||
</View>
|
||||
<View
|
||||
tabLabel={intl.formatMessage({
|
||||
id: 'profile.comments',
|
||||
id: 'profile.replies',
|
||||
})}
|
||||
style={styles.commentsTabBar}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user