chore: only render share button for owners#1157
Conversation
WalkthroughCapCard.tsx now renders the Share button only when isOwner is true. The previously unconditional Share CapCardButton is wrapped in a conditional block. No changes to the Share action handler or exports. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CapCard as CapCard (UI)
participant Permissions as isOwner flag
User->>CapCard: Open card
CapCard->>Permissions: Check isOwner
alt Owner
CapCard-->>User: Render Share button
User->>CapCard: Click Share
CapCard-->>User: Trigger existing Share action
else Not owner
CapCard-->>User: Share button not rendered
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (6)apps/web/**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
apps/web/app/**/*.{tsx,ts}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx,rs}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/web/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (1)apps/web/app/(org)/dashboard/caps/components/CapCard/CapCard.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (1)
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. Comment |
Summary by CodeRabbit