|
1 | 1 | import React from 'react'; |
2 | | -import { Image, Platform, ScrollView, StyleSheet, Text, View } from 'react-native'; |
| 2 | +import { Image, Platform, SafeAreaView, ScrollView, StyleSheet, Text, View } from 'react-native'; |
3 | 3 | import { NavigationProps, NavigationButtonPressedEvent, Options } from 'react-native-navigation'; |
4 | 4 | import Screens from '../Screens'; |
5 | 5 | import Navigation from '../../services/Navigation'; |
@@ -49,33 +49,38 @@ export default class CocktailDetailsScreen extends React.Component<Props> { |
49 | 49 |
|
50 | 50 | render() { |
51 | 51 | return ( |
52 | | - <ScrollView style={styles.root}> |
53 | | - <View |
54 | | - nativeID={'backdrop'} |
55 | | - style={[styles.backdrop, { backgroundColor: this.props.color }]} |
56 | | - /> |
57 | | - <View style={styles.header} testID={COCKTAILS_DETAILS_HEADER}> |
58 | | - <Image |
59 | | - source={this.props.image} |
60 | | - // @ts-ignore nativeID isn't included in react-native Image props. |
61 | | - nativeID={`image${this.props.id}Dest`} |
62 | | - style={styles.image} |
| 52 | + <SafeAreaView style={styles.safeArea}> |
| 53 | + <ScrollView style={styles.root}> |
| 54 | + <View |
| 55 | + nativeID={'backdrop'} |
| 56 | + style={[styles.backdrop, { backgroundColor: this.props.color }]} |
63 | 57 | /> |
64 | | - <Text style={styles.title} nativeID={`title${this.props.id}Dest`}> |
65 | | - {this.props.name} |
| 58 | + <View style={styles.header} testID={COCKTAILS_DETAILS_HEADER}> |
| 59 | + <Image |
| 60 | + source={this.props.image} |
| 61 | + // @ts-ignore nativeID isn't included in react-native Image props. |
| 62 | + nativeID={`image${this.props.id}Dest`} |
| 63 | + style={styles.image} |
| 64 | + /> |
| 65 | + <Text style={styles.title} nativeID={`title${this.props.id}Dest`}> |
| 66 | + {this.props.name} |
| 67 | + </Text> |
| 68 | + </View> |
| 69 | + <Text nativeID="description" style={styles.description}> |
| 70 | + {this.props.description} |
66 | 71 | </Text> |
67 | | - </View> |
68 | | - <Text nativeID="description" style={styles.description}> |
69 | | - {this.props.description} |
70 | | - </Text> |
71 | | - </ScrollView> |
| 72 | + </ScrollView> |
| 73 | + </SafeAreaView> |
72 | 74 | ); |
73 | 75 | } |
74 | 76 | } |
75 | 77 |
|
76 | 78 | const SIZE = 100; |
77 | 79 | const HEADER = 150; |
78 | 80 | const styles = StyleSheet.create({ |
| 81 | + safeArea: { |
| 82 | + flex: 1, |
| 83 | + }, |
79 | 84 | root: { |
80 | 85 | marginTop: 0, |
81 | 86 | }, |
|
0 commit comments