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(streaks): Add streak page from real code and bd. #20

Merged
merged 8 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.11.0
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ The `updateProfile` function accepts an object with updated user fields and sync

The `useGoalsUpdater` custom hook provides functions to manage user goals, microgoals, and tasks by:

1. updating the user's profile goals by adding/deleting items (goal, microgoal, task),
2. deleting items (goal, microgoal, task),
3. toggling completion status for tasks, and
4. expanding or collapsing goals and microgoals.
1. updating the user's profile, including both goals and (optionally) the streak,
2. adding items (goal, microgoal, task),
3. deleting items (goal, microgoal, task),
4. toggling completion status for tasks with streak updates, and
5. expanding or collapsing goals and microgoals.

This hook enables efficient management of goal-related actions across components, reducing repetitive code and ensuring consistent updates.

Expand All @@ -124,7 +125,7 @@ This hook enables efficient management of goal-related actions across components

#### Adding items

- **addGoal**: Adds a new goal with an optional name.
- **addGoal**: Adds a new goal with a specified name.

```jsx
addGoal("New Goal Name");
Expand Down Expand Up @@ -164,7 +165,7 @@ deleteTask(goalIndex, microGoalIndex, taskIndex);

#### Toggle Task Completion

- **toggleTaskCompletion**: Toggles the completion status of a task.
- **toggleTaskCompletion**: Toggles the completion status of a task and updates the streak accordingly.

```jsx
toggleTaskCompletion(goalIndex, microGoalIndex, taskIndex);
Expand Down
Loading
Loading