mirror of
https://gitlab.com/wheres-the-tp/ui-mobile.git
synced 2026-01-25 05:54:56 -06:00
quantity or photo added snackbar in fooditemdetail
This commit is contained in:
parent
9ebc5e4668
commit
832b9b1696
1 changed files with 5 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue