feat(showroom): add public showroom route with username and isPublic …#115
feat(showroom): add public showroom route with username and isPublic …#115Yuva-Deekshitha-N wants to merge 2 commits into
Conversation
|
@Yuva-Deekshitha-N is attempting to deploy a commit to the participationcorner2025-8967's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 SummaryThe provided pull request introduces a new route for user profiles, allowing users to view their public inventory items. The changes include updates to the Prisma schema, adding a 📂 Files Changed
🎭 Code PoemUsers can now view their items with ease, 🚨 Bugs & Architectural Violations* The `PublicShowroom` component is not placed in the `app/blocks/` directory, which is the required location for UI components. It should be moved to `app/blocks/__global/PublicShowroom`. * The component uses inline styles, which is not recommended. Instead, it should use Vanilla CSS Modules (`.module.css`) for styling. * The `loader` function does not handle errors properly. It should be updated to handle potential errors when fetching data from the database. * The `PublicShowroom` component does not include any accessibility features, such as `aria-hidden` or `role` attributes. These should be added to ensure the component is accessible. * The component uses `var(--color-border)` and `var(--color-text-muted)`, which are not defined in the provided code. These variables should be defined in a CSS file or replaced with actual color values.💡 Suggestions & Best Practices* Consider adding a `defer` function to the `loader` function to improve performance. * Use `transform` or `opacity` for CSS animations instead of triggering main-thread repaints. * Add a `key` prop to the `img` element to ensure it is properly updated when the image URL changes. * Consider adding a loading indicator or a skeleton component to display while the data is being fetched. * Use a more robust error handling mechanism, such as a try-catch block, to handle potential errors when fetching data from the database. * Consider adding a `meta` tag to the `head` of the HTML document to provide metadata about the user profile page. |
|
Hi! I hope you're doing well. I just wanted to follow up on my pull request. I noticed it has been open for a few days, so I was wondering if you've had a chance to review it. If there are any issues or changes needed from my side, please let me know. I'd be happy to make the necessary updates. Thank you for your time! |
…schema fields
Description
Adds the backend groundwork for the Public Showroom feature, allowing resellers to share a public-facing page of their listed inventory at /.
Schema changes:
-> Added username String? @unique to the User model — enables vanity URL routing
-> Added isPublic Boolean @default(false) to InventoryItem — per-item opt-in visibility control
New route (/:username):
-> Resolves the username to a user, returns 404 if not found
-> Fetches only items where isPublic: true using Prisma select — sensitive fields (purchasePrice, purchaseDate, userId, notes) are never sent to the client
-> Converts askingPrice Decimal to Number before serialization to prevent hydration issues
-> Renders a responsive card grid with item name, brand, size, and asking price
Related Issues
Closes#91
Type of Change
Checklist:
Screenshots (if applicable)
No UI changes.