Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat barcode scanner #3

Merged
merged 10 commits into from
Aug 18, 2020
Merged

Feat barcode scanner #3

merged 10 commits into from
Aug 18, 2020

Conversation

DiegoOTdC
Copy link
Owner

As a user I want to be able to scan a barcode of a product and get recipes containing this product.

I implemented expo's BarCodeScanner which gives you the type and data. Data contains the actual barcode number, which I needed to send to the backend, in order to search Open Food Facts API for the correct item. Then in the response we get the item's name and labels.

Those labels I then set to the labels you can choose from on the preview screen (this label will be searched with for recipes). Except not every product has labels, in those cases you can search for recipes with the item's name. If there are no labels and no name, a message will be send. And for now, that message will pop up as an alert.

I added another button on the preview screen so that you are now able to go back to either camera or barcode scanner (instead of having to go back to the homepage, to be able to select the other one.)

To make everything work fine with each other, going back and forth I had to add several validations on the camera, preview and barcodeScanner screens.

And I also added colours in a separate folder so I can use them globally now.

@DiegoOTdC DiegoOTdC merged commit 5fd2fb0 into development Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant