Skip to content

Commit b649a7c

Browse files
authored
Merge pull request #11 from sentry-demos/fix_android_checkout_scroll
Fix: Android checkout Screen Scrolling
2 parents 50122d4 + c344574 commit b649a7c

File tree

1 file changed

+28
-33
lines changed

1 file changed

+28
-33
lines changed

src/screens/CheckoutScreen.tsx

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,30 @@ const CheckoutScreen = (props) => {
122122
}
123123
return response;
124124
};
125+
const renderFooter = () =>{
126+
return (
127+
<View>
128+
<View style={styles.flavorContainer}>
129+
{/* <Image
130+
source={require('../assets/sentry-logo.png')}
131+
style={styles.logo}
132+
/> */}
133+
<Text style={{marginLeft: 5, fontWeight: '500'}}>
134+
Deliver to Sentry - San Francisco {contactInfoData['zipCode']}
135+
</Text>
136+
</View>
137+
<View>
138+
<GradientBtn
139+
buttonText={styles.buttonText}
140+
colors={['#002626','#001414']}
141+
style={styles.linearGradient}
142+
onPress={() => performCheckoutOnServer()}
143+
progressState={orderStatusUI}
144+
name={'Place your order'}></GradientBtn>
145+
</View>
146+
</View>
147+
)
148+
}
125149

126150
return (
127151
<View style={styles.screen}>
@@ -132,10 +156,12 @@ const CheckoutScreen = (props) => {
132156
fontSize: 18,
133157
fontWeight: '600',
134158
}}>Contact Info</Text>
135-
<View>
159+
<View style={{flex:1}}>
136160
<FlatList
137161
data={items}
138162
appDispatch={dispatch}
163+
ListFooterComponent={renderFooter}
164+
ListFooterComponentStyle={styles.flavorContainer}
139165
renderItem={({item}) => {
140166
return (
141167
<SafeAreaView>
@@ -152,24 +178,7 @@ const CheckoutScreen = (props) => {
152178
}}
153179
keyExtractor={(item) => item.id}
154180
/>
155-
<View style={styles.flavorContainer}>
156-
{/* <Image
157-
source={require('../assets/sentry-logo.png')}
158-
style={styles.logo}
159-
/> */}
160-
<Text style={{marginLeft: 5, fontWeight: '500'}}>
161-
Deliver to Sentry - San Francisco {contactInfoData['zipCode']}
162-
</Text>
163-
</View>
164-
<View style={styles.orderBtnContainer}>
165-
<GradientBtn
166-
buttonText={styles.buttonText}
167-
colors={['#002626','#001414']}
168-
style={styles.linearGradient}
169-
onPress={() => performCheckoutOnServer()}
170-
progressState={orderStatusUI}
171-
name={'Place your order'}></GradientBtn>
172-
</View>
181+
173182
</View>
174183
</View>
175184
);
@@ -214,20 +223,6 @@ const styles = StyleSheet.create({
214223
width:300,
215224
margin:10,
216225
},
217-
orderBtnContainer: {
218-
height: 50,
219-
220-
paddingLeft: 20,
221-
paddingRight: 20,
222-
// borderRadius: 2,
223-
borderWidth: 1,
224-
borderColor: 'white',
225-
flexDirection: 'column',
226-
justifyContent: 'center',
227-
228-
width:300,
229-
margin:10,
230-
},
231226
buttonText: {
232227
textAlign: 'center',
233228
fontSize: 16,

0 commit comments

Comments
 (0)