Skip to content

Commit

Permalink
showing the add post modal
Browse files Browse the repository at this point in the history
  • Loading branch information
drorbiran committed Jun 14, 2018
1 parent 9d39a6e commit da86957
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/posts/screens/AddPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ import {View, Text} from 'react-native-ui-lib';

class AddPost extends PureComponent {

static get options() {
return {
topBar: {
title: {
text: 'Add Post'
}
}
};
}

render() {
return (
<View flex center bg-green60>
Expand Down
18 changes: 16 additions & 2 deletions src/posts/screens/PostsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {Navigation} from 'react-native-navigation';
class PostsList extends PureComponent {

static propTypes = {
navigator: PropTypes.object,
componentId: PropTypes.string
};

constructor(props) {
super(props);

this.pushViewPostScreen = this.pushViewPostScreen.bind(this);
this.showAddPostModal = this.showAddPostModal.bind(this);
}

static get options() {
Expand All @@ -30,7 +30,9 @@ class PostsList extends PureComponent {
}

onNavigationButtonPressed(buttonId) {
console.error(buttonId);
if (buttonId === 'addPost') {
this.showAddPostModal();
}
}

pushViewPostScreen() {
Expand All @@ -51,6 +53,18 @@ class PostsList extends PureComponent {
});
}

showAddPostModal() {
Navigation.showModal({
stack: {
children: [{
component: {
name: 'blog.AddPost',
}
}]
}
});
}



render() {
Expand Down

0 comments on commit da86957

Please sign in to comment.