-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Visit/Contact card conditional rendering #1336
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe recent updates introduce improved data handling and conditional rendering logic across the codebase. Specifically, they enhance the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Quality Gate passedIssues Measures |
#962 Bundle Size — 3.5MiB (~+0.01%).Warning Bundle contains 5 duplicate packages – View duplicate packages Bundle metrics
|
Current #962 |
Baseline #957 |
|
---|---|---|
Initial JS | 3.07MiB (~+0.01% ) |
3.07MiB |
Initial CSS | 9.54KiB |
9.54KiB |
Cache Invalidation | 44.85% |
44.85% |
Chunks | 64 |
64 |
Assets | 77 |
77 |
Modules | 2054 |
2054 |
Duplicate Modules | 340 |
340 |
Duplicate Code | 9.42% |
9.42% |
Packages | 208 |
208 |
Duplicate Packages | 5 |
5 |
Bundle size by type 1 change
1 regression
Current #962 |
Baseline #957 |
|
---|---|---|
JS | 3.38MiB (~+0.01% ) |
3.38MiB |
Fonts | 94.54KiB |
94.54KiB |
CSS | 9.54KiB |
9.54KiB |
Other | 9.09KiB |
9.09KiB |
IMG | 8.57KiB |
8.57KiB |
Bundle analysis report Branch JoeKarow/visit-card-fix Project dashboard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- packages/api/router/location/query.forVisitCard.handler.ts (1 hunks)
- packages/api/router/misc/query.hasContactInfo.handler.ts (2 hunks)
- packages/ui/components/sections/ContactSection/index.tsx (1 hunks)
- packages/ui/components/sections/VisitCard.tsx (1 hunks)
Additional comments not posted (6)
packages/ui/components/sections/ContactSection/index.tsx (1)
13-15
: Good use of conditional rendering to avoid unnecessary rendering.The added conditional block improves readability and maintainability by explicitly handling the case where there is no contact information and the component is not in edit mode.
packages/api/router/location/query.forVisitCard.handler.ts (2)
32-32
: Addition ofhours
property in the data fetch.The inclusion of the
hours
property ensures that operational hours data is fetched from the database, which is essential for accurate data representation.
38-44
: Proper handling ofhours
data.The check for the existence of
hours
and the setting ofhasHours
based on this condition ensure that the function can properly handle cases where operational hours data is available.packages/api/router/misc/query.hasContactInfo.handler.ts (2)
77-78
: Improvement in contact information query.The change from
every
tosome
forsocialMedia
andwebsite
properties ensures that the function correctly identifies cases where at least one social media or website entry exists for the given input.
123-126
: Accurate calculation of contact information count.The calculation of
totalCount
before returning the result ensures that the function accurately reflects the presence of contact information by summing up the counts of email, phone, social media, and website entries.packages/ui/components/sections/VisitCard.tsx (1)
112-114
: Effective conditional rendering to avoid incomplete display.The added conditional check ensures that the component does not render if there is no address and no operational hours data, improving the rendering logic by avoiding the display of incomplete or irrelevant information.
📦 Next.js Bundle Analysis for @weareinreach/appThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Pull Request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
Bug Fixes
Enhancements
ContactSection
andVisitCard
components to better handle the absence of key data, improving user experience.