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

Website: New page to present tech stack #976

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ssandino
Copy link
Member

@ssandino ssandino commented Dec 6, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new JSON file detailing the technology stack used by "Social Income."
    • Added a Hero component to showcase titles and subtitles related to the tech stack.
    • Implemented a TechCard component to display individual technology details.
    • Created a TechList component with a tabbed interface to filter technologies.
    • Launched a new page that integrates the Hero and TechList components.
  • Bug Fixes

    • Enhanced responsiveness of technology display components.

@ssandino ssandino added the website Issues concerning Website label Dec 6, 2024
Copy link

vercel bot commented Dec 6, 2024

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

Name Status Preview Comments Updated (UTC)
public ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 9:45pm

Copy link

coderabbitai bot commented Dec 6, 2024

📝 Walkthrough

Walkthrough

A new tech stack page has been added to the Social Income website, featuring a comprehensive overview of the technologies and tools used by the organization. The implementation includes a hero section, a tabbed tech list interface, and a JSON configuration file that defines the tech stack details. The page allows users to view all technologies and filter specifically for donated technologies.

Changes

File Change Summary
shared/locales/en/website-techstack.json New JSON file added with metadata, hero content, and detailed tech stack information
website/src/app/[lang]/[region]/(website)/techstack/(sections)/hero.tsx New async Hero component created to render page titles and subtitle
website/src/app/[lang]/[region]/(website)/techstack/(sections)/techcard.tsx New TechCard component added to display individual technology details with logo and optional donation badge
website/src/app/[lang]/[region]/(website)/techstack/(sections)/techlist.tsx New TechList component created with tabbed interface to filter technologies
website/src/app/[lang]/[region]/(website)/techstack/page.tsx New page component to render the tech stack page with Hero and TechList components

Sequence Diagram

sequenceDiagram
    participant User
    participant TechStackPage
    participant Hero
    participant TechList
    participant TechCard

    User->>TechStackPage: Access Tech Stack Page
    TechStackPage->>Hero: Render Hero Section
    TechStackPage->>TechList: Render Tech List
    TechList->>TechCard: Create Tech Cards
    User->>TechList: Switch Tabs
    TechList->>TechCard: Filter Tech Cards
Loading

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 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.

@ssandino ssandino linked an issue Dec 6, 2024 that may be closed by this pull request
1 task
Copy link

github-actions bot commented Dec 6, 2024

Visit the preview URL for this PR (updated for commit 1cab6a4):

https://si-admin-staging--pr976-lvonlanthen-techstac-hejgjn6x.web.app

