-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: ui impros #67
Conversation
WalkthroughThis 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 Changes
Possibly related PRs
Suggested labels
Poem
Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for curate-v2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this 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 specificationsThe 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
andsmoothHoverTransition
.web/src/components/OverlayPortal.tsx (1)
5-12
: Consider moving z-index to theme constantsThe 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-filterThe 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 loadingWhile 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 accessibilityThe 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 linksSocial 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 valuesInstead 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 logicThe 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 scalingThe 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 fileExternal 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 managementInstead 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 valueSince
isMobileNavbar
is a boolean prop that's always set totrue
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
⛔ 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*[;)]|$)' --multilineLength of output: 15400
web/src/layout/Header/index.tsx (2)
45-45
: Review StatusBanner watcher configurationThe 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 impactReducing 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 javascriptLength 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 accessibilityNew 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 javascriptLength 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 3Length 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 1Length 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 2Length of output: 924
web/src/styles/global-style.ts (1)
20-20
: Verify theme.lightBlue availability across themesPlease 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 mobileThe hover color changes to
theme.white
ortheme.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:
- Review the changelog for any breaking changes
- Test the affected components thoroughly
There was a problem hiding this 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:
- Use the library's theming system if available
- Target specific props or custom class names instead of internal ones
- 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 touseIsDesktop
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 onisDesktop
.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 selectionViewToggle
for handling grid/list view switchingThis 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 utilitiesUsing 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
📒 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
andStyledListIcon
to useBaseIconStyles
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 readabilityThe increase from 16px to 20px provides better visual hierarchy and readability while maintaining responsiveness.
56-63
: LGTM: Enhanced hover states improve user feedbackThe addition of hover states for both icon and text provides clear visual feedback for user interaction.
70-72
: LGTM: Navigation logic extractionExtracting 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 constantUsing MAX_WIDTH_LANDSCAPE constant improves maintainability and consistency across the application.
Also applies to: 22-22
39-43
: LGTM: Improved external link implementationThe 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 implementationThe 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 implementationThe implementation follows the same pattern as other pages, ensuring consistent layout constraints across the application.
Also applies to: 25-25
Also idk if its only me, but the icons look misaligned 🤔 |
There was a problem hiding this 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
There was a problem hiding this 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
⛔ 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
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
ExternalLink
andInternalLink
components with hover styles.OverlayPortal
for improved modal handling.MAX_WIDTH_LANDSCAPE
.Footer
andHeader
components for better layout and responsiveness.@kleros/ui-components-library
.Filters
component to utilizeuseIsDesktop
for responsive design.Summary by CodeRabbit
Dependency Updates
@kleros/ui-components-library
from^2.15.0
to^2.20.0
New Components
ExternalLink
for styled external linksInternalLink
for styled internal linksOverlayPortal
for rendering content outside the component hierarchyLogo
component for header brandingStyledExternalLink
for improved external linkingUI Improvements
Misc Changes