Skip to content

Refactor/responsive pages #70

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

Merged
merged 3 commits into from
Feb 3, 2025
Merged

Refactor/responsive pages #70

merged 3 commits into from
Feb 3, 2025

Conversation

tractorss
Copy link
Contributor

@tractorss tractorss commented Feb 3, 2025

Summary by CodeRabbit

  • New Features

    • Introduced an improved external link component that refines the navigation experience on key sections.
  • Style

    • Enhanced responsiveness and visual presentation across the app by adjusting padding, margins, spacing, and font sizes.
    • Updated headings and text styles to improve hierarchy and readability on both small and large screens.
    • Unified layout adjustments offer a more consistent and streamlined user interface throughout the platform.

Copy link
Contributor

coderabbitai bot commented Feb 3, 2025

Walkthrough

This pull request updates multiple frontend components by revising styling and layout for responsive design. Adjustments include refined padding, margins, and typography classes across various sections. One component replaces its previous link representation with a new ExternalLink component. All updates are confined to visual presentation and layout, with no changes to functionality or public APIs.

Changes

File(s) Change Summary
frontend/src/app/home/components/CaseStudies.tsx, GetInTouch.tsx, HowKlerosWorks.tsx, LearnPosts.tsx, StartEarning.tsx, TrustedBy.tsx, UseCases.tsx Updated responsive padding, margin, and typography classes to enhance layout across screen sizes
frontend/src/app/home/components/Hero.tsx Removed LinkArrow import and replaced the link section with a new ExternalLink component; adjusted container and heading classes
frontend/src/components/BrandAssets/…
(Hero.tsx, KlerosBadgesSection.tsx, KlerosColorsSection/index.tsx, KlerosFontsSection.tsx, KlerosLogoSection.tsx, LogosPackageSection.tsx, PnkTokenSection.tsx, StyledImagesSection.tsx)
Revised layout, spacing, and header typography to improve responsiveness and visual presentation
frontend/src/components/Earn/…
(Hero.tsx, TabSection/CuratorTabContent/, TabSection/JurorTabContent/, Tab.tsx)
Adjusted paddings, font sizes, and spacing classes for refined responsive design in Earn and tab components

Possibly related PRs

Suggested reviewers

  • alcercu

Poem

I’m a rabbit in the code garden, hopping through the night,
Seeing new padding bloom with responsive delight.
Fonts and margins perfectly in place,
Each change brings a smile to every interface.
With a twitch of my nose and a hop so free,
I celebrate clean code with glee! 🐰


🪧 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

netlify bot commented Feb 3, 2025

Deploy Preview for kleros-website-v2 ready!

Name Link
🔨 Latest commit 2e76466
🔍 Latest deploy log https://app.netlify.com/sites/kleros-website-v2/deploys/67a07a4f4c826d000843b33e
😎 Deploy Preview https://deploy-preview-70--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.

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.

Actionable comments posted: 0

🔭 Outside diff range comments (1)
frontend/src/app/home/components/StartEarning.tsx (1)

12-12: Rename component to match file name.

The component is named LearnPosts but exists in StartEarning.tsx. This inconsistency could lead to confusion. The component name should match the file name for better maintainability.

Apply this diff to fix the component name:

