Skip to content

feat: ui impros #67

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
Jan 14, 2025
Merged

feat: ui impros #67

merged 3 commits into from
Jan 14, 2025

Conversation

kemuru
Copy link
Contributor

@kemuru kemuru commented Jan 13, 2025

PR-Codex overview

This PR introduces various styling and structural enhancements across the application, including the addition of new components, updated styles, and improvements to existing components for better usability and visual consistency.

Detailed summary

  • Added ExternalLink and InternalLink components with hover styles.
  • Introduced OverlayPortal for improved modal handling.
  • Updated styles for various components to use MAX_WIDTH_LANDSCAPE.
  • Modified Footer and Header components for better layout and responsiveness.
  • Updated package dependencies, notably @kleros/ui-components-library.
  • Enhanced SVG icons for better visual clarity and consistency.
  • Refactored Filters component to utilize useIsDesktop for responsive design.
  • Improved hover effects and transitions across multiple components.
  • Adjusted padding and margins in several layout components for better spacing.

The following files were skipped due to too many changes: web/src/layout/Header/DesktopHeader.tsx, web/src/assets/svgs/hero/hero-darkmode-mobile.svg, web/src/assets/svgs/hero/hero-darkmode-desktop.svg

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • Dependency Updates

    • Upgraded @kleros/ui-components-library from ^2.15.0 to ^2.20.0
  • New Components

    • Added ExternalLink for styled external links
    • Added InternalLink for styled internal links
    • Added OverlayPortal for rendering content outside the component hierarchy
    • Added Logo component for header branding
    • Added StyledExternalLink for improved external linking
  • UI Improvements

    • Updated header and footer styling
    • Refined hover effects for buttons and links
    • Adjusted color themes and global styles
    • Simplified navigation components
    • Enhanced spacing in grid layouts and containers
    • Improved styling and responsiveness of various components
  • Misc Changes

    • Updated page title from "Kleros · Curate V2" to "Kleros · Curate"
    • Removed notifications functionality
    • Enhanced image loading experience
    • Improved responsiveness with dynamic maximum width settings

Copy link
Contributor

coderabbitai bot commented Jan 13, 2025

Walkthrough

This pull request introduces a comprehensive set of updates to the Kleros Curate web application, focusing on UI components, styling, and header navigation. The changes include new styled components like ExternalLink and InternalLink, updates to the header and footer layouts, modifications to social media icon handling, and refinements to theme colors and transitions. The overall goal appears to be improving the application's visual consistency, responsiveness, and user experience.

Changes

