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

Integrate Challenges into habits screen #128

Merged
merged 7 commits into from
Dec 13, 2024
Merged

Integrate Challenges into habits screen #128

merged 7 commits into from
Dec 13, 2024

Conversation

michaeleii
Copy link
Contributor

This pull request includes significant updates to the habits and challenges functionality within the application. The changes focus on integrating challenges into the habits page, enhancing the challenge details screen, and adding a new screen for logging challenge progress.

Integration of Challenges into Habits Page:

  • Added a new Challenge type and integrated it into the HabitsPage component. (app/(tabs)/habits.tsx)
  • Implemented getTimeBasedGreeting function to display a dynamic greeting based on the current time. (app/(tabs)/habits.tsx)
  • Updated HabitList to fetch and display challenges alongside habits, including the logic to separate completed and not completed items. (app/(tabs)/habits.tsx) [1] [2] [3]
  • Added ChallengeItem component for rendering individual challenges and handling logging of challenge progress. (app/(tabs)/habits.tsx)

Enhancements to Challenge Details Screen:

New Screen for Logging Challenge Progress:

@michaeleii michaeleii enabled auto-merge December 12, 2024 23:36

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 6 changed files in this pull request and generated no suggestions.

Files not reviewed (1)
  • app/habits/[habitId]/log-progress/index.tsx: Evaluated as low risk
Comments skipped due to low confidence (4)

app/challenges/[id]/log-progress/index.tsx:87

  • [nitpick] The error message 'You must enter a value greater than 0' could be rephrased to 'Please enter a value greater than 0' for better clarity.
throw new Error("You must enter a value greater than 0");

app/(tabs)/habits.tsx:251

  • The function name isChallenge is incorrect. It should be renamed to isChallenge.
function isChallenge(item: Habit | Challenge): item is Habit {

app/challenges/[id]/index.tsx:1

  • The function handleLeaveChallenge lacks error handling. Consider adding a try-catch block around the async call to handle potential errors.
handleLeaveChallenge = async (challengeId: Id<"challenges">) => {

app/challenges/[id]/index.tsx:202

  • [nitpick] Ensure consistent class names for badge colors in the ChallengeStatus component to maintain uniformity across the application.
<Badge className="rounded-full bg-gray-500 px-4">
@michaeleii michaeleii merged commit e44a68a into main Dec 13, 2024
3 checks passed
@michaeleii michaeleii deleted the challenges-mobile branch December 13, 2024 00:11
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.

2 participants