(expires Tue, 24 Dec 2024 21:00:17 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: b7b0969384059dce6ea8fad1ee1d1737e54e6676

ssandino and others added 4 commits December 17, 2024 21:52
It was necessary to replace `Translator.getInstance` with `useTranslator` and add `'use client'`, otherwise there were issues with client/server components and async/await. Not sure if this is the correct way to solve this, but it seems to work.
@lvonlanthen lvonlanthen force-pushed the lvonlanthen/techstack-page branch from 448dd78 to a5b0e02 Compare December 17, 2024 20:53
@ssandino
Copy link
Member Author

@coderabbitai review

Copy link

coderabbitai bot commented Dec 17, 2024

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 6

🧹 Nitpick comments (3)
website/src/app/[lang]/[region]/(website)/techstack/(sections)/techlist.tsx (1)

9-16: Enhance type safety for tech entry interface.

The current type definition could be more strict to prevent potential runtime errors.

Consider this enhanced type definition:

 type TechEntryJSON = {
-  title: string;
-  description: string;
-  link: string;
-  logo: string;
-  donated: boolean;
+  readonly title: string;
+  readonly description: string;
+  readonly link: string;
+  readonly logo: string;
+  readonly donated: boolean;
 };
website/src/app/[lang]/[region]/(website)/techstack/(sections)/techcard.tsx (2)

5-16: Consider adding type constraints for URLs and image files.

The type definitions could be more specific to prevent invalid inputs.

 type TechCardProps = {
 	title: string;
 	description: string;
-	link: string;
-	logo: string;
+	link: `https://${string}` | `http://${string}`;
+	logo: `${string}.${'png' | 'jpg' | 'svg' | 'webp'}`;
 	donated: boolean;
 	translations: TechCardTranslations;
 };

39-39: Simplify the className conditional.

The double negation is unnecessary and can be simplified.

-<div className={'' + (!!logo ? 'w-fit basis-3/4' : '')}>
+<div className={logo ? 'w-fit basis-3/4' : ''}>
🧰 Tools
🪛 Biome (1.9.4)

[error] 39-39: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 44ade87 and 1cab6a4.

⛔ Files ignored due to path filters (1)
  • website/public/assets/tech/google-nonprofit.png is excluded by !**/*.png
📒 Files selected for processing (5)
  • shared/locales/en/website-techstack.json (1 hunks)
  • website/src/app/[lang]/[region]/(website)/techstack/(sections)/hero.tsx (1 hunks)
  • website/src/app/[lang]/[region]/(website)/techstack/(sections)/techcard.tsx (1 hunks)
  • website/src/app/[lang]/[region]/(website)/techstack/(sections)/techlist.tsx (1 hunks)
  • website/src/app/[lang]/[region]/(website)/techstack/page.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • shared/locales/en/website-techstack.json
🧰 Additional context used
🪛 Biome (1.9.4)
website/src/app/[lang]/[region]/(website)/techstack/(sections)/techcard.tsx

[error] 39-39: Avoid redundant double-negation.

It is not necessary to use double-negation when a value will already be coerced to a boolean.
Unsafe fix: Remove redundant double-negation

(lint/complexity/noExtraBooleanCast)

🔇 Additional comments (1)
website/src/app/[lang]/[region]/(website)/techstack/page.tsx (1)

5-12: LGTM! Clean and well-structured page component.

The implementation follows Next.js app router conventions and properly handles internationalization parameters.

Comment on lines +38 to +47
{techArray
?.filter((t) => !isDonated || t.donated)
.map((techEntry, index) => (
<TechCard
{...techEntry}
translations={{ badgeDonated: translator?.t('badges.donated') || '' }}
key={index}
/>
))}
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add null checks and loading state handling.

The code assumes techArray and translator are always available, which might not be true during initial render or translation loading.

Add proper checks and loading state:

+ if (!translator || !techArray) {
+   return <div>Loading...</div>;
+ }

  <div className="grid grid-cols-1 gap-4 p-4 sm:grid-cols-2 lg:grid-cols-2">
    {techArray
-     ?.filter((t) => !isDonated || t.donated)
+     .filter((t) => !isDonated || t.donated)
      .map((techEntry, index) => (
        <TechCard
          {...techEntry}
-         translations={{ badgeDonated: translator?.t('badges.donated') || '' }}
+         translations={{ badgeDonated: translator.t('badges.donated') }}
          key={index}
        />
      ))}
  </div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{techArray
?.filter((t) => !isDonated || t.donated)
.map((techEntry, index) => (
<TechCard
{...techEntry}
translations={{ badgeDonated: translator?.t('badges.donated') || '' }}
key={index}
/>
))}
</div>
if (!translator || !techArray) {
return <div>Loading...</div>;
}
<div className="grid grid-cols-1 gap-4 p-4 sm:grid-cols-2 lg:grid-cols-2">
{techArray
.filter((t) => !isDonated || t.donated)
.map((techEntry, index) => (
<TechCard
{...techEntry}
translations={{ badgeDonated: translator.t('badges.donated') }}
key={index}
/>
))}
</div>

Comment on lines +29 to +36
<Image
src={getLogoSrc(logo)}
alt={title}
className="mx-auto w-1/2 rounded-sm sm:w-full"
width="48"
height="48"
unoptimized
/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enable image optimization for better performance.

The unoptimized prop bypasses Next.js's built-in image optimization. Consider removing it to benefit from automatic image optimization.

 <Image
 	src={getLogoSrc(logo)}
 	alt={title}
 	className="mx-auto w-1/2 rounded-sm sm:w-full"
 	width="48"
 	height="48"
-	unoptimized
 />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Image
src={getLogoSrc(logo)}
alt={title}
className="mx-auto w-1/2 rounded-sm sm:w-full"
width="48"
height="48"
unoptimized
/>
<Image
src={getLogoSrc(logo)}
alt={title}
className="mx-auto w-1/2 rounded-sm sm:w-full"
width="48"
height="48"
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
website Issues concerning Website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Web]: Tech stack overview page with cards
2 participants