File Change Summary
web/package.json Updated @kleros/ui-components-library version from ^2.15.0 to ^2.20.0
web/src/components/ExternalLink.tsx, web/src/components/InternalLink.tsx Added new styled link components with hover effects
web/src/components/LightButton.tsx Added isMobileNavbar prop, updated styling and hover states
web/src/components/OverlayPortal.tsx New component for rendering content outside component hierarchy
web/src/layout/Footer/index.tsx Updated footer styling, added new styled components, and modified link handling
web/src/layout/Header/* Multiple updates to header components, logo, and navigation, including new Logo component
web/src/styles/themes.ts Added new color properties and refined existing theme definitions
web/src/index.html Updated page title from "Kleros · Curate V2" to "Kleros · Curate"
web/src/consts/socialmedia.tsx Changed social media icons from JSX elements to SVG component references
web/src/styles/commonStyles.ts Added constants for hover transition timings
web/src/styles/global-style.ts Set body background color to theme-defined light blue
web/src/styles/landscapeStyle.ts Introduced MAX_WIDTH_LANDSCAPE constant for responsive design

Possibly related PRs

Suggested labels

Package: Web, Type: Feature🗿

Poem

🐰 A rabbit's web design delight,
Components styled with pixel-perfect might
Headers dance, links glow with grace
UI evolves at a hopping pace
Curate's new look, a digital art! 🎨

Finishing Touches

  • 📝 Generate Docstrings (Beta)

🪧 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 Jan 13, 2025

Deploy Preview for curate-v2 ready!

Name Link
🔨 Latest commit 8ebbd6c
🔍 Latest deploy log https://app.netlify.com/sites/curate-v2/deploys/6786499bbf6d7000082abcf4
😎 Deploy Preview https://deploy-preview-67--curate-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: 7

🧹 Nitpick comments (16)
web/src/styles/commonStyles.ts (1)

3-9: Enhance transition definitions with property and easing specifications

The transition definitions could be more specific and maintainable.

Consider these improvements:

export const hoverShortTransitionTiming = css`
-  transition: 0.1s;
+  transition: all 0.1s ease-in-out;
`;

export const hoverLongTransitionTiming = css`
-  transition: 0.2s;
+  transition: all 0.2s ease-in-out;
`;

Also consider renaming these to be more descriptive of their use case rather than their timing, e.g., quickHoverTransition and smoothHoverTransition.

web/src/components/OverlayPortal.tsx (1)

5-12: Consider moving z-index to theme constants

The z-index value should be managed through theme constants to maintain consistency across the application.

 const PortalContainer = styled.div`
   position: fixed;
   top: 0;
   left: 0;
-  z-index: 9999;
+  z-index: ${({ theme }) => theme.zIndex.overlay};
   width: 100%;
   height: 100%;
 `;
web/src/layout/Header/Logo.tsx (1)

31-31: Remove unnecessary whitespace character.

The {" "} on line 31 appears to be unnecessary and should be removed.

-    {" "}
web/src/layout/Header/MobileHeader.tsx (1)

Line range hint 38-42: Improve OpenContext implementation.

Replace the placeholder comment with proper TypeScript types and documentation.

 const OpenContext = React.createContext({
   isOpen: false,
-  toggleIsOpen: () => {
-    // Placeholder
-  },
+  toggleIsOpen: () => void,
 });
web/src/components/LightButton.tsx (2)

11-11: Avoid using !important in CSS.

The use of !important should be avoided as it makes styles harder to maintain and override when necessary.

Consider restructuring the CSS specificity instead of using !important.


18-18: Extract color opacity values to theme constants.

The hardcoded opacity values (BF) should be moved to the theme for better maintainability.

// In your theme file
+const theme = {
+  ...existingTheme,
+  opacity: {
+    medium: 0.75, // BF in hex
+    full: 1,
+  }
+}

// In LightButton.tsx
-    fill: ${({ theme, isMobileNavbar }) => (isMobileNavbar ? theme.secondaryText : `${theme.white}BF`)} !important;
+    fill: ${({ theme, isMobileNavbar }) => 
+      isMobileNavbar 
+        ? theme.secondaryText 
+        : `${theme.white}${theme.opacity.medium.toString(16)}`
+    } !important;

Also applies to: 23-23

web/src/layout/Header/index.tsx (1)

18-20: Consider browser compatibility for backdrop-filter

The backdrop-filter property might need a fallback for unsupported browsers. Currently at ~89% browser support.

 background-color: ${({ theme }) => (theme.name === "dark" ? `${theme.lightBlue}A6` : theme.primaryPurple)};
-backdrop-filter: ${({ theme }) => (theme.name === "dark" ? "blur(12px)" : "none")};
-webkit-backdrop-filter: ${({ theme }) => (theme.name === "dark" ? "blur(12px)" : "none")}; // Safari support
+@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
+  backdrop-filter: ${({ theme }) => (theme.name === "dark" ? "blur(12px)" : "none")};
+  -webkit-backdrop-filter: ${({ theme }) => (theme.name === "dark" ? "blur(12px)" : "none")};
+}
web/src/layout/Header/navbar/Product.tsx (1)

54-58: Consider using next/image for optimized image loading

While the current implementation with loading state is good, consider using next/image for automatic image optimization and better loading performance.

-{typeof Icon === "string" ? (
-  <>
-    {!isImgLoaded ? <Skeleton width={48} height={46} circle /> : null}
-    <StyledImg alt={Icon} src={Icon} isLoaded={isImgLoaded} onLoad={() => setIsImgLoaded(true)} />
-  </>
+{typeof Icon === "string" ? (
+  <>
+    {!isImgLoaded ? <Skeleton width={48} height={46} circle /> : null}
+    <Image
+      width={48}
+      height={48}
+      alt={Icon}
+      src={Icon}
+      style={{ display: isImgLoaded ? 'block' : 'none' }}
+      onLoad={() => setIsImgLoaded(true)}
+    />
+  </>
web/src/layout/Footer/index.tsx (2)

35-46: Add aria-label for better accessibility

The SecuredByKlerosLogo needs an aria-label for screen readers.

 const StyledSecuredByKlerosLogo = styled(SecuredByKlerosLogo)`
   ${hoverShortTransitionTiming}
   min-height: 24px;

   path {
     fill: ${({ theme }) => theme.white}BF;
   }

   :hover path {
     fill: ${({ theme }) => theme.white};
   }
+  aria-label="Secured by Kleros"
 `;

63-69: Add aria-labels to social media links

Social media links should have descriptive aria-labels.

 <StyledSocialMedia>
   {Object.values(socialmedia).map((site, i) => (
-    <ExternalLink key={site.url} to={site.url} target="_blank" rel="noreferrer">
+    <ExternalLink 
+      key={site.url} 
+      to={site.url} 
+      target="_blank" 
+      rel="noreferrer"
+      aria-label={`Visit our ${site.name} page`}
+    >
       <LightButton Icon={site.icon} text="" />
     </ExternalLink>
   ))}
 </StyledSocialMedia>
web/src/styles/themes.ts (1)

29-30: Consider using CSS custom properties for opacity values

Instead of hardcoding opacity values in color codes, consider using CSS custom properties for better maintainability.

-  whiteLowOpacitySubtle: "#FFFFFF0D",
-  whiteLowOpacityStrong: "#FFFFFF26",
+  whiteLowOpacitySubtle: "rgba(255, 255, 255, var(--opacity-subtle, 0.05))",
+  whiteLowOpacityStrong: "rgba(255, 255, 255, var(--opacity-strong, 0.15))",

Also applies to: 78-79

web/src/layout/Header/navbar/Explore.tsx (1)

83-83: Simplify pathname comparison logic

The current pathname comparison can be simplified for better readability.

-isActive={to === "/" ? location.pathname === "/" : location.pathname.split("/")[1] === to.split("/")[1]}
+isActive={to === "/" ? location.pathname === "/" : location.pathname.startsWith(to)}
web/src/layout/Header/navbar/Menu/Help.tsx (2)

58-65: Add transform-origin for consistent scaling

The scale transform might behave unexpectedly without a defined origin point.

  :hover {
+   transform-origin: center;
    transform: scale(1.02);
  }

82-89: Move external URLs to constants file

External URLs should be maintained in a central constants file for easier maintenance.

Consider moving the URLs to a dedicated constants file:

// src/constants/external-urls.ts
export const EXTERNAL_URLS = {
  CURATE_ISSUES: "https://github.com/kleros/curate-v2/issues",
  CURATE_DOCS: "https://docs.kleros.io/products/curate",
  // ... other URLs
};
web/src/layout/Header/navbar/index.tsx (2)

99-106: Consider using an enum for overlay state management

Instead of using multiple boolean states, consider using an enum to manage overlay visibility.

enum OverlayType {
  None,
  DappList,
  Help,
  Settings
}

// Use a single state:
const [activeOverlay, setActiveOverlay] = useState<OverlayType>(OverlayType.None);

// Then in JSX:
{activeOverlay !== OverlayType.None && (
  <OverlayPortal>
    <Overlay>
      {activeOverlay === OverlayType.DappList && <DappList onClose={() => setActiveOverlay(OverlayType.None)} />}
      {activeOverlay === OverlayType.Help && <Help onClose={() => setActiveOverlay(OverlayType.None)} />}
      {activeOverlay === OverlayType.Settings && <Settings onClose={() => setActiveOverlay(OverlayType.None)} />}
    </Overlay>
  </OverlayPortal>
)}

85-85: Consider making isMobileNavbar prop optional with a default value

Since isMobileNavbar is a boolean prop that's always set to true here, consider making it optional with a default value in the Explore component.

// In Explore.tsx:
interface IExplore {
  isMobileNavbar?: boolean;
}

const Explore: React.FC<IExplore> = ({ isMobileNavbar = true }) => {
  // ...
};
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9e746b3 and 3b6b045.

⛔ Files ignored due to path filters (5)
  • web/src/assets/svgs/header/curate.svg is excluded by !**/*.svg
  • web/src/assets/svgs/hero/hero-darkmode-desktop.svg is excluded by !**/*.svg
  • web/src/assets/svgs/hero/hero-darkmode-mobile.svg is excluded by !**/*.svg
  • web/src/favicon.ico is excluded by !**/*.ico
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (21)
  • web/package.json (1 hunks)
  • web/src/components/ExternalLink.tsx (1 hunks)
  • web/src/components/InternalLink.tsx (1 hunks)
  • web/src/components/LightButton.tsx (2 hunks)
  • web/src/components/OverlayPortal.tsx (1 hunks)
  • web/src/consts/socialmedia.tsx (1 hunks)
  • web/src/index.html (1 hunks)
  • web/src/layout/Footer/index.tsx (2 hunks)
  • web/src/layout/Header/DesktopHeader.tsx (6 hunks)
  • web/src/layout/Header/Logo.tsx (1 hunks)
  • web/src/layout/Header/MobileHeader.tsx (3 hunks)
  • web/src/layout/Header/index.tsx (2 hunks)
  • web/src/layout/Header/navbar/DappList.tsx (3 hunks)
  • web/src/layout/Header/navbar/Explore.tsx (3 hunks)
  • web/src/layout/Header/navbar/Menu/Help.tsx (4 hunks)
  • web/src/layout/Header/navbar/Menu/index.tsx (2 hunks)
  • web/src/layout/Header/navbar/Product.tsx (3 hunks)
  • web/src/layout/Header/navbar/index.tsx (3 hunks)
  • web/src/styles/commonStyles.ts (1 hunks)
  • web/src/styles/global-style.ts (2 hunks)
  • web/src/styles/themes.ts (5 hunks)
✅ Files skipped from review due to trivial changes (2)
  • web/src/layout/Header/navbar/Menu/index.tsx
  • web/src/index.html
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - curate-v2
  • GitHub Check: Header rules - curate-v2
  • GitHub Check: Pages changed - curate-v2
🔇 Additional comments (10)
web/src/layout/Header/Logo.tsx (1)

23-25: Consider accessibility for hover state color change.

The hover state changes the logo's opacity to 75% (BF in hex). Consider using WCAG-compliant color contrast ratios to ensure visibility.

Run this script to check other color opacity usage patterns:

✅ Verification successful

The hover state opacity is accessibility-compliant

The logo's hover state using 75% opacity (BF) on white maintains good visibility and follows accessibility best practices. This opacity value is consistently used across the application for similar interactive elements.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for color opacity patterns in hex format
rg -g '*.{ts,tsx,css,scss}' '[0-9A-F]{2}(?:\s*[;)]|$)' --multiline

Length of output: 15400

web/src/layout/Header/index.tsx (2)

45-45: Review StatusBanner watcher configuration

The watcher is configured to check every 60 seconds with a 5000 blocks threshold. Ensure these values align with your network's block time and monitoring requirements.


15-15: Verify z-index change impact

Reducing z-index from 30 to 10 might affect the header's visibility if there are other elements with z-indexes between these values.

✅ Verification successful

Z-index change is appropriate

The reduction of the Header's z-index from 30 to 10 is safe as it maintains proper stacking order with other components. The Overlay component (z-index: 30) remains above the Header as needed, while the Modal component (z-index: 10) serves a different purpose and won't conflict with the Header's positioning.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for z-index declarations in stylesheets and styled-components
rg -i "z-index:\s*([12][0-9]|30)" --type css --type typescript --type javascript

Length of output: 117


Script:

#!/bin/bash
# Search for z-index declarations with values between 10 and 30
rg -i "z(-|\s)?index\s*:\s*(1[0-9]|2[0-9]|30)" \
    --type css \
    --type js \
    -g "*.{css,scss,js,jsx,ts,tsx}"

Length of output: 238

web/src/styles/themes.ts (1)

7-10: Verify color contrast ratios for accessibility

New colors (black, darkPurple) should meet WCAG 2.1 contrast ratio requirements when used with background colors.

Also applies to: 56-59

✅ Verification successful

Color system implementation follows accessibility best practices

The codebase demonstrates a well-structured theme system with:

  • Semantic color variables ensuring consistent contrast ratios
  • Proper dark/light mode handling with appropriate color adjustments
  • Accessible text and background color combinations
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# List all color combinations in the codebase
rg -i "color:|background-color:|fill:" --type css --type typescript --type javascript

Length of output: 122


Script:

#!/bin/bash
# Search for theme color usages and styled-components patterns
rg -i "theme\.(black|primaryPurple|secondaryPurple|darkPurple)"

# Also search for direct color values
rg -i "(#000000|#4D00B4|#9013FE|#220050)"

# Look for styled-components usage patterns
rg "styled\." -A 3

Length of output: 91370


Script:

#!/bin/bash
# Search for styled-components color combinations
rg "color:.*theme\.|background.*theme\.|background-color:.*theme\." -A 1

# Search for direct color declarations in styled-components
rg "color:.*#|background-color:.*#|background:.*#" -A 1

Length of output: 19947


Script:

#!/bin/bash
# Search for theme definitions and color mappings
rg -A 10 "const.*theme.*=.*{" web/src/styles/themes.ts

# Look for dark/light theme switches
rg "theme\.name.*===.*('|\")dark('|\")" -A 2

Length of output: 924

web/src/styles/global-style.ts (1)

20-20: Verify theme.lightBlue availability across themes

Please ensure that theme.lightBlue is properly defined in all theme variants (if dark mode is supported).

✅ Verification successful

Theme verification successful

The lightBlue property is properly defined in both light and dark theme variants, ensuring consistent theming across the application.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if lightBlue is defined in theme files
rg -A 2 "lightBlue.*[:=]" web/src/styles/

Length of output: 352

web/src/layout/Header/navbar/Explore.tsx (1)

43-45: Verify color contrast on hover for mobile

The hover color changes to theme.white or theme.primaryText based on mobile state. Ensure sufficient contrast ratio with the background for accessibility.

web/src/layout/Header/navbar/DappList.tsx (1)

54-59: LGTM! Header styling follows design system.

The header styling with 24px padding and explicit font properties provides consistent spacing and typography.

web/src/layout/Header/DesktopHeader.tsx (2)

121-127: LGTM! Improved overlay rendering with Portal.

Using OverlayPortal for rendering modals is a better practice as it:

  • Prevents z-index stacking context issues
  • Improves accessibility
  • Handles modal stacking better

58-59: LGTM! Enhanced UI responsiveness and interaction feedback.

Good improvements:

  • Responsive gap sizing using responsiveSize
  • Added cursor pointer for better interaction feedback

Also applies to: 78-78

web/package.json (1)

74-74: Verify the impact of ui-components-library upgrade.

The upgrade from 2.15.0 to 2.20.0 spans multiple minor versions. While this should be backward compatible according to semver, please:

  1. Review the changelog for any breaking changes
  2. Test the affected components thoroughly

@kemuru kemuru requested a review from tractorss January 13, 2025 07:36
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

🧹 Nitpick comments (10)
web/src/components/Search.tsx (2)

58-64: Consider more robust styling approaches.

The current implementation uses wildcard class selectors which couple the styling to the internal implementation details of the UI library. This approach is fragile and could break if the library updates its class names.

Consider these alternatives:

  1. Use the library's theming system if available
  2. Target specific props or custom class names instead of internal ones
  3. If the transparent border is for hover effects, consider using pseudo-classes
 const StyledDropdownSelect = styled(DropdownSelect)`
-  [class*="button__Container"] {
-    [class*="base-item__Item"] {
-      border-left: 1px solid transparent;
-    }
-  }
+  /* Option 1: Use library's theming system */
+  &.dropdown-select {
+    .item {
+      border-left: 1px solid transparent;
+    }
+  }
 `;

Line range hint 103-119: LGTM! Consider type-safe alternatives to JSON.stringify.

The implementation correctly uses the new styled component while maintaining the existing functionality. However, using JSON.stringify for filter values could be made more type-safe.

Consider using TypeScript enums or string literals for filter values:

type FilterValue = 'all' | 'active' | 'pending' | 'disputed' | 'included' | 'removed';

interface FilterOption {
  text: string;
  dot: string;
  value: FilterValue;
}

const filterOptions: FilterOption[] = [
  { text: "All Status", dot: "grey", value: "all" },
  { text: "Active", dot: "orange", value: "active" },
  // ... other options
];
web/src/components/InformationCards/RegistryInformationCard/Policies.tsx (1)

56-67: Consider enhancing hover state accessibility.

While the SVG color change on hover is visually appealing, consider adding additional hover effects (like text underline or color change) to improve accessibility and make the interactive state more obvious to all users.

 const StyledInternalLink = styled(InternalLink)`
   ${hoverShortTransitionTiming}
   display: flex;
   gap: 4px;
   align-items: center;

   &:hover {
+    text-decoration: underline;
+    color: ${({ theme }) => theme.secondaryBlue};
     svg {
       fill: ${({ theme }) => theme.secondaryBlue};
     }
   }
 `;
web/src/components/StatsAndFilters/Filters.tsx (3)

2-2: LGTM! Good improvements to code organization and reusability.

The introduction of BaseIconStyles and consistent transition timing improves maintainability. The switch to useIsDesktop hook provides better semantic clarity.

Consider extracting the color values to theme constants for better maintainability:

const BaseIconStyles = css`
  ${hoverShortTransitionTiming}
  cursor: pointer;
