-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrorDisplay.js
More file actions
23 lines (21 loc) · 835 Bytes
/
Copy pathErrorDisplay.js
File metadata and controls
23 lines (21 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import React from "react";
import { Button } from "react-native-material-ui";
import { Text, Modal, View } from "react-native";
import { connect } from "react-redux";
import { hideErrorMessage } from "./errorActions";
const mapDispatchToProps = dispatch => ({
onClose : () => { dispatch(hideErrorMessage()); }
});
export default connect(null, mapDispatchToProps)(({message, onClose}) => {
return <Modal onRequestClose={onClose} transparent={true} animationType={"slide"} style={{alignSelf:"center"}} >
<View style={{padding:20, backgroundColor:"#ccc"}}>
<Text>
Ett fel uppstod
</Text>
<Text style={{marginTop: 20}}>
{message}
</Text>
<Button accent raised text="Stäng" onPress={onClose} />
</View>
</Modal>;
});