-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat(web): Digital Iceland mailing list component #17816
base: main
Are you sure you want to change the base?
feat(web): Digital Iceland mailing list component #17816
Conversation
WalkthroughThis pull request introduces new components for mailing list thumbnails. The Changes
Sequence Diagram(s)sequenceDiagram
participant CMS as CMS
participant Renderer as webRenderConnectedComponent
participant Grid as GridContainer
participant DIComponent as DigitalIcelandMailingListThumbnailCard
participant Thumbnail as MailingListThumbnailCard
CMS->>Renderer: Provide slice with type "DigitalIcelandMailingListThumbnailCard"
Renderer->>Grid: Wrap component in GridContainer
Grid->>DIComponent: Render DigitalIcelandMailingListThumbnailCard
DIComponent->>DIComponent: Use useI18n to compute texts
DIComponent->>Thumbnail: Pass texts and link props for rendering
Possibly related PRs
Suggested labels
Suggested reviewers
Tip 🌐 Web search-backed reviews and chat
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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: 1
🧹 Nitpick comments (1)
apps/web/components/connected/MailingListThumbnailCard/DigitalIcelandMailingListThumbnailCard.tsx (1)
15-27
: Extract default texts to constants for better maintainability.Consider extracting the default texts to named constants to improve readability and maintainability.
+const DEFAULT_TEXTS = { + is: { + heading: 'Fylgstu með því nýjasta', + description: 'Skráðu þig á póstlista Stafræns Íslands og fylgstu með því nýjasta í stafrænni opinberri þjónustu.', + linkLabel: 'Skrá mig á póstlista' + }, + en: { + heading: 'Subscribe', + description: 'Sign up for the Digital Iceland mailing list and stay up to date with the latest in digital public services.', + linkLabel: 'Subscribe to mailing list' + } +} + const headingText = - slice.json?.headingText ?? activeLocale === 'is' - ? 'Fylgstu með því nýjasta' - : 'Subscribe' + slice.json?.headingText ?? DEFAULT_TEXTS[activeLocale].heading const descriptionText = - slice.json?.descriptionText ?? activeLocale === 'is' - ? 'Skráðu þig á póstlista Stafræns Íslands og fylgstu með því nýjasta í stafrænni opinberri þjónustu.' - : 'Sign up for the Digital Iceland mailing list and stay up to date with the latest in digital public services.' + slice.json?.descriptionText ?? DEFAULT_TEXTS[activeLocale].description const linkHref = slice.json?.linkHref const linkLabel = - slice.json?.linkLabel ?? activeLocale === 'is' - ? 'Skrá mig á póstlista' - : 'Subscribe to mailing list' + slice.json?.linkLabel ?? DEFAULT_TEXTS[activeLocale].linkLabel
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/web/components/connected/MailingListThumbnailCard/DigitalIcelandMailingListThumbnailCard.tsx
(1 hunks)apps/web/components/connected/MailingListThumbnailCard/MailingListThumbnailCard.tsx
(1 hunks)apps/web/components/connected/index.ts
(1 hunks)apps/web/utils/richText.tsx
(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`apps/**/*`: "Confirm that the code adheres to the following...
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
apps/web/components/connected/index.ts
apps/web/utils/richText.tsx
apps/web/components/connected/MailingListThumbnailCard/MailingListThumbnailCard.tsx
apps/web/components/connected/MailingListThumbnailCard/DigitalIcelandMailingListThumbnailCard.tsx
🔇 Additional comments (4)
apps/web/components/connected/index.ts (1)
8-8
: LGTM!The new export follows the established pattern and maintains consistency with other exports.
apps/web/components/connected/MailingListThumbnailCard/MailingListThumbnailCard.tsx (1)
10-15
: LGTM!The component is well-structured with:
- Clear and typed props interface
- Consistent use of island-ui components
- Proper layout and spacing
Also applies to: 17-52
apps/web/components/connected/MailingListThumbnailCard/DigitalIcelandMailingListThumbnailCard.tsx (1)
6-8
: LGTM!The component is well-implemented with:
- Type-safe props
- Proper localization handling
- Safe access to slice data with fallbacks
Also applies to: 10-37
apps/web/utils/richText.tsx (1)
20-20
: LGTM!The changes are well-implemented with:
- Proper imports
- Consistent component wrapping in GridContainer
- Correct prop passing
Also applies to: 32-32, 207-213
apps/web/components/connected/MailingListThumbnailCard/MailingListThumbnailCard.tsx
Outdated
Show resolved
Hide resolved
View your CI Pipeline Execution ↗ for commit c3a0266.
☁️ Nx Cloud last updated this comment at |
Digital Iceland mailing list component
Checklist:
Summary by CodeRabbit