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 9 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 Jan 2, 2025 11:47am

Copy link

coderabbitai bot commented Dec 6, 2024

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 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 3db2d98):

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

(expires Thu, 09 Jan 2025 11:46:38 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: b7b0969384059dce6ea8fad1ee1d1737e54e6676

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

@ssandino
Copy link
Member Author

@DarkMenacer would you have time to give this PR a first review? @lvonlanthen did his first PR for this repo and the entire issue is very similar to the partners page (cards). Let us know and we plan accordingly.

@DarkMenacer
Copy link
Contributor

DarkMenacer commented Dec 23, 2024

Sure @ssandino, on it right away

@DarkMenacer
Copy link
Contributor

@lvonlanthen, I think these 3 should be enough for now
I might have a couple of things here and there but maybe you would end up correcting them while working on these 3 points itself (if not I'll point them out)
Also please feel free to ask if anything isn't clear to you

lvonlanthen added a commit that referenced this pull request Dec 31, 2024
During initial render or while translation is loading, the `translator` or `techArray` variables might still be null. In this case, display a loading spinner that will be replaced with the actual content once it is available.

Based on #976 (comment)
@lvonlanthen lvonlanthen force-pushed the lvonlanthen/techstack-page branch from 1cab6a4 to 3ef9ff5 Compare December 31, 2024 10:08
@lvonlanthen
Copy link

@lvonlanthen, I think these 3 should be enough for now I might have a couple of things here and there but maybe you would end up correcting them while working on these 3 points itself (if not I'll point them out) Also please feel free to ask if anything isn't clear to you

@DarkMenacer I fixed the two unresolved conversations, but I am not sure which 3 issues you mean. Also, I guess I would need some pointers on other things to improve. Thanks!

@@ -0,0 +1,50 @@
'use client';
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any particular reason you are making this a client-side component?
I think we can instead make techcard.tsx into a client-side component and store it in a separate folder (components) instead of (sections)

Choose a reason for hiding this comment

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

I encountered issues with client/server components and async/await when adding the tabs. I was able to fix it by adding 'use client' (and replacing Translator.getInstance with useTranslator), but I don't know React well enough to tell if this is the correct fix. I saw that 'use client' is used quite often throughout the code and it seems to do the trick.

When turning techcard.tsx into a client-side component, I think (again, limited React knowledge on my side) I would also need to do the same with techlist.tsx because I am using useState to keep track of the tab state to filter the list and useState only works for client components, correct?

Should I still try to refactor both files into components? And to improve my understanding of React, what are the reasons for not using 'use client'?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @lvonlanthen, I completely relate with you. Even I had some difficulty in understanding the difference between client-side and server-side components. Michael had shared a link with me which really helped me clarify my doubts. I shall do the same: NextJS Components.

The main idea here is: Instead of sending the entire component over from the server, just send the data and load the component using browser's resources (i.e. client-side). It is just a good way to reduce server load

That is why I believe that techcard can be a client-side component and techlist can do the data fetching part.
Let me also share one of the pages I worked on recently for you to understand the implementation there.

Here's the server-side component: Section-1 Cards List
and here's the client-side component: Section Card

You can also go through other sections (2 and 3) and the web page so that the point becomes crystal clear.

Finally, feel free to ping me on Slack as well if you would like more discussion around this. Always happy to help 😊.

@DarkMenacer
Copy link
Contributor

@lvonlanthen, I think these 3 should be enough for now I might have a couple of things here and there but maybe you would end up correcting them while working on these 3 points itself (if not I'll point them out) Also please feel free to ask if anything isn't clear to you

@DarkMenacer I fixed the two unresolved conversations, but I am not sure which 3 issues you mean. Also, I guess I would need some pointers on other things to improve. Thanks!

Oh sorry, it seems I hadn't submitted my review before, my bad
Are my comments visible now?

lvonlanthen and others added 6 commits January 2, 2025 12:09
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.
During initial render or while translation is loading, the `translator` or `techArray` variables might still be null. In this case, display a loading spinner that will be replaced with the actual content once it is available.

Based on #976 (comment)
The property `region` is not used by the child components and does not need to be passed along.
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
3 participants