Skip to content
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

refactor(work): migrate to custom page #435

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

darenmalfait
Copy link
Owner

@darenmalfait darenmalfait commented Jan 7, 2025

Summary by CodeRabbit

  • New Features

    • Added a new Work page with comprehensive project portfolio sections
    • Enhanced testimonials filtering to support multiple types
    • Improved products overview block with better data fetching and rendering
  • Documentation

    • Added localized content for English and Dutch work page sections
    • Updated metadata for work-related pages
  • Refactor

    • Restructured components for products and testimonials overview
    • Updated import paths and component naming conventions

Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nerdfish-be ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 5:32am

Copy link

coderabbitai bot commented Jan 7, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/web/src/app/[locale]/realisations/blocks/products/index.tsx

Oops! Something went wrong! :(

ESLint: 9.17.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@nerdfish/config' imported from /eslint.config.js
at packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)

Walkthrough

This pull request introduces significant changes to the web application's structure, focusing on internationalization, page rendering, and project portfolio presentation. The modifications span multiple files across different directories, including updates to page components, product and testimonial blocks, and internationalization dictionaries. The changes aim to improve the organization of locale-specific content, refactor component structures, and enhance the presentation of work and project information.

Changes

File Path Change Summary
apps/web/src/app/[locale]/(tina)/work/page.tsx Removed locale-specific page rendering and metadata generation functions
apps/web/src/app/[locale]/realisations/blocks/products/... Restructured product overview components, updated data fetching and rendering logic
apps/web/src/app/[locale]/work/page.tsx Added new WorkPage component with metadata generation and localized content sections
apps/web/src/app/cms/blocks-renderer.tsx Updated import path for ProductsOverviewBlock
packages/i18n/dictionaries/en.json Added comprehensive "work" section with metadata and localized content
packages/i18n/dictionaries/nl.json Added Dutch translation for the new "work" section

Possibly related PRs


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (5)
apps/web/src/app/[locale]/realisations/blocks/products/index.tsx (1)

27-31: Fix typo in className.

There's a typo in the className prop of the GridCard component.

-            <GridCard key={i} className="elative lg:col-span-1" asChild>
+            <GridCard key={i} className="relative lg:col-span-1" asChild>
apps/web/src/app/[locale]/realisations/blocks/products/products-block.tsx (2)

15-19: Consider consolidating data fetching logic.

This function duplicates the data fetching logic from ProductsOverviewData in index.tsx. Consider extracting this into a shared hook or utility function.

// Suggested shared utility:
async function fetchProducts() {
  return product.getAll()
}

49-49: Fix typo in className.

Same typo as found in index.tsx.

-              <GridCard key={i} className="elative lg:col-span-1" asChild>
+              <GridCard key={i} className="relative lg:col-span-1" asChild>
apps/web/src/app/[locale]/work/page.tsx (2)

25-27: Consider using resolved type instead of Promise.

The type definition could be more explicit about the resolved value.

-type PageProps = {
-  params: Promise<WithLocale>
-}
+type PageProps = {
+  params: WithLocale | Promise<WithLocale>
+}

56-120: Consider abstracting repeated section patterns.

The component has multiple similar section patterns (WorkOverview + Cta). Consider creating a composite component to reduce repetition and improve maintainability.

Example abstraction:

type WorkSectionProps = {
  tags: string[]
  headerTranslationKey: string
  ctaTranslationKey: string
}

function WorkSection({ tags, headerTranslationKey, ctaTranslationKey }: WorkSectionProps) {
  const t = useTranslations('pages.work')
  
  return (
    <>
      <Section>
        <WorkOverview
          tags={tags}
          header={{
            title: t(`${headerTranslationKey}.title`),
            subtitle: t(`${headerTranslationKey}.subtitle`),
          }}
        />
      </Section>
      <Section>
        <Cta
          title={t(`${ctaTranslationKey}.cta.title`)}
          subtitle={t(`${ctaTranslationKey}.cta.subtitle`)}
          link={{
            href: '/contact',
            label: t(`${ctaTranslationKey}.cta.label`),
          }}
        />
      </Section>
    </>
  )
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d04df67 and 43c58b2.

📒 Files selected for processing (9)
  • apps/web/src/app/[locale]/(tina)/work/page.tsx (0 hunks)
  • apps/web/src/app/[locale]/realisations/blocks/products/index.tsx (1 hunks)
  • apps/web/src/app/[locale]/realisations/blocks/products/products-block.tsx (1 hunks)
  • apps/web/src/app/[locale]/realisations/blocks/products/products.tsx (1 hunks)
  • apps/web/src/app/[locale]/testimonials/blocks/testimonials/index.tsx (1 hunks)
  • apps/web/src/app/[locale]/work/page.tsx (1 hunks)
  • apps/web/src/app/cms/blocks-renderer.tsx (1 hunks)
  • packages/i18n/dictionaries/en.json (1 hunks)
  • packages/i18n/dictionaries/nl.json (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/src/app/[locale]/(tina)/work/page.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Lint
  • GitHub Check: TypeCheck
  • GitHub Check: E2E
🔇 Additional comments (9)
apps/web/src/app/[locale]/realisations/blocks/products/index.tsx (2)

9-12: LGTM! Good type definition.

The ProductsOverviewProps type correctly omits the products prop from ProductsOverviewContentProps, ensuring proper type safety and separation of concerns.


14-17: LGTM! Clean data fetching implementation.

Good separation of concerns by isolating data fetching in ProductsOverviewData. This makes the code more maintainable and testable.

apps/web/src/app/[locale]/testimonials/blocks/testimonials/index.tsx (1)

14-14: LGTM! Enhanced filtering capability.

Good enhancement to allow filtering by multiple testimonial types. The implementation correctly uses array includes for filtering.

apps/web/src/app/[locale]/realisations/blocks/products/products-block.tsx (1)

34-37: Verify link availability.

The CTA button uses a fallback empty string when link is undefined. Consider adding a condition to hide the CTA when no link is provided.

apps/web/src/app/[locale]/realisations/blocks/products/products.tsx (1)

103-109: LGTM! Clear naming and good implementation.

The renaming of ProductsOverview to ProductsOverviewContent better reflects the component's responsibility. The implementation maintains good accessibility with proper ARIA attributes and semantic HTML.

apps/web/src/app/[locale]/work/page.tsx (1)

1-23: LGTM! Well-organized imports.

The imports are properly structured and all dependencies are clearly defined.

apps/web/src/app/cms/blocks-renderer.tsx (1)

6-6: LGTM! Import path updated correctly.

The import path has been updated to reflect the new file structure.

packages/i18n/dictionaries/en.json (1)

220-252: LGTM! Well-structured translations with comprehensive content.

The translations are complete, well-organized, and align perfectly with the UI structure.

packages/i18n/dictionaries/nl.json (1)

220-252: LGTM! Dutch translations are complete and natural.

The translations maintain consistency with the English version while using natural Dutch language constructs.

@darenmalfait darenmalfait merged commit 66e6bb6 into main Jan 7, 2025
3 checks passed
@darenmalfait darenmalfait deleted the refactor/migrate-work-to-custom-page branch January 7, 2025 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant