JFCocktails is a simple application built using React Native and Expo that i made for my school project. It displays a list of beverages and allows the user to login.
- Node.js installed
- Expo CLI installed
- A mobile device or emulator for testing (web emulation is possible)
- Clone this repository
- Install the dependencies:
npm install
- Start the app:
npx expo start
The main components of the app are:
Header
: displays the hour and the name of the userLoginModal
: a popup window for user loginButton
: a custom button component
The app uses the useState
hook to manage the state of the application. The isConnected
variable determines whether the "Favorite" button is displayed or not. The isModalVisible
variable controls the visibility of the LoginModal
.
When a button is clicked, a signal is sent to node red with the payloas as the drink name. Be sure to replace with your own node red, else it will show a network error.
onLogin
: sets theisModalVisible
state totrue
onModalClose
: sets theisModalVisible
state tofalse
toggleShowFav
: toggles theisConnected
state
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.