Commit 5898d2b7 authored by Wietse Kuipers's avatar Wietse Kuipers
Browse files

Scroll up when ordering a pizza

parent 7942295c
......@@ -100,7 +100,10 @@ class Pizza extends Component {
<Text style={styles.pizzaPrice}>{pizza.price}</Text>
</View>
<TouchableOpacity
onPress={() => this.props.orderPizza(this.props.token, pizza.pk, hasOrder)}
onPress={() => {
this.props.orderPizza(this.props.token, pizza.pk, hasOrder);
this.pizzaScroll.scrollTo({ x: 0, y: 0, animated: true });
}}
style={styles.button}
>
<Icon
......@@ -178,6 +181,7 @@ class Pizza extends Component {
onRefresh={this.handleRefresh}
/>
}
ref={(ref) => { this.pizzaScroll = ref; }}
>
<View style={styles.content}>
{this.getEventInfo(this.props.event.title, subtitle)}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment