Create modal window

1

I'm starting an app:

import React, { Component } from 'react';
import {
  StyleSheet,
  Text,
  View,
  StatusBar
} from 'react-native';
import Button from 'react-native-button';

import { Actions } from 'react-native-router-flux';

export default class ouvidoria extends Component {
  render() {
    return (
      <View style={styles.geral}>

        <StatusBar 
          //hidden
          backgroundColor='#005288'
        />

        <View style={styles.botao}>
          <Button
            onPress={() => { Actions.formaanonima(); }}
            containerStyle={{ padding:10, 
                              height:50,
                              width:300,
                              overflow:'hidden', 
                              //borderRadius:4, 
                              justifyContent: 'center',
                              alignItems: 'center',
                              backgroundColor: '#FFB504',
                              elevation: 10,
                              }}
            style={{fontSize: 24, 
                    color: '#000'
                    }}>
            Cadastrar Manifestação
          </Button>
        </View>

      </View>
    );
  }
}

const styles = StyleSheet.create({
  geral: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#005288',
  },
  botao: {

  }
});

I searched and could not find how to open windows.

I would like the user to press the button to open a window asking if the user already has a registration, only with the yes buttons and not to decide which route to follow.

But I did not find this kind of role in React-native or third-party material.

    
asked by anonymous 25.09.2017 / 22:48

1 answer

2

A simple example

Alert.alert(
  'Alert Title',
  'My Alert Msg',
  [
    {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},
    {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},
    {text: 'OK', onPress: () => console.log('OK Pressed')},
  ],
  { cancelable: false }
)

You can see more here

    
25.09.2017 / 22:56