Create a mobile app that allows users to record their daily mood (😃 Happy, 😐 Neutral, 😢 Sad), view their current mood, and see a recent history.
🌱 How to start this project
- Clone the following template to your computer
1https://github.com/4GeeksAcademy/react-native-hello
- Install dependencies
1npm install
- Start the project with Expo
1npm run start
- iOS Simulator (macOS): press i or use npm run ios
- Android Emulator: press a or use npm run android
- Web: press w or use npm run web
- If your phone does not connect via LAN:
npx expo start --tunnel
📝 Instructions:
- The app should allow users to select a mood by tapping an emoji (😃, 😐, 😢).
- It should display today's current mood (e.g.: “Today you feel: 😃 Happy”).
- There should be a history listing the latest moods with a readable time.
- When there are no records, show a message: “No records yet”.
- Include a button to reset the history (clear the list and current mood).
- Do not use fetch or external APIs; work only with local state (
useState
) and effects (useEffect
).
- Render the history with
FlatList
and stable keys.
- Apply conditional rendering (no current mood vs. with mood, empty list vs. with data).
💡 Tips to finish this project
Don't jump into coding right away; first design a strategy:
- What states will you need? (e.g.,
currentMood
, history
).
- What actions will the user have? (select mood, reset).
- How and when will you use
useEffect
?
- One on mount (logs/diagnostics).
- Another when
currentMood
changes to add to history.
- Use types in TypeScript for entries (
MoodEntry
) and base values (MoodBase
).
- Think about accessibility: buttons with
accessibilityLabel
.