Skip to content

Commit f3648bc

Browse files
committed
splitscreen update
1 parent 017c71b commit f3648bc

1 file changed

Lines changed: 24 additions & 19 deletions

File tree

playground/src/screens/sharedElementTransition/CocktailDetailsScreen.tsx

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
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';
33
import { NavigationProps, NavigationButtonPressedEvent, Options } from 'react-native-navigation';
44
import Screens from '../Screens';
55
import Navigation from '../../services/Navigation';
@@ -49,33 +49,38 @@ export default class CocktailDetailsScreen extends React.Component<Props> {
4949

5050
render() {
5151
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 }]}
6357
/>
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}
6671
</Text>
67-
</View>
68-
<Text nativeID="description" style={styles.description}>
69-
{this.props.description}
70-
</Text>
71-
</ScrollView>
72+
</ScrollView>
73+
</SafeAreaView>
7274
);
7375
}
7476
}
7577

7678
const SIZE = 100;
7779
const HEADER = 150;
7880
const styles = StyleSheet.create({
81+
safeArea: {
82+
flex: 1,
83+
},
7984
root: {
8085
marginTop: 0,
8186
},

0 commit comments

Comments
 (0)