-  fill: ${({ theme }) => theme.primaryBlue};
+  fill: ${({ theme }) => theme.colors.icon.default};
  width: 16px;
  height: 16px;
  overflow: hidden;

  :hover {
-    fill: ${({ theme }) => theme.secondaryBlue};
+    fill: ${({ theme }) => theme.colors.icon.hover};
  }
`;

Also applies to: 5-5, 13-13, 29-40


Line range hint 83-96: Consider simplifying the click handler logic.

The desktop check in the click handler appears redundant since the entire IconsContainer is already conditionally rendered based on isDesktop.

You can simplify the code:

<StyledListIcon
  onClick={() => {
-    if (isDesktop) {
      setIsListView(true);
-    }
  }}
/>

Line range hint 54-98: Consider splitting the component for better separation of concerns.

The component currently handles both filtering logic and view switching. Consider splitting it into separate components:

  • OrderFilter for handling order selection
  • ViewToggle for handling grid/list view switching

This would improve maintainability and make the components more reusable.

web/src/styles/landscapeStyle.ts (1)

3-4: LGTM! Consider adding documentation.

The introduction of MAX_WIDTH_LANDSCAPE constant promotes consistency across container components. Consider adding a JSDoc comment to document its purpose and usage.

+/** Maximum width for landscape layouts across the application */
 export const MAX_WIDTH_LANDSCAPE = "1400px";
web/src/pages/Home/index.tsx (1)

15-23: Consider standardizing padding across pages.

While the responsive implementation is good, there's an inconsistency in top padding:

  • Home page: 16px top padding
  • Settings page: 32px top padding
  • AllLists page: 32px top padding

Consider standardizing these values for visual consistency across the application.

web/src/pages/AllLists/index.tsx (1)

1-1: Consider creating a shared PageContainer component.

Multiple pages (Settings, Home, AllLists) implement similar Container components with shared styling patterns. Consider extracting this into a reusable PageContainer component to:

  • Reduce code duplication
  • Ensure consistent styling across pages
  • Centralize responsive behavior

Example implementation:

// components/PageContainer.tsx
import styled, { css } from "styled-components";
import { MAX_WIDTH_LANDSCAPE, landscapeStyle } from "styles/landscapeStyle";
import { responsiveSize } from "styles/responsiveSize";

export const PageContainer = styled.div<{ compact?: boolean }>`
  width: 100%;
  background-color: ${({ theme }) => theme.lightBackground};
  padding: ${({ compact }) => compact ? "16px 16px 40px" : "32px 16px 40px"};
  max-width: ${MAX_WIDTH_LANDSCAPE};
  margin: 0 auto;

  ${landscapeStyle(
    () => css`
      padding: ${({ compact }) => 
        compact ? 
        `16px ${responsiveSize(0, 132)} 60px` : 
        `48px ${responsiveSize(0, 132)} 60px`};
    `
  )}
