import React from 'react-native'; var { AppRegistry, StyleSheet, Text, View, NativeModules, TouchableNativeFeedback, ScrollView, ToolbarAndroid, } = React; import DialogAndroid from 'react-native-dialogs'; import dialogData from './dialogData.js'; import {MKButton } from 'react-native-material-kit'; class ExampleApp extends React.Component { showDialog(options) { var dialog = new DialogAndroid(); dialog.set(options); dialog.show(); } render() { var dialogs = dialogData.map((section, i) => { var sectionDialogNodes = section.dialogs.map((op, j) => { const ColoredRaisedButton = MKButton.coloredButton() .withText(op.buttonText) .withOnPress(c => this.showDialog( op.data || { title: "NOT IMPLEMENTED!! :-(", positiveText: "OK"})) .withStyle({width: 200}) .build(); return ( ); }); return ( {section.sectionTitle} {sectionDialogNodes} ); }); return ( {dialogs} ); } } var styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, toolbar: { backgroundColor: '#311B92', height: 56, }, }); AppRegistry.registerComponent('ExampleApp', () => ExampleApp);