Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refont domain registration page step 1 #951 #999

Open
wants to merge 2 commits into
base: testnet
Choose a base branch
from

Conversation

caxtonacollins
Copy link

@caxtonacollins caxtonacollins commented Jan 26, 2025

Close: #951

Summary by CodeRabbit

Release Notes

  • UI Improvements

    • Refined input field styling with bolder font and adjusted text size
    • Updated button design with reduced height and rounded corners
    • Enhanced form layout and responsiveness
  • Visual Changes

    • Adjusted icon sizes and component styling
    • Simplified registration flow and form rendering
    • Added close icon to user information form
  • Styling Updates

    • Implemented more responsive design for registration components
    • Modified background colors and spacing for various UI elements

Copy link

vercel bot commented Jan 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app-starknet-id ❌ Failed (Inspect) Jan 26, 2025 3:31pm

Copy link

vercel bot commented Jan 26, 2025

@caxtonacollins is attempting to deploy a commit to the LFG Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Jan 26, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

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

Walkthrough

This pull request encompasses modifications across multiple UI components and stylesheets, focusing on visual refinements and layout adjustments. The changes primarily involve styling updates in components related to user registration and identity selection, including modifications to icon sizes, font styles, button dimensions, and responsive design elements. The updates aim to enhance the visual consistency and user interface across various registration and selection screens.

Changes

File Change Summary
components/UI/inputHelper.tsx Reduced InfoIcon width from "28px" to "20px"
components/UI/numberTextField.tsx Changed font from "Poppins-Regular" to "Poppins-bold", updated font size to "1.1rem", set background color to "#ffffff"
components/domains/registerV3.tsx Simplified rendering by removing conditional RegisterSteps component
components/domains/selectIdentity.tsx Added InputHelper, modified Select component with custom icon and styling
components/domains/steps/userInfoForm.tsx Removed imageUrl prop, added CloseIcon, simplified SwissForm rendering
styles/components/button.module.css Reduced button height, padding, changed border-radius, added cross-browser radius support
styles/components/registerV3.module.css Made container and card widths responsive, added .closeIcon class
styles/components/variants.module.css Updated .defaultSwissForm with border-radius, background color, and hover state

Possibly related PRs

Suggested labels

🔥 Ready for review

Suggested reviewers

  • Marchand-Nicolas

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🔭 Outside diff range comments (2)
components/domains/selectIdentity.tsx (1)

Line range hint 31-41: Add error handling for fetch call.

The fetch call lacks error handling which could lead to unhandled exceptions if the server is unavailable or returns an error.

       fetch(
         `${process.env.NEXT_PUBLIC_SERVER_LINK
         }/addr_to_available_ids?addr=${hexToDecimal(account.address)}`
       )
         .then((response) => response.json())
+        .then((response) => {
+          if (!response.ok) {
+            throw new Error(`HTTP error! status: ${response.status}`);
+          }
+          return response.json();
+        })
         .then((data) => {
           const dataFiltered = data.ids.filter(
             (element: string, index: number) => {
               return data.ids.indexOf(element) === index;
             }
           );
           setOwnedIdentities(dataFiltered);
         });
+        .catch((error) => {
+          console.error('Error fetching identities:', error);
+          // Consider adding user feedback here
+        });
components/UI/numberTextField.tsx (1)

Line range hint 63-63: Fix incorrect type prop value.

The type prop is hardcoded to "te" which appears to be a typo.

-        type="te"
+        type="text"
🧹 Nitpick comments (5)
components/domains/selectIdentity.tsx (1)

55-55: Improve helper text clarity.

The helper text "check how to mint a new token" could be more descriptive to better guide users.

-      <InputHelper helperText="check how to mint a new token">
+      <InputHelper helperText="Learn how to mint a new Starknet ID token for your domain">
styles/components/variants.module.css (1)

20-23: Remove redundant vendor prefixes for border-radius.

Modern browsers have good support for border-radius without vendor prefixes. These prefixes add unnecessary code.

  border-radius: 10px;
- -webkit-border-radius: 10px;
- -moz-border-radius: 10px;
- -ms-border-radius: 10px;
- -o-border-radius: 10px;
styles/components/button.module.css (2)

28-31: Remove redundant vendor prefixes.

Similar to the previous file, these vendor prefixes are unnecessary for modern browsers.

  border-radius: 8px;
- -webkit-border-radius: 8px;
- -moz-border-radius: 8px;
- -ms-border-radius: 8px;
- -o-border-radius: 8px;

Also applies to: 107-110


104-104: Fix comment formatting.

Remove spaces in the comment to improve readability.

- /*BasedonNimiqLightBlue*/border-radius: 8px;
+ /* Based on Nimiq Light Blue */ border-radius: 8px;
styles/components/registerV3.module.css (1)

306-311: Add z-index to close icon.

The close icon might need a z-index to ensure it's always clickable, especially if there are overlapping elements.

