quantity or photo added snackbar in fooditemdetail

This commit is contained in:
Bart Akeley 2018-11-24 11:09:55 -06:00
parent 9ebc5e4668
commit 832b9b1696

View file

@ -33,6 +33,7 @@ import { identity } from 'ramda';
import Spinner from 'react-native-loading-spinner-overlay';
import ImageRecord from '../records/ImageRecord';
import { List } from 'immutable';
import Snackbar from 'react-native-snackbar';
const { foodItemDetails: style } = theme;
@ -211,12 +212,14 @@ export default compose(
setImagesLoading(true);
await addImage({ foodItemId: foodItem.id, imageUri });
setImagesLoading(false);
setTimeout(() => Snackbar.show({ title: 'Food updated.' }), 700);
},
updateAmount: ({ updateQuantity, foodItem }: Props) => (quantity: Quantity) => {
updateAmount: ({ updateQuantity, foodItem }: Props) => async (quantity: Quantity) => {
if (!foodItem) {
return;
}
updateQuantity({ foodItemId: foodItem.id, quantity });
await updateQuantity({ foodItemId: foodItem.id, quantity });
Snackbar.show({ title: 'Food updated.' });
},
toggleQuantityModal: ({ quantityModalOpen, setQuantityModalOpen }) => () => {
setQuantityModalOpen(!quantityModalOpen);