diff --git a/front-end/components/SubscriptionSummary.js b/front-end/components/SubscriptionSummary.js index ff22b3c..a137ff7 100644 --- a/front-end/components/SubscriptionSummary.js +++ b/front-end/components/SubscriptionSummary.js @@ -21,6 +21,11 @@ export default class SubscriptionSummary extends React.Component { this.setState({ cancelDialogVisible: false }); }; + onPressRemoveSubscription = subscriptionId => { + this.props.onPressRemoveSubscription(subscriptionId); + this.onPressCloseCancelDialogModal(); + }; + render() { return ( @@ -36,7 +41,9 @@ export default class SubscriptionSummary extends React.Component { + this.onPressRemoveSubscription(this.props.id) + } onPressCloseModal={this.onPressCloseCancelDialogModal} modalTitle={this.props.modalTitle} modalTextContent={this.props.modalTextContent} diff --git a/front-end/screens/MainScreens/MySubscriptionScreens/CheckoutScreens/DeliveryScheduleCheckoutScreen.js b/front-end/screens/MainScreens/MySubscriptionScreens/CheckoutScreens/DeliveryScheduleCheckoutScreen.js index e799268..ddf7255 100644 --- a/front-end/screens/MainScreens/MySubscriptionScreens/CheckoutScreens/DeliveryScheduleCheckoutScreen.js +++ b/front-end/screens/MainScreens/MySubscriptionScreens/CheckoutScreens/DeliveryScheduleCheckoutScreen.js @@ -77,7 +77,7 @@ class DeliveryScheduleCheckoutScreen extends React.Component { }; componentDidMount() { - this.props.setDeliveryDayOfWeek('MON'); + this.props.setDeliveryDayOfWeek('Mon'); this.props.setDeliveryTime('10:00-12:00'); } @@ -137,7 +137,10 @@ const mapStateToProps = state => ({ deliveryTime: state.checkout.deliveryTime, }); -export default connect(mapStateToProps, { - setDeliveryDayOfWeek, - setDeliveryTime, -})(DeliveryScheduleCheckoutScreen); +export default connect( + mapStateToProps, + { + setDeliveryDayOfWeek, + setDeliveryTime, + } +)(DeliveryScheduleCheckoutScreen); diff --git a/front-end/screens/MainScreens/MySubscriptionScreens/CheckoutScreens/OrderSummaryScreen.js b/front-end/screens/MainScreens/MySubscriptionScreens/CheckoutScreens/OrderSummaryScreen.js index f479550..21c452b 100644 --- a/front-end/screens/MainScreens/MySubscriptionScreens/CheckoutScreens/OrderSummaryScreen.js +++ b/front-end/screens/MainScreens/MySubscriptionScreens/CheckoutScreens/OrderSummaryScreen.js @@ -75,6 +75,12 @@ class OrderSummaryScreen extends React.Component { }; onPressRemoveSubscription = subscriptionId => { + if (this.props.shoppingCart.length === 1) { + this.props.removeSubscriptionFromCart(subscriptionId); + this.props.navigation.navigate('AddSubscription'); + return; + } + this.props.removeSubscriptionFromCart(subscriptionId); };