Commit c12dc736 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'scroll-up-on-order' into 'master'

Scroll up when ordering a pizza

See merge request thalia/ThaliApp-react!100
parents 988ecb6d 5898d2b7
......@@ -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