Skip to content

Commit b05d86c

Browse files
Merge pull request #105 from ngandhy/master
Add iPhone X Support
2 parents 81204e1 + 0453b11 commit b05d86c

File tree

3 files changed

+320
-246
lines changed

3 files changed

+320
-246
lines changed

DropdownAlert.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22
import {
33
StyleSheet,
4+
SafeAreaView,
45
View,
56
Text,
67
TouchableHighlight,
@@ -30,6 +31,7 @@ export default class DropdownAlert extends Component {
3031
startDelta: PropTypes.number,
3132
endDelta: PropTypes.number,
3233
containerStyle: ViewPropTypes.style,
34+
safeAreaStyle:ViewPropTypes.style,
3335
titleStyle: Text.propTypes.style,
3436
messageStyle: Text.propTypes.style,
3537
imageStyle: Image.propTypes.style,
@@ -76,6 +78,10 @@ export default class DropdownAlert extends Component {
7678
padding: 16,
7779
flexDirection: 'row',
7880
},
81+
safeAreaStyle:{
82+
flexDirection:'row',
83+
flex:1
84+
},
7985
titleStyle: {
8086
fontSize: 16,
8187
textAlign: 'left',
@@ -428,11 +434,13 @@ export default class DropdownAlert extends Component {
428434
onLayout={event => this.onLayoutEvent(event)}
429435
>
430436
<View style={style}>
431-
<ImageView style={StyleSheet.flatten(this.props.imageStyle)} source={source} />
432-
<View style={StyleSheet.flatten(this.props.defaultTextContainer)}>
433-
<Label style={StyleSheet.flatten(this.props.titleStyle)} numberOfLines={this.props.titleNumOfLines} text={this.state.title} />
434-
<Label style={StyleSheet.flatten(this.props.messageStyle)} numberOfLines={this.props.messageNumOfLines} text={this.state.message} />
435-
</View>
437+
<SafeAreaView style={StyleSheet.flatten(this.props.safeAreaStyle)}>
438+
<ImageView style={StyleSheet.flatten(this.props.imageStyle)} source={source} />
439+
<View style={StyleSheet.flatten(this.props.defaultTextContainer)}>
440+
<Label style={StyleSheet.flatten(this.props.titleStyle)} numberOfLines={this.props.titleNumOfLines} text={this.state.title} />
441+
<Label style={StyleSheet.flatten(this.props.messageStyle)} numberOfLines={this.props.messageNumOfLines} text={this.state.message} />
442+
</View>
443+
</SafeAreaView>
436444
{showCancel &&
437445
<TouchableOpacity
438446
style={{

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@
99
![screenshot](https://raw.github.com/testshallpass/react-native-dropdownalert/master/screenshots/info.png) ![screenshot](https://raw.github.com/testshallpass/react-native-dropdownalert/master/screenshots/warning.png) ![screenshot](https://raw.github.com/testshallpass/react-native-dropdownalert/master/screenshots/error.png) ![screenshot](https://raw.github.com/testshallpass/react-native-dropdownalert/master/screenshots/success.png)
1010

1111
### Table of contents
12-
1. [News](#news)
12+
1. [Support](#support)
1313
2. [Installation](#installation)
1414
3. [Demo](#demo)
1515
4. [Usage](#usage)
1616
5. [Props](#props)
1717

1818
A simple alert to notify users about new chat messages, something went wrong or everything is ok. It can be closed by tap, cancel button, automatically with `closeInterval`, pan responder up gesture or programmatically.
1919

20-
### News
21-
> v2.13.0 supports ViewPropTypes introduced in react-native **0.44.0**. If you support an earlier react-native version, please use v2.12.0 or earlier.
20+
### Support
21+
| react-native version | package version | reason |
22+
| ---- | :---: | ---- |
23+
| 0.50.0 | >=3.2.0 | Added SafeAreaView (iPhone X) |
24+
| 0.44.0 | >=2.12.0 | Added ViewPropTypes |
2225

2326
### Installation
2427
```

0 commit comments

Comments
 (0)