Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.