custom button in the grid now will open the camera screen (iOS only)

This commit is contained in:
Ran Greenberg 2017-02-28 15:43:33 +02:00
parent 405358f977
commit 74ec3e09da
1 changed files with 16 additions and 3 deletions

View File

@ -19,6 +19,7 @@ import {
import _ from 'lodash';
import GalleryScreen from './GalleryScreen';
import CameraScreen from './CameraScreen';
const {height, width} = Dimensions.get('window');
@ -33,7 +34,8 @@ export default class AlbumsScreen extends Component {
albums: [],
dropdownVisible: false,
images: [],
imagesDetails: undefined
imagesDetails: undefined,
shouldRenderCameraScreen: false
}
}
@ -65,6 +67,13 @@ export default class AlbumsScreen extends Component {
}
render() {
if (this.state.shouldRenderCameraScreen) {
return (
<CameraScreen/>
);
}
return (
<View style={styles.container}>
<CameraKitGalleryView
@ -96,8 +105,6 @@ export default class AlbumsScreen extends Component {
}}
/>
<View style={{
alignItems: 'center',
justifyContent: 'space-between',}}>
@ -114,8 +121,14 @@ export default class AlbumsScreen extends Component {
);
}
renderCameraScreen() {
return <CameraScreen/>
}
onCustomButtonPressed() {
console.log('RANG', 'custom button pressed');
this.setState({shouldRenderCameraScreen: true});
}
renderImagesDetails() {