Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Animated,
Dimensions,
Text,
Modal,
ViewPropTypes as RNViewPropTypes,
} from 'react-native'

Expand Down Expand Up @@ -103,17 +104,19 @@ export default class Toast extends Component {
break;
}

const view = this.state.isShow ?
<View
style={[styles.container, { top: pos }]}
pointerEvents="none"
const view =
<Modal
visible={this.state.isShow}
transparent
>
<Animated.View
style={[styles.content, { opacity: this.state.opacityValue }, this.props.style]}
>
{React.isValidElement(this.state.text) ? this.state.text : <Text style={this.props.textStyle}>{this.state.text}</Text>}
</Animated.View>
</View> : null;
<View pointerEvents="none" style={[styles.container, { top: pos }]}>
<Animated.View
style={[styles.content, { opacity: this.state.opacityValue }, this.props.style]}
>
{React.isValidElement(this.state.text) ? this.state.text : <Text style={this.props.textStyle}>{this.state.text}</Text>}
</Animated.View>
</View>
</Modal>
return view;
}
}
Expand Down