post screen fester than all times

This commit is contained in:
u-e 2018-12-19 18:38:32 +03:00
parent f805d2ee6c
commit ffc04c74f3
3 changed files with 9 additions and 8 deletions

View File

@ -37,17 +37,16 @@ class PostCardContainer extends Component {
}
};
_handleOnContentPress = (author, permlink) => {
_handleOnContentPress = (content) => {
const { navigation } = this.props;
if (author && permlink) {
if (content) {
navigation.navigate({
routeName: ROUTES.SCREENS.POST,
params: {
author,
permlink,
content,
},
key: permlink,
key: content.permlink,
});
}
};

View File

@ -44,7 +44,7 @@ class PostCard extends Component {
_handleOnContentPress = () => {
const { handleOnContentPress, content } = this.props;
handleOnContentPress(content.author, content.permlink);
handleOnContentPress(content);
};
_handleOnVotersPress = () => {

View File

@ -25,9 +25,11 @@ class PostContainer extends Component {
// Component Life Cycle Functions
componentDidMount() {
const { navigation } = this.props;
const { author, permlink } = navigation.state && navigation.state.params;
const { content } = navigation.state && navigation.state.params;
this._loadPost(author, permlink);
if (content) {
this.setState({ post: content });
}
}
componentWillReceiveProps(nextProps) {