Skip to content

Experiment: Font changed to Anek Odia #95

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

Open
wants to merge 1 commit into
base: fix(frontend)/apply-feedback-round-1
Choose a base branch
from

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Apr 4, 2025

https://fonts.google.com/specimen/Anek+Odia?preview.text=Justice%20as%20a%20Service

Summary by CodeRabbit

  • New Features

    • Launched dynamic enterprise and blockchain sections that display interactive content with real-time updates.
    • Added mobile-friendly pagination for smoother navigation on smaller screens.
  • Refactor

    • Streamlined page layouts by reorganizing content and removing outdated sections.
    • Improved asset handling to boost reliability and performance.
  • Style

    • Refreshed typography and spacing, featuring updated font styling, increased padding, and rounded image edges for a modern look.

Copy link
Contributor

coderabbitai bot commented Apr 4, 2025

Walkthrough

This pull request introduces multiple updates across the codebase. A custom webpack configuration has been added to handle SVG imports—differentiating between asset URLs and React components—along with the addition of a new development dependency. Several new React components have been implemented (including updated Enterprise and homepage sections), and existing components saw modifications in their import paths, JSX structures, and styling (using clsx). GraphQL queries and their TypeScript types were also updated (such as the removal of the tokenStats field). Global styles, layout fonts, and TypeScript configuration were similarly revised.

Changes

