explicitly set color white background black

This commit is contained in:
Bart Akeley 2019-11-17 15:47:24 -06:00
parent 3c0e7057c8
commit bec2295103
3 changed files with 22 additions and 5 deletions

View file

@ -19,7 +19,11 @@ export const withCreateFoodItemState = mapPropsStream(props$ => {
// insert new item into db and cast it into FoodItemRecord // insert new item into db and cast it into FoodItemRecord
const newItem = buildFoodItem(await createFoodItem(foodItem)); const newItem = buildFoodItem(await createFoodItem(foodItem));
Snackbar.show({ title: foodItem.name + ' added' }); Snackbar.show({
title: foodItem.name + ' added',
backgroundColor: 'black',
color: 'white',
});
// notify food items state of new item // notify food items state of new item
emitFoodItemsState(newItem); emitFoodItemsState(newItem);
@ -32,7 +36,12 @@ export const withCreateFoodItemState = mapPropsStream(props$ => {
} catch (err) { } catch (err) {
const error = formatError(err); const error = formatError(err);
Snackbar.show({ title: error, duration: Snackbar.LENGTH_LONG }); Snackbar.show({
title: error,
duration: Snackbar.LENGTH_LONG,
backgroundColor: 'black',
color: 'white',
});
throw error; throw error;
} }

View file

@ -212,14 +212,22 @@ export default compose(
setImagesLoading(true); setImagesLoading(true);
await addImage({ foodItemId: foodItem.id, imageUri }); await addImage({ foodItemId: foodItem.id, imageUri });
setImagesLoading(false); setImagesLoading(false);
setTimeout(() => Snackbar.show({ title: 'Food updated.' }), 700); setTimeout(
() =>
Snackbar.show({
title: 'Food updated.',
backgroundColor: 'black',
color: 'white',
}),
700
);
}, },
updateAmount: ({ updateQuantity, foodItem }: Props) => async (quantity: Quantity) => { updateAmount: ({ updateQuantity, foodItem }: Props) => async (quantity: Quantity) => {
if (!foodItem) { if (!foodItem) {
return; return;
} }
await updateQuantity({ foodItemId: foodItem.id, quantity }); await updateQuantity({ foodItemId: foodItem.id, quantity });
Snackbar.show({ title: 'Food updated.' }); Snackbar.show({ title: 'Food updated.', backgroundColor: 'black', color: 'white' });
}, },
toggleQuantityModal: ({ quantityModalOpen, setQuantityModalOpen }) => () => { toggleQuantityModal: ({ quantityModalOpen, setQuantityModalOpen }) => () => {
setQuantityModalOpen(!quantityModalOpen); setQuantityModalOpen(!quantityModalOpen);

View file

@ -109,7 +109,7 @@ export default compose(
await AsyncStorage.setItem('zipcode', props.zipcode); await AsyncStorage.setItem('zipcode', props.zipcode);
props.setLoading(false); props.setLoading(false);
getLocation(); getLocation();
Snackbar.show({ title: 'Zipcode updated.' }); Snackbar.show({ title: 'Zipcode updated.', backgroundColor: 'black', color: 'white' });
}, },
}), }),
withHandlers({ withHandlers({