updated bookmarks container

This commit is contained in:
u-e 2019-01-10 16:16:36 +03:00
parent bd5eb65a67
commit c302347421
2 changed files with 18 additions and 14 deletions

View File

@ -44,12 +44,10 @@ class DraftsContainer extends Component {
getFavorites(currentAccount.name)
.then((data) => {
this.setState({ favorites: this._sortData(data) });
this.setState({ favorites: this._sortData(data), isLoading: false });
})
.catch(() => {
Alert.alert(intl.formatMessage({ id: 'favorites.load_error' }));
})
.finally(() => {
this.setState({ isLoading: false });
});
};

View File

@ -32,16 +32,20 @@ class BookmarksScreen extends Component {
// Component Functions
_renderItem = (item, index) => (
<UserListItem
handleLongPress={this._handleLongPress}
index={index}
isClickable
username={item.account}
rightText="bok"
subRightText="bok"
/>
);
_renderItem = (item, index) => {
const { handleOnPress } = this.props;
return (
<UserListItem
handleOnLongPress={this._handleLongPress}
handleOnPress={handleOnPress}
index={index}
isClickable
username={item.account}
rightText="bok"
subRightText="bok"
/>
);
};
_getTabItem = (data, type) => {
const { isLoading, intl } = this.props;
@ -78,7 +82,9 @@ class BookmarksScreen extends Component {
};
render() {
const { favorites, bookmarks, intl, handleRemoveFavorite } = this.props;
const {
favorites, bookmarks, intl, handleRemoveFavorite,
} = this.props;
return (
<View style={globalStyles.container}>