feat(social): implement social profiles, following system, and activi…#332
Merged
RUKAYAT-CODER merged 2 commits intoApr 28, 2026
Merged
Conversation
|
@JoesWalker Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
closes #295
Description
Brief description of changes
Related Issue
Closes #
Type of Change
Checklist
Code follows project style guidelines
Self-review completed
No console errors
Uses Lucide icons consistently
Responsive design implemented
Starknet best practices followed
Implements the Advanced Social Features milestone, adding a complete social layer to the TeachLink frontend.
Changes
Utilities (src/utils/socialUtils.ts)
Hooks (src/hooks/useSocialFeatures.tsx)
Components (src/components/social/)
Tests (src/components/social/tests/socialFeatures.test.tsx)
Testing
Test Files 1 passed (1)
Tests 33 passed (33)
Notes
Implements the Advanced Social Features milestone, adding a complete social interaction layer to the TeachLink frontend. This covers user profiles with
follow/unfollow, a paginated activity feed with infinite scroll, and per-content social interactions (likes, comments, share).
Changes
src/utils/socialUtils.ts
Pure utility functions with no side effects:
src/hooks/useSocialFeatures.tsx
Three hooks, all connected to the existing apiClient (src/lib/api.ts):
follow, unfollow, loading }.
hasMore }.
addComment(body). Returns { likes, liked, comments, toggleLike, addComment, loading }.
src/components/social/SocialProfile.tsx
Displays avatar (falls back to UserCircle icon), name, bio, formatted follower/following counts
Follow/Unfollow button (hidden on own profile via isOwnProfile prop) using useFollowUser
Tab navigation: Posts | Activity | Analytics with active indicator
src/components/social/FollowingSystem.tsx
src/components/social/ActivityFeed.tsx
src/components/social/SocialInteractions.tsx
src/components/social/tests/socialFeatures.test.tsx
33 tests across 8 suites with apiClient fully mocked via vi.mock:
┌───────────────────────┬───────┐
│ Suite │ Tests │
├───────────────────────┼───────┤
│ formatFollowerCount │ 4 │
├───────────────────────┼───────┤
│ getRelativeTime │ 4 │
├───────────────────────┼───────┤
│ groupActivitiesByDate │ 2 │
├───────────────────────┼───────┤
│ useFollowUser │ 3 │
├───────────────────────┼───────┤
│ useActivityFeed │ 3 │
├───────────────────────┼───────┤
│ useSocialInteractions │ 4 │
├───────────────────────┼───────┤
│ SocialProfile │ 6 │
├───────────────────────┼───────┤
│ ActivityFeed │ 3 │
├───────────────────────┼───────┤
│ SocialInteractions │ 4 │
└───────────────────────┴───────┘
Testing
Test Files 1 passed (1)
Tests 33 passed (33)
Duration 6.17s
Full suite: 562/563 passing (1 pre-existing failure in Toast.test.tsx using jest.fn() instead of vi.fn() — unrelated to this PR).
Checklist