Skip to content

🧹 Extract PostCard Component from Community Page#24

Merged
codewithaman07 merged 2 commits into
mainfrom
refactor-postcard-component-17244515886689537428
Feb 26, 2026
Merged

🧹 Extract PostCard Component from Community Page#24
codewithaman07 merged 2 commits into
mainfrom
refactor-postcard-component-17244515886689537428

Conversation

@codewithaman07
Copy link
Copy Markdown
Owner

This PR extracts the PostCard component from app/community/page.tsx into its own file app/components/PostCard.tsx. It also moves shared utility functions and constants to a new library file app/lib/community.ts to be used by both the main page and the component, avoiding code duplication and circular dependencies. This improves readability and maintainability of the community page code.

Verification:

  • npm run lint checks passed (existing warnings unrelated to changes).
  • npm run build passed successfully.
  • Frontend verified via Playwright screenshot (page loads correctly).

PR created automatically by Jules for task 17244515886689537428 started by @codewithaman07

- Extracted `PostCard` component to `app/components/PostCard.tsx`
- Moved shared utilities (`AVATARS`, `COLORS`, `getAnonymousIdentity`, `timeAgo`, `CATEGORIES`) to `app/lib/community.ts`
- Updated `app/community/page.tsx` to use the new component and utilities
- Improved code maintainability and separation of concerns

Co-authored-by: codewithaman07 <135147451+codewithaman07@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 26, 2026 17:13
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stablemind Error Error Feb 26, 2026 5:24pm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extracts the PostCard component from the community page into its own file and consolidates shared utilities into a library file, improving code organization and reusability.

Changes:

  • Created app/lib/community.ts with shared constants (AVATARS, COLORS, CATEGORIES) and utility functions (getAnonymousIdentity, timeAgo)
  • Extracted PostCard component to app/components/PostCard.tsx as a standalone, reusable component
  • Updated app/community/page.tsx to import and use the extracted component and utilities

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
app/lib/community.ts New library file containing shared anonymous identity generator, time formatting utility, and category definitions for the community feature
app/components/PostCard.tsx Extracted PostCard component that renders individual peer support posts with support/reply actions
app/community/page.tsx Refactored to import PostCard component and utilities from their new locations, removing ~135 lines of inline code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codewithaman07 codewithaman07 merged commit 5c31f11 into main Feb 26, 2026
2 of 4 checks passed
@codewithaman07 codewithaman07 deleted the refactor-postcard-component-17244515886689537428 branch March 9, 2026 20:56
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