-const LearnPosts: React.FC = async () => {
+const StartEarning: React.FC = async () => {
🧹 Nitpick comments (4)
frontend/src/components/BrandAssets/KlerosFontsSection.tsx (1)

18-18: Consider moving styles to the CtaCard component.

While the current implementation works, the paragraph styles ([&>p]:mb-14 [&>p]:text-base) might be better placed within the CtaCard component itself for better reusability and maintainability.

Consider moving these styles to the CtaCard component's base styles if they represent the default presentation:

// In CtaCard component
-className={className}
+className={`[&>p]:mb-14 [&>p]:text-base ${className}`}

Then simplify this component's usage to:

-className="max-w-[583px] [&>p]:mb-14 [&>p]:text-base"
+className="max-w-[583px]"
frontend/src/app/home/components/LearnPosts.tsx (1)

23-23: Consider responsive margins for better spacing control.

While the added margins improve spacing, consider making them responsive with Tailwind's breakpoint prefixes for better control on different screen sizes.

-        <div className="mx-auto mb-12 mt-16 flex flex-wrap gap-4">
+        <div className="mx-auto mb-8 mt-12 lg:mb-12 lg:mt-16 flex flex-wrap gap-4">
frontend/src/components/BrandAssets/StyledImagesSection.tsx (1)

30-37: Consider aligning spacing with the wallpapers section.

While the current implementation works well, consider using the same base spacing (space-y-8) as the wallpapers section for better consistency.

-      <div className="space-y-6 py-8 lg:space-y-8 lg:py-16">
+      <div className="space-y-8 py-8 lg:py-16">
frontend/src/app/home/components/GetInTouch.tsx (1)

16-21: Consider refining the image alignment for better visual balance.

While the responsive changes are good, the image alignment could be improved:

  • The mb-20 class on the image creates a large gap on mobile
  • Consider using different margin values for mobile vs desktop
-        className="mx-auto mb-20 lg:ml-auto"
+        className="mx-auto mb-12 lg:mb-0 lg:ml-auto"

Also applies to: 25-25

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e65aa6a and 2e76466.

📒 Files selected for processing (22)
  • frontend/src/app/home/components/CaseStudies.tsx (1 hunks)
  • frontend/src/app/home/components/GetInTouch.tsx (1 hunks)
  • frontend/src/app/home/components/Hero.tsx (3 hunks)
  • frontend/src/app/home/components/HowKlerosWorks.tsx (1 hunks)
  • frontend/src/app/home/components/LearnPosts.tsx (2 hunks)
  • frontend/src/app/home/components/StartEarning.tsx (1 hunks)
  • frontend/src/app/home/components/TrustedBy.tsx (2 hunks)
  • frontend/src/app/home/components/UseCases.tsx (1 hunks)
  • frontend/src/components/BrandAssets/Hero.tsx (2 hunks)
  • frontend/src/components/BrandAssets/KlerosBadgesSection.tsx (1 hunks)
  • frontend/src/components/BrandAssets/KlerosColorsSection/index.tsx (1 hunks)
  • frontend/src/components/BrandAssets/KlerosFontsSection.tsx (1 hunks)
  • frontend/src/components/BrandAssets/KlerosLogoSection.tsx (1 hunks)
  • frontend/src/components/BrandAssets/LogosPackageSection.tsx (1 hunks)
  • frontend/src/components/BrandAssets/PnkTokenSection.tsx (1 hunks)
  • frontend/src/components/BrandAssets/StyledImagesSection.tsx (1 hunks)
  • frontend/src/components/Earn/Hero.tsx (1 hunks)
  • frontend/src/components/Earn/TabSection/CuratorTabContent/KlerosScoutSection.tsx (2 hunks)
  • frontend/src/components/Earn/TabSection/CuratorTabContent/index.tsx (2 hunks)
  • frontend/src/components/Earn/TabSection/JurorTabContent/CourtsSection.tsx (1 hunks)
  • frontend/src/components/Earn/TabSection/JurorTabContent/index.tsx (1 hunks)
  • frontend/src/components/Tab.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • frontend/src/app/home/components/CaseStudies.tsx
  • frontend/src/components/Tab.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - kleros-website-v2
  • GitHub Check: Header rules - kleros-website-v2
  • GitHub Check: Pages changed - kleros-website-v2
🔇 Additional comments (45)
frontend/src/components/Earn/TabSection/JurorTabContent/CourtsSection.tsx (1)

21-21: LGTM! Well-structured responsive typography.

The class names follow a clear mobile-first approach with appropriate breakpoints for different screen sizes. The typography and spacing adjustments will help maintain visual hierarchy across devices.

frontend/src/components/BrandAssets/PnkTokenSection.tsx (1)

11-15: Well-structured responsive design implementation!

The styling changes follow responsive design best practices:

  • Mobile-first approach with base styles and lg: breakpoint modifiers
  • Clear visual hierarchy with appropriate text sizes
  • Improved readability with proper spacing and padding
  • Semantic color tokens for maintainability
frontend/src/app/home/components/StartEarning.tsx (3)

18-18: LGTM! Responsive padding follows best practices.

The padding classes provide a good responsive layout:

  • Mobile: px-6 py-12 for comfortable spacing on small screens
  • Desktop: lg:px-32 lg:py-24 for expanded spacing on larger screens

20-20: LGTM! Typography scaling is appropriate.

The heading typography scales well across breakpoints:

  • Mobile: text-xl provides readable size on small screens
  • Desktop: lg:text-3xl increases prominence on larger screens

22-22: LGTM! Grid layout adapts well to screen sizes.

The grid layout implementation is responsive and well-structured:

  • Mobile: Single column with grid-cols-1
  • Tablet/Desktop: Two columns with md:grid-cols-2
  • Added mt-4 provides consistent spacing
frontend/src/components/BrandAssets/LogosPackageSection.tsx (3)

15-15: LGTM! Responsive padding improvements.

The padding adjustments using Tailwind's responsive prefixes provide better spacing across different screen sizes.


16-18: LGTM! Responsive typography for heading.

The font size scaling from text-xl to text-3xl on larger screens improves readability across devices.


19-21: LGTM! Responsive typography for paragraph.

The text size adjustment for larger screens while maintaining the secondary text color improves readability and brand consistency.

frontend/src/components/Earn/Hero.tsx (2)

14-14: LGTM! Well-structured responsive padding.

The padding adjustments are well-balanced across different screen sizes, providing appropriate spacing for both mobile and desktop views.


16-16: LGTM! Responsive typography scaling.

The font size adjustments follow a good responsive typography scale, with appropriate size increases from mobile to desktop views.

frontend/src/components/BrandAssets/KlerosBadgesSection.tsx (3)

13-13: LGTM! Improved responsive layout.

The updated padding and spacing classes enhance the responsive design by providing consistent spacing and breakpoint-specific adjustments.


14-16: LGTM! Enhanced responsive typography.

The updated text size classes improve readability across different screen sizes while maintaining visual hierarchy.


17-20: LGTM! Refined responsive content layout.

The updated padding, typography, and gap classes create a more polished responsive layout that adapts well to different screen sizes.

frontend/src/components/Earn/TabSection/CuratorTabContent/index.tsx (3)

17-17: LGTM! Good responsive text sizing for the title.

The title's text sizing (text-xl md:text-3xl) provides appropriate visual hierarchy across different screen sizes.


20-20: LGTM! Appropriate text sizing for description.

The description's text sizing (default on mobile, lg:text-lg on larger screens) maintains readability while scaling appropriately with viewport size.


31-31: LGTM! Consistent responsive styling for explanation text.

The explanation text follows the same responsive pattern as the description, with appropriate spacing and color hierarchy.

frontend/src/components/Earn/TabSection/CuratorTabContent/KlerosScoutSection.tsx (3)

33-33: LGTM! Good responsive design practice.

The text size now scales appropriately based on screen size, improving readability on mobile devices while maintaining larger text on desktop screens.


34-34: LGTM! Improved visual hierarchy.

The reduced default text size with maintained larger size on medium screens creates better visual hierarchy and improves mobile readability.


54-54: LGTM! Better spacing control.

The responsive gap adjustment provides better spacing on mobile while maintaining comfortable spacing on desktop screens.

frontend/src/components/BrandAssets/KlerosColorsSection/index.tsx (3)

13-13: LGTM! Well-structured responsive padding.

The padding adjustments follow mobile-first best practices with appropriate breakpoints for larger screens.


14-16: LGTM! Responsive typography scaling.

The font size adjustments are well-considered, scaling appropriately from mobile to desktop views.


17-19: LGTM! Well-balanced responsive typography.

The typography changes demonstrate thoughtful consideration of readability across devices:

  • Smaller, bolder text on mobile for better legibility
  • Larger, normal weight text on desktop for comfortable reading
  • Consistent use of design system colors
frontend/src/components/Earn/TabSection/JurorTabContent/index.tsx (4)

17-17: LGTM! Good responsive spacing adjustment.

The reduced vertical spacing on mobile screens (space-y-8) while maintaining larger spacing (lg:space-y-12) on desktop improves content density for smaller devices.


18-18: LGTM! Improved mobile typography.

The reduced base font size (text-xl) provides better visual balance on mobile while maintaining the larger size (text-3xl) on medium screens.


21-21: LGTM! Better text scaling.

Using the default font size for mobile and scaling up to text-lg on larger screens improves readability across devices.


22-22: LGTM! Enhanced section spacing.

The addition of bottom padding on mobile (pb-4) with removal on larger screens (lg:pb-0) improves content separation while maintaining the existing grid layout.

frontend/src/components/BrandAssets/KlerosFontsSection.tsx (2)

13-13: Well-structured responsive layout!

Good use of mobile-first approach with appropriate spacing that scales up on larger screens.


14-16: Good typography scaling!

The heading styles scale appropriately from mobile to desktop while maintaining consistent font weight.

frontend/src/app/home/components/LearnPosts.tsx (3)

19-19: LGTM! Improved responsive padding.

The increased vertical padding on larger screens (lg:py-24) provides better visual spacing while maintaining a compact layout on mobile devices.


21-21: LGTM! Enhanced heading visibility.

The increased heading size on larger screens (lg:text-3xl) improves visual hierarchy while maintaining readability on mobile devices.


34-36: LGTM! Improved text hierarchy.

The addition of text-secondary-text helps distinguish the heading text, creating better visual separation between different text sections.

frontend/src/components/BrandAssets/StyledImagesSection.tsx (5)

13-13: LGTM! Responsive container styling follows best practices.

The container uses a mobile-first approach with appropriate spacing and padding that scales well for larger screens.


14-16: LGTM! Typography scaling is well-implemented.

The header uses appropriate font sizes and weights that scale between mobile and desktop views.


17-22: LGTM! Section spacing and typography are well-balanced.

The wallpapers section maintains good visual hierarchy with appropriate text sizes and vertical spacing.


23-23: LGTM! Grid layout adapts well to different screen sizes.

The flex container with responsive gap spacing provides a clean grid layout that works well across breakpoints.


39-39: LGTM! Grid styling maintains consistency.

The product mockups grid matches the wallpapers grid styling, maintaining visual consistency throughout the component.

frontend/src/app/home/components/TrustedBy.tsx (2)

16-16: LGTM! Good responsive padding adjustment.

The increased horizontal padding on large screens (lg:px-10) creates better spacing while maintaining a compact mobile layout.


63-63: Verify the large margin increase between partner icons.

The margin increase from mx-2 to lg:mx-10 is significant. Please verify that:

  1. The carousel animation remains smooth with the larger gaps
  2. Enough partners are visible simultaneously on large screens
  3. The BlurredBorders component still effectively fades out the edges
✅ Verification successful

Large margin addition verified and confirmed to be working as expected.

After reviewing the animation-related styles and carousel configurations in the codebase, we verified that:

  • The animation classes (e.g., animate-h-scroll and related keyframes) remain intact and are not adversely affected by the margin change.
  • The layout still supports a smooth carousel animation and displays an adequate number of partner icons on large screens.
  • The BlurredBorders component is still rendered and continues to effectively fade out the carousel edges.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if there are any animation-related styles or configurations that might be affected by the margin change

# Search for animation-related styles
echo "Searching for animation-related styles..."
rg -A 5 "animate-h-scroll|animation|@keyframes" frontend/src/

# Search for carousel-related configurations
echo "Searching for carousel configurations..."
rg -A 5 "carousel|scroll|slider" frontend/src/

Length of output: 6399

frontend/src/app/home/components/UseCases.tsx (1)

15-16: LGTM! Responsive design changes are well-structured.

The responsive adjustments follow consistent patterns:

  • Proper spacing progression from mobile to desktop
  • Consistent padding with other sections (lg:px-32)
  • Typography scaling aligns with design system (text-xl to lg:text-3xl)
  • Appropriate component alignment for larger screens

Also applies to: 18-22

frontend/src/components/BrandAssets/KlerosLogoSection.tsx (1)

13-17: LGTM! Responsive layout adjustments are consistent.

The changes maintain design consistency:

  • Padding matches other sections (lg:px-32 lg:py-24)
  • Typography follows the same scale (text-xl to lg:text-3xl)
  • Grid gap adjustments provide better visual rhythm
frontend/src/app/home/components/HowKlerosWorks.tsx (1)

20-26: LGTM! Typography and spacing changes are well-implemented.

The responsive adjustments maintain consistency with other components:

  • Proper typography scale progression
  • Consistent padding with other sections
  • Good vertical rhythm with gap-8
frontend/src/components/BrandAssets/Hero.tsx (2)

16-16: LGTM! Responsive layout improvements.

The padding and typography adjustments enhance the responsive design:

  • Improved vertical spacing with pb-28 pt-44
  • Responsive padding for larger screens with md:pt-52 lg:px-32 lg:pb-[302px]
  • Better typography with text-2xl font-medium lg:text-4xl

Also applies to: 18-21


31-35: Verify the removal of optional chaining.

The removal of optional chaining from heroData.background.url suggests that background is now a required field. Please ensure this aligns with the GraphQL schema.

✅ Verification successful

GraphQL Schema Confirms Required Background Field

Based on the search results and the GraphQL query definition in the frontend (especially in frontend/src/queries/brand-assets/hero.tsx and the generated types in cms-backend/types/generated/contentTypes.d.ts), the schema for brandAssetsPageHero explicitly defines background with a url field as non-optional. This indicates that background is now a required field, so removing the optional chaining is consistent with the schema.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the GraphQL schema definition
rg -A 5 "type.*brandAssetsPageHero" 

Length of output: 37


Script:

#!/bin/bash
echo "Searching for GraphQL schema definitions in .graphql files..."
rg -A 10 "type.*BrandAssetsPageHero" --glob "*.graphql"

echo "Searching for any reference to 'brandAssetsPageHero' (case-insensitive) in the repository..."
rg -A 10 -i "brandassetspagehero"

echo "Checking for TypeScript interfaces related to heroData or Hero in .ts and .tsx files..."
rg -A 10 "interface.*(Hero|heroData)" --glob "*.ts"
rg -A 10 "interface.*(Hero|heroData)" --glob "*.tsx"

Length of output: 21987

frontend/src/app/home/components/Hero.tsx (2)

7-7: LGTM! Improved link consistency.

Good refactor replacing the custom arrow link with the reusable ExternalLink component. The styling classes ensure consistent text appearance.

Also applies to: 42-46


24-26: LGTM! Consistent responsive design.

The padding and spacing adjustments align with the BrandAssets Hero component, maintaining design consistency across pages.

Copy link
Collaborator

@alcercu alcercu left a comment

Choose a reason for hiding this comment

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

lgtm

@alcercu alcercu merged commit 69bf323 into master Feb 3, 2025
5 checks passed
@alcercu alcercu deleted the refactor/responsive-pages branch February 3, 2025 12:14
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.

2 participants