File(s) Change Summary
frontend/next.config.mjs; frontend/package.json; frontend/svgr.d.ts; frontend/tsconfig.json Added custom webpack SVG configuration (with separate rules for ?url and standard SVGs), new dependency @svgr/webpack, SVG TypeScript declarations, and updated TS includes.
frontend/.../enterprise/components/Hero.tsx; frontend/.../home/components/Enterprise/index.tsx; frontend/.../home/components/Web3/index.tsx; frontend/.../home/components/Enterprise/queries.ts; frontend/.../home/components/Web3/queries.ts; frontend/.../home/queries/hero.tsx; frontend/.../home/page.tsx Introduced new components (Hero, Web3) and GraphQL queries/types; removed fields (e.g. tokenStats); adjusted component imports and JSX structure on the homepage and enterprise sections.
frontend/.../enterprise/components/KlerosDisputeResolutionSection/*; frontend/.../enterprise/components/KlerosEnterpriseSection/*; frontend/.../enterprise/components/KlerosMediationSection/index.tsx; frontend/.../web-three/page.tsx; frontend/.../for-lawyers/components/Hero.tsx Updated import paths from “for-lawyers” to “enterprise”; removed unused components (e.g. KlerosEscrowSection, deprecated Hero) and restructured component hierarchy.
frontend/.../home/components/LearnPosts.tsx; frontend/.../home/components/TrustedBy.tsx; frontend/.../home/components/UseCases.tsx; frontend/.../components/CtaCard.tsx; frontend/.../components/DownloadButton.tsx; frontend/.../components/Dropdown/index.tsx; frontend/.../components/ExternalLink.tsx Enhanced UI styling via clsx with adjusted class names and layout spacing; updated SVG import statements to include the ?url query parameter.
frontend/.../components/MobilePagination.tsx; frontend/.../components/IntegrateSection/index.tsx; frontend/.../components/ResearchDevelopment/TabSection/*; frontend/.../queries/research-development/tabs-data.ts Added a new mobile pagination component; updated IntegrateSection to support a new listMode prop; modified ResearchDevelopment sections for conditional rendering and improved pagination logic with updated GraphQL query sorting.
frontend/.../app/layout.tsx; frontend/.../styles/globals.css Updated global font settings, replacing “Urbanist” with “Anek_Odia” in layout and global CSS.
frontend/.../components/Flowchart.tsx; frontend/.../components/ForBuilders/Hero.tsx; frontend/.../components/ForBuilders/UseCasesSection/*; frontend/.../components/Navbar/*; frontend/.../components/KlerosEscrowSection.tsx Made minor import adjustments (switching from relative to absolute paths) and UI tweaks such as padding and conditional rendering modifications.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer Code
    participant Webpack as Webpack Config
    participant Loader1 as File Loader (?url)
    participant Loader2 as @svgr/webpack Loader
    Dev->>Webpack: Import SVG (with or without ?url)
    Webpack-->>Dev: Check applied rule for SVG
    alt SVG with ?url
      Webpack->>Loader1: Process using file loader
    else Standard SVG import
      Webpack->>Loader2: Process using @svgr/webpack loader
    end
    Loader1-->>Webpack: Return asset URL
    Loader2-->>Webpack: Return React component
Loading
sequenceDiagram
    participant User as User
    participant Web3Comp as Web3 Component
    participant API as GraphQL API
    User->>Web3Comp: Load Web3 page
    Web3Comp->>API: Execute web3Query
    API-->>Web3Comp: Return { title, subtitle, cards }
    Web3Comp->>User: Render Web3 component with data
Loading

Possibly related PRs

Poem

Oh, I’m a bunny with a clever code,
Hopping through changes on every road.
SVGs now twirl in a webpack dance,
New queries and components join the prance.
With fonts anew and layouts so bright,
I’m leaping with joy at these changes today! 🐇
Happy coding from a rabbit’s play!

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@jaybuidl jaybuidl changed the base branch from master to fix(frontend)/apply-feedback-round-1 April 4, 2025 11:59
Copy link

netlify bot commented Apr 4, 2025

Deploy Preview for kleros-website-v2 ready!

Name Link
🔨 Latest commit aa4b9bc
🔍 Latest deploy log https://app.netlify.com/sites/kleros-website-v2/deploys/67efc99373e535000881d299
😎 Deploy Preview https://deploy-preview-95--kleros-website-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jaybuidl jaybuidl requested a review from alcercu April 4, 2025 11:59
Copy link
Contributor

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

Caution

Inline review comments failed to post. This is likely due to GitHub's limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 3

🧹 Nitpick comments (7)
frontend/src/styles/globals.css (1)

50-50: Font Update: Changing font-family to Anek Odia
The update changes the website’s primary font from Urbanist to Anek Odia. Make sure that the font is loaded (for example, via a Google Fonts link or import) and consider surrounding the font name with quotes (e.g., "Anek Odia", Helvetica, sans-serif) if the actual font name contains spaces, to ensure proper parsing by the browser.

frontend/src/components/ForBuilders/UseCasesSection/index.tsx (1)

14-19: Layout adjustment and code formatting change

The padding has been changed from py-16 md:py-24 (padding on top and bottom) to pt-16 md:pt-24 (padding only on top). This removes the bottom padding, which might create tighter spacing between this section and whatever follows it. Additionally, the h1 element's className has been reformatted to a multi-line style, though the classes themselves remain unchanged.

Ensure that removing the bottom padding was intentional and doesn't cause spacing issues with adjacent elements. This layout change might be related to accommodating the new Anek Odia font mentioned in the PR description.

frontend/src/app/enterprise/components/KlerosDisputeResolutionSection/ArbitrationMethodTable/TabelCardContent.tsx (1)

1-74: Consider fixing filename typo in a future PR

Note that the filename "TabelCardContent.tsx" contains a typo (should be "TableCardContent.tsx"). While not part of the current changes, this could be addressed in a future PR for better code organization and consistency.

frontend/src/app/home/components/Web3/index.tsx (1)

28-34: Consider adding error handling for the card rendering

The component maps directly over the cards array without any checks for empty or undefined values. Consider adding a fallback or error handling for cases where the array might be empty or the data structure differs from expected.

-          {cards.map(({ icon, title, subtitle }) => (
+          {cards?.length > 0 ? cards.map(({ icon, title, subtitle }) => (
             <CtaCard
               className="flex-grow"
               key={title}
               {...{ icon, title, description: subtitle }}
             />
-          ))}
+          )) : <p>No cards available</p>}
frontend/src/app/enterprise/components/Hero.tsx (1)

10-12: Consider naming consistency between component location and data source.

This component is located in the enterprise directory but fetches data from forLawyersPageHero. This naming inconsistency might cause confusion for developers. Consider either:

  1. Moving the component to a more appropriate directory
  2. Updating the query to fetch from an enterprise-related data source
  3. Adding a comment explaining the relationship
frontend/src/app/enterprise/page.tsx (1)

8-8: Remove commented-out code

Commented-out code creates unnecessary clutter and confusion in the codebase. Either remove the commented import completely or add a comment explaining why it's being kept.

-// import KlerosMediationSection from "./components/KlerosMediationSection";
frontend/src/app/home/components/Hero.tsx (1)

23-23: Button now visible on large screens.
You removed the lg:hidden style on this div, making the button always visible on large screens. Confirm this matches your design specs.

🛑 Comments failed to post (3)
frontend/src/app/home/components/Enterprise/index.tsx (1)

10-10: 🛠️ Refactor suggestion

Component name Web3 doesn't match its directory location Enterprise.

There's a significant naming inconsistency here. According to the file path (Enterprise/index.tsx) and the data being fetched (homeEnterprise), this component appears to be enterprise-related, but it's named Web3. This contradicts typical naming conventions where component names should align with their purpose or location.

Consider renaming the component to match its directory or purpose (e.g., Enterprise or EnterpriseSection) to improve code maintainability and readability.

frontend/src/components/ResearchDevelopment/TabSection/FellowshipTabContent/Fellows/index.tsx (1)

35-41: ⚠️ Potential issue

Fix missing dependencies in useEffect

The useEffect hook is missing page and numPages in its dependency array, which could lead to using stale values when the effect runs.

- useEffect(() => {
-   if (itemsPerPage === 1) {
-     setPage(page * 2 - 1);
-   } else {
-     setPage(Math.min(Math.floor(page / 2) + 1, numPages));
-   }
- }, [itemsPerPage]);
+ useEffect(() => {
+   if (itemsPerPage === 1) {
+     setPage(page * 2 - 1);
+   } else {
+     setPage(Math.min(Math.floor(page / 2) + 1, numPages));
+   }
+ }, [itemsPerPage, page, numPages]);
📝 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.

  useEffect(() => {
    if (itemsPerPage === 1) {
      setPage(page * 2 - 1);
    } else {
      setPage(Math.min(Math.floor(page / 2) + 1, numPages));
    }
  }, [itemsPerPage, page, numPages]);
frontend/src/components/MobilePagination.tsx (1)

18-53: ⚠️ Potential issue

Fix incorrect aria-label for next page button.

The aria-label on the next page button incorrectly describes the action as moving to the previous page.

-        aria-label="Move to the previous page"
+        aria-label="Move to the next page"
📝 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.

  return (
    <div
      className={clsx(
        "flex w-full items-center justify-center gap-8",
        className,
      )}
    >
      <button
        className={clsx(
          "size-6 rounded-full bg-primary-blue text-lg font-bold",
          "text-background-2 disabled:bg-stroke",
        )}
        disabled={currentPage === 1}
        aria-label="Move to the previous page"
        onClick={() => callback(currentPage - 1)}
      >
        <Arrow className="mx-auto fill-background-2" />
      </button>
      <label className="w-12 text-center">
        {currentPage}/{numPages}
      </label>
      <button
        className={clsx(
          "size-6 rounded-full bg-primary-blue text-lg font-bold",
          "text-background-2 disabled:bg-stroke",
        )}
        disabled={currentPage === numPages}
        aria-label="Move to the next page"
        onClick={() => callback(currentPage + 1)}
      >
        <Arrow className="mx-auto rotate-180 fill-background-2" />
      </button>
    </div>
  );
};

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