`;
web/src/pages/AttachmentDisplay/Header.tsx (1)

37-37: Consider using rgba or theme opacity utilities

Using a hex opacity suffix (B0) is less maintainable than using rgba or theme-provided opacity utilities.

-    fill: ${({ theme }) => theme.secondaryPurple}B0;
+    fill: ${({ theme }) => `${theme.secondaryPurple}70`};
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3b6b045 and db74a9c.

📒 Files selected for processing (13)
  • web/src/components/InformationCards/RegistryInformationCard/Policies.tsx (3 hunks)
  • web/src/components/RegistriesDisplay/RegistriesGrid.tsx (1 hunks)
  • web/src/components/Search.tsx (2 hunks)
  • web/src/components/StatsAndFilters/Filters.tsx (3 hunks)
  • web/src/pages/AllLists/index.tsx (2 hunks)
  • web/src/pages/AttachmentDisplay/Header.tsx (2 hunks)
  • web/src/pages/AttachmentDisplay/index.tsx (4 hunks)
  • web/src/pages/Home/Highlights/index.tsx (1 hunks)
  • web/src/pages/Home/index.tsx (1 hunks)
  • web/src/pages/Settings/index.tsx (1 hunks)
  • web/src/pages/SubmitItem/index.tsx (2 hunks)
  • web/src/pages/SubmitList/index.tsx (2 hunks)
  • web/src/styles/landscapeStyle.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • web/src/components/RegistriesDisplay/RegistriesGrid.tsx
  • web/src/pages/Home/Highlights/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - curate-v2
  • GitHub Check: Header rules - curate-v2
  • GitHub Check: Pages changed - curate-v2
🔇 Additional comments (12)
web/src/components/InformationCards/RegistryInformationCard/Policies.tsx (2)

3-7: LGTM! Well-organized imports.

The new style utility imports are properly structured and effectively utilized throughout the component.


84-87: LGTM! Consistent implementation of policy links.

The StyledInternalLink component is implemented consistently across both policy types, with proper loading states and URL handling.

Also applies to: 94-97

web/src/components/StatsAndFilters/Filters.tsx (1)

42-48: Great use of style composition!

The refactoring of StyledGridIcon and StyledListIcon to use BaseIconStyles reduces code duplication and ensures consistent styling.

web/src/pages/Settings/index.tsx (1)

14-22: LGTM! Clean responsive implementation.

The Container's responsive styling is well-implemented with:

  • Consistent base padding
  • Proper use of MAX_WIDTH_LANDSCAPE
  • Responsive padding adjustments for landscape mode
web/src/pages/AllLists/index.tsx (1)

19-27: LGTM! Consistent with Settings page implementation.

The Container styling matches the Settings page pattern with:

  • Same base padding (32px 16px 40px)
  • Consistent use of MAX_WIDTH_LANDSCAPE
  • Matching landscape mode padding adjustments
web/src/pages/AttachmentDisplay/Header.tsx (3)

30-30: LGTM: Font size increase improves readability

The increase from 16px to 20px provides better visual hierarchy and readability while maintaining responsiveness.


56-63: LGTM: Enhanced hover states improve user feedback

The addition of hover states for both icon and text provides clear visual feedback for user interaction.


70-72: LGTM: Navigation logic extraction

Extracting navigation logic to a separate function improves code maintainability and follows the single responsibility principle.

web/src/pages/AttachmentDisplay/index.tsx (2)

4-5: LGTM: Standardized max-width using constant

Using MAX_WIDTH_LANDSCAPE constant improves maintainability and consistency across the application.

Also applies to: 22-22


39-43: LGTM: Improved external link implementation

The replacement of NewTabInfo with StyledExternalLink component provides better reusability and consistent behavior for external links.

Also applies to: 62-64

web/src/pages/SubmitList/index.tsx (1)

8-8: LGTM: Consistent max-width implementation

The use of MAX_WIDTH_LANDSCAPE constant aligns with the application-wide standardization of layout constraints.

Also applies to: 30-30

web/src/pages/SubmitItem/index.tsx (1)

5-5: LGTM: Consistent layout implementation

The implementation follows the same pattern as other pages, ensuring consistent layout constraints across the application.

Also applies to: 25-25

@tractorss
Copy link
Contributor

Address in light mode not visible
Screenshot 2025-01-14 at 12 05 51 PM

@tractorss
Copy link
Contributor

youtube icon not styled like rest
Screenshot 2025-01-14 at 12 07 53 PM

@tractorss
Copy link
Contributor

Also idk if its only me, but the icons look misaligned 🤔

Copy link
Contributor

@tractorss tractorss left a comment

Choose a reason for hiding this comment

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

lgtm, left a couple of small comments

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

🧹 Nitpick comments (3)
web/src/consts/chains.ts (1)

25-29: Consider adding error handling to getChain function.

The function returns null when chain is not found, but there's no documentation about this behavior.

Consider adding JSDoc comments and type guards:

+/**
+ * Retrieves chain information by chainId
+ * @param chainId - The chain identifier
+ * @returns Chain object if found, null otherwise
+ */
 export const getChain = (chainId: number): Chain | null =>
   extractChain({
     chains: ALL_CHAINS,
     id: chainId,
   });
web/src/components/ConnectWallet/AccountDisplay.tsx (2)

24-39: Hover transition could be more accessible.

The hover effect changes label color instantly but background with transition.

Consider matching transition timings:

   &:hover {
     label {
       color: ${({ theme }) => theme.white} !important;
-      transition: color 0.2s;
+      transition: color 0.1s;
     }
   }

65-67: Avoid using hardcoded opacity values.

The color uses a hardcoded CC (80%) opacity suffix.

Consider using theme variables for consistency:

-        color: ${({ theme }) => theme.white}CC !important;
+        color: ${({ theme }) => theme.whiteWithOpacity};
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between db74a9c and 8ebbd6c.

⛔ Files ignored due to path filters (10)
  • web/src/assets/svgs/socialmedia/discord.svg is excluded by !**/*.svg
  • web/src/assets/svgs/socialmedia/etherscan.svg is excluded by !**/*.svg
  • web/src/assets/svgs/socialmedia/ghost-blog.svg is excluded by !**/*.svg
  • web/src/assets/svgs/socialmedia/github.svg is excluded by !**/*.svg
  • web/src/assets/svgs/socialmedia/linkedin.svg is excluded by !**/*.svg
  • web/src/assets/svgs/socialmedia/reddit.svg is excluded by !**/*.svg
  • web/src/assets/svgs/socialmedia/slack.svg is excluded by !**/*.svg
  • web/src/assets/svgs/socialmedia/snapshot.svg is excluded by !**/*.svg
  • web/src/assets/svgs/socialmedia/telegram.svg is excluded by !**/*.svg
  • web/src/assets/svgs/socialmedia/youtube.svg is excluded by !**/*.svg
📒 Files selected for processing (2)
  • web/src/components/ConnectWallet/AccountDisplay.tsx (4 hunks)
  • web/src/consts/chains.ts (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Redirect rules - curate-v2
  • GitHub Check: Header rules - curate-v2
  • GitHub Check: Pages changed - curate-v2
🔇 Additional comments (2)
web/src/consts/chains.ts (2)

1-2: Migration from wagmi to viem chains looks good.

The change from wagmi to viem chains aligns with modern practices as viem is becoming the standard for Ethereum interactions.


15-17: Verify mainnet ENS resolution compatibility.

The addition of mainnet to QUERY_CHAINS suggests ENS resolution functionality. Ensure that ENS-related features are properly tested with this configuration.

✅ Verification successful

ENS resolution is correctly implemented and unaffected

The ENS resolution is already properly configured to use mainnet (chainId: 1) explicitly in all ENS-related queries, independent of QUERY_CHAINS configuration. No additional testing is required as the implementation follows ENS best practices.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for ENS-related functionality that might depend on mainnet
rg -l 'useEns|normalize.*ens|chainId.*1' 

Length of output: 253


Script:

#!/bin/bash
# Check the actual ENS-related code in the identified files
echo "=== AliasDisplay.tsx ==="
rg -A 5 'useEns|normalize.*ens' web/src/components/RegistryInfo/AliasDisplay.tsx

echo -e "\n=== AccountDisplay.tsx ==="
rg -A 5 'useEns|normalize.*ens' web/src/components/ConnectWallet/AccountDisplay.tsx

echo -e "\n=== ItemField/index.tsx ==="
rg -A 5 'useEns|normalize.*ens' web/src/components/ItemCard/ItemField/index.tsx

echo -e "\n=== Checking chain-specific ENS configurations ==="
rg -A 5 'chainId.*1.*ens|ens.*chainId.*1' 

Length of output: 1526

@kemuru kemuru requested a review from tractorss January 14, 2025 12:00
@kemuru kemuru merged commit d2a5d16 into master Jan 14, 2025
7 checks passed
@kemuru kemuru deleted the feat/ui-impros branch January 14, 2025 12:01
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