.closeIcon {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
+ z-index: 1;
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 70e7911 and 8b6cb4e.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • public/icons/closeIcon.svg is excluded by !**/*.svg
📒 Files selected for processing (8)
  • components/UI/inputHelper.tsx (1 hunks)
  • components/UI/numberTextField.tsx (1 hunks)
  • components/domains/registerV3.tsx (0 hunks)
  • components/domains/selectIdentity.tsx (3 hunks)
  • components/domains/steps/userInfoForm.tsx (3 hunks)
  • styles/components/button.module.css (2 hunks)
  • styles/components/registerV3.module.css (4 hunks)
  • styles/components/variants.module.css (1 hunks)
💤 Files with no reviewable changes (1)
  • components/domains/registerV3.tsx
🔇 Additional comments (8)
components/UI/inputHelper.tsx (1)

28-28: LGTM! Icon size adjustment for better visual balance.

The reduction in InfoIcon width from 28px to 20px provides better visual proportions within the tooltip context.

components/domains/selectIdentity.tsx (1)

56-105: LGTM! Improved Select component styling.

The styling changes enhance visual consistency and user experience:

  • Custom IconComponent implementation
  • Consistent font family usage
  • Better spacing and alignment
components/UI/numberTextField.tsx (1)

67-69: LGTM! Enhanced text field styling.

The styling changes improve visual hierarchy and readability:

  • Bold font weight for emphasis
  • Consistent font size
  • White background for better contrast
components/domains/steps/userInfoForm.tsx (1)

Line range hint 112-155: LGTM! Improved form layout and logic.

The changes enhance the form's usability and maintainability:

  • Better visual hierarchy with centered alignment
  • Simplified SwissForm rendering logic
  • Clear button state management
styles/components/variants.module.css (1)

19-19: LGTM! Good UX improvements.

The white background and hover state feedback improve visual clarity and user interaction.

Also applies to: 26-27

styles/components/button.module.css (1)

8-8: Verify button layout changes across different screen sizes.

The changes to button dimensions (height: 2.8rem, width: 95%) and padding might affect:

  1. Content alignment in buttons with icons
  2. Consistent spacing between buttons
  3. Mobile responsiveness

Also applies to: 15-15, 16-16, 18-18

✅ Verification successful

Button layout changes are properly implemented and safe

The button component has:

  • Proper responsive design with media queries
  • Consistent icon alignment (24px width, 12px margin)
  • Appropriate scaling for different screen sizes
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for button usage with icons or specific content alignment
rg -l "nq-button.*icon|nq-button.*align" --type css --type tsx --type jsx

Length of output: 103


Script:

#!/bin/bash
# Search for button-related files and responsive design patterns
echo "=== Button-related files ==="
fd -e css -e js -e jsx

echo -e "\n=== Button styles and responsive patterns ==="
rg -A 3 "button|\.btn" --type css

echo -e "\n=== Media queries for responsive design ==="
rg "@media" --type css -A 2

echo -e "\n=== Icon-related classes near buttons ==="
rg "icon|\.btn|button" --type css -A 2

Length of output: 20772

styles/components/registerV3.module.css (2)

3-3: Verify container and card visibility.

The changes to container width (60%) and transparent background might affect:

  1. Content visibility on different page backgrounds
  2. Readability of text content
  3. Mobile responsiveness

Also applies to: 16-16, 23-23

✅ Verification successful

Container styling changes are safe and well-implemented.

The transparent background works well with the parent's light background (#fff9f0), and the 60% relative width provides good responsiveness while maintaining readability. The white card background (#fff) ensures proper content visibility.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for background colors in parent containers
rg -A 3 "background-color|background:" --type css

Length of output: 27665


100-100: Consider content alignment impact.

Changing alignment to center might affect readability of longer text content. Consider if left alignment would be more appropriate for text-heavy content.

Also applies to: 102-102

Comment on lines +31 to 33
`${process.env.NEXT_PUBLIC_SERVER_LINK
}/addr_to_available_ids?addr=${hexToDecimal(account.address)}`
)
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Use URL constructor for safer URL building.

String concatenation for URL construction could lead to malformed URLs. Consider using the URL constructor for safer URL building.

-        `${process.env.NEXT_PUBLIC_SERVER_LINK
-        }/addr_to_available_ids?addr=${hexToDecimal(account.address)}`
+        new URL(`addr_to_available_ids`, process.env.NEXT_PUBLIC_SERVER_LINK).toString() +
+        `?addr=${encodeURIComponent(hexToDecimal(account.address))}`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
`${process.env.NEXT_PUBLIC_SERVER_LINK
}/addr_to_available_ids?addr=${hexToDecimal(account.address)}`
)
new URL(`addr_to_available_ids`, process.env.NEXT_PUBLIC_SERVER_LINK).toString() +
`?addr=${encodeURIComponent(hexToDecimal(account.address))}`

Comment on lines +108 to +110
<div className={styles.closeIcon}>
<CloseIcon />
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add onClick handler for CloseIcon.

The CloseIcon appears to be a close/cancel button but lacks an onClick handler to handle the action.

         <div className={styles.closeIcon}>
-          <CloseIcon />
+          <CloseIcon onClick={onClose} className="cursor-pointer" />
         </div>

Consider adding an onClose prop to the component to handle the close action.

Committable suggestion skipped: line range outside the PR's diff.

@Marchand-Nicolas
Copy link
Collaborator

@caxtonacollins Please fix the conflicts. Don't forget to reuse the components made by other contributors, especially since your issue is really related to several other ones

Copy link
Collaborator

@Marchand-Nicolas Marchand-Nicolas left a comment

Choose a reason for hiding this comment

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

Please test your code, it doesn't build. You can use npm run build to check that
image

@Marchand-Nicolas Marchand-Nicolas added the ❌ Change request Change requested from reviewer label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❌ Change request Change requested from reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refont domain registration page step 1
2 participants