fix: "posting to" showing when there are no feed distributors#182
fix: "posting to" showing when there are no feed distributors#182elliotBraem merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant FeedLayout
participant DistributorBadges
FeedLayout->>DistributorBadges: Pass distribute array as prop
DistributorBadges->>DistributorBadges: Render badges for each plugin
DistributorBadges-->>FeedLayout: Rendered badge elements
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/app/src/components/DistributorBadges.tsx (1)
12-12: Consider adding null safety for plugin property.While the current usage might guarantee plugin existence, adding optional chaining would make the component more robust against potential undefined values.
- const pluginName = distributor.plugin.replace("@curatedotfun/", ""); + const pluginName = distributor.plugin?.replace("@curatedotfun/", "") || "";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/app/src/components/DistributorBadges.tsx(1 hunks)apps/app/src/routes/_layout/feed/$feedId.tsx(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Run Tests
🔇 Additional comments (3)
apps/app/src/components/DistributorBadges.tsx (1)
1-24: LGTM! Clean component structure that addresses the PR objective.The component is well-structured and correctly handles the plugin name transformation. The conditional rendering logic in the parent component ensures "Posting to:" only appears when distributors exist, which aligns perfectly with the PR objective.
apps/app/src/routes/_layout/feed/$feedId.tsx (2)
6-6: LGTM! Import statement correctly added.The import path is correct and follows the established import pattern in the file.
98-104: Excellent implementation that solves the PR objective.The conditional rendering logic correctly ensures that "Posting to:" text only appears when there are distributors (
length > 0). The null safety with optional chaining and nullish coalescing (??) prevents runtime errors. This refactoring successfully addresses the issue described in the PR objectives.
Showing for feeds with posting to distributors

Not showing for feeds with no distributors

Summary by CodeRabbit
New Features
Refactor