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 of idendity card on my identities page #1007

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

Conversation

Prosper1218
Copy link

@Prosper1218 Prosper1218 commented Jan 27, 2025

fix: #945

This PR refactors the design and functionality of the identity card on the "Identities" page to improve UI/UX, enhance performance, and streamline code structure.

Summary by CodeRabbit

  • New Features

    • Introduced a refreshed loading state for identities, replacing older indicators.
    • Rolled out an enhanced add button and updated visual iconography.
  • Bug Fixes

    • Adjusted the layout and styling of various components for better responsiveness and visual appeal.
  • Style

    • Improved overall layouts with optimized spacing, margins, and responsive design.
    • Applied refined styling including hidden scrollbars for a cleaner interface.

Copy link

vercel bot commented Jan 27, 2025

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

Name Status Preview Comments Updated (UTC)
app-starknet-id ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 3:45pm

Copy link

vercel bot commented Jan 27, 2025

@Prosper1218 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 27, 2025

Walkthrough

The pull request makes updates across environment variables, React components, and CSS files. It re-includes the NEXT_PUBLIC_STARKNET_ID in the environment test file, reorganizes the identity components and their associated skeleton loader, removes an unused BackButton from a token page, and adjusts margins and layouts. In addition, it revises several CSS modules with new classes and media queries and updates an SVG icon’s structure and styling.

Changes

File(s) Change Summary
.env.test Re-added the NEXT_PUBLIC_STARKNET_ID variable line without modifying its value.
components/identities/availableIdentities.tsx
components/identities/skeletons/identitiesSkeleton.tsx
Reorganized layout and updated the import for the skeleton component; adjusted JSX structure and updated skeleton dimensions and structure.
pages/identities/[tokenId].tsx
pages/identities.tsx
Removed the unused BackButton, adjusted JSX structure and margins, and added new styling classes.
styles/Home.module.css
styles/components/identitiesV1.module.css
Modified heights, margins, and gaps; added new classes (.IDScreen, .CardContainer, .SIDENAV) and updated media queries.
components/UI/iconsComponents/icons/renewalIcon.tsx Revised the SVG by adjusting dimensions, viewBox, and fill colors while adding new graphical elements.
styles/globals.css Added the .hide-scrollbar class with vendor-specific rules to hide scrollbars.

Assessment against linked issues

Objective Addressed Explanation
Refont of identity card on my identities page (#945)

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.

@Marchand-Nicolas
Copy link
Collaborator

Hello @Prosper1218 just merged the buttons: #1006
I think there's not much work here, appart checking the margin between the card and the buttons is enough compared to figma. Also, when I click "View More", the card move a little bit, please make it static (like on the current app.starknet.id)

@Prosper1218
Copy link
Author

Hello @Prosper1218 just merged the buttons: #1006 I think there's not much work here, appart checking the margin between the card and the buttons is enough compared to figma. Also, when I click "View More", the card move a little bit, please make it static (like on the current app.starknet.id)

alright. i'll work on that right away.

@Marchand-Nicolas
Copy link
Collaborator

Hey @Prosper1218 the nav has been added here #1001
Same, make sure it looks like on figma.
Also, can you remove the back button that pops up when you select an identity please ?
Screenshot 2025-01-28 at 1 34 45 PM

In addition, fix the skeleton, which is not representative anymore of what is loading (+ it's not centered anymore)
image

@Marchand-Nicolas
Copy link
Collaborator

Hey, just merged the last PR (for the card) #1004 now you have everything!

@Prosper1218
Copy link
Author

Screenshot 2025-01-28 205915
above is what the page currently looks like.

Screenshot 2025-01-28 205952
Above is what it looks like when the view more button is clicked.

Screenshot 2025-01-28 213712
and above is the current loading screen to go with it. please review so i can make any neccessary changes.

and if you noticed, i removed the back button.

@Prosper1218 Prosper1218 marked this pull request as ready for review January 28, 2025 21:39
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 (4)
.env.example (1)

21-25: Remove unnecessary empty lines.

Multiple consecutive empty lines don't serve any purpose and make the file harder to read.

 NEXT_PUBLIC_AVNU_API=https://starknet.impulse.avnu.fi/v1
-
-
-
-
-
styles/components/identitiesV1.module.css (1)

61-66: Improve skeleton layout consistency.

The skeleton layout changes look good, but consider using CSS Grid for better control over the layout:

.identitiesSkeleton {
-   display: flex;
-   flex-direction: row;
-   justify-content: center;
-   width: 100%;
-   gap: 16px;
+   display: grid;
+   grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
+   gap: 16px;
+   width: 100%;
+   place-items: center;
}
context/StarknetIdJsProvider.tsx (1)

24-26: Simplify boolean expression.

The ternary operator is unnecessary for a boolean conversion.

-   const isTestnet = useMemo(() => {
-      return process.env.NEXT_PUBLIC_IS_TESTNET === "true" ? true : false;
-   }, []);
+   const isTestnet = useMemo(() => {
+      return process.env.NEXT_PUBLIC_IS_TESTNET === "true";
+   }, []);
🧰 Tools
🪛 Biome (1.9.4)

[error] 25-25: Unnecessary use of boolean literals in conditional expression.

Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with

(lint/complexity/noUselessTernary)

components/identities/identityCard.tsx (1)

38-59: Use optional chaining for click handlers.

The click handlers can be simplified using optional chaining.

-  <div className={styles.pfp} onClick={() => onPPClick && onPPClick()}>
+  <div className={styles.pfp} onClick={() => onPPClick?.()}>
-  <div className={styles.mobilePfp} onClick={() => onPPClick && onPPClick()}>
+  <div className={styles.mobilePfp} onClick={() => onPPClick?.()}>
🧰 Tools
🪛 Biome (1.9.4)

[error] 40-40: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 52-52: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cac1dea and ade753f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • .env.example (1 hunks)
  • .env.test (1 hunks)
  • components/identities/availableIdentities.tsx (1 hunks)
  • components/identities/identityCard.tsx (1 hunks)
  • components/identities/skeletons/identitiesSkeleton.tsx (1 hunks)
  • context/StarknetIdJsProvider.tsx (1 hunks)
  • pages/identities/[tokenId].tsx (1 hunks)
  • styles/Home.module.css (1 hunks)
  • styles/components/identitiesV1.module.css (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • .env.test
  • pages/identities/[tokenId].tsx
  • components/identities/availableIdentities.tsx
🧰 Additional context used
🪛 Biome (1.9.4)
components/identities/identityCard.tsx

[error] 40-40: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 52-52: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

context/StarknetIdJsProvider.tsx

[error] 25-25: Unnecessary use of boolean literals in conditional expression.

Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with

(lint/complexity/noUselessTernary)

🔇 Additional comments (5)
.env.example (1)

26-45: 🛠️ Refactor suggestion

Remove duplicated configurations.

These commented-out configurations are exact duplicates of the active ones above. Having duplicates:

  • Creates confusion about which values should be used
  • Increases maintenance overhead when values need to be updated
  • Makes the file harder to read and maintain
-# NEXT_PUBLIC_SERVER_LINK=https://api.starknet.id
-# NEXT_PUBLIC_STARKNET_ID=https://starknet.id
-# NEXT_PUBLIC_IDENTITY_CONTRACT=0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af
-# NEXT_PUBLIC_STARKNETID_CONTRACT=0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af
-# NEXT_PUBLIC_NAMING_CONTRACT=0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678
-# NEXT_PUBLIC_PRICING_CONTRACT=0x035F2ca59fE00Ef8968B98EA4b79de0e82a8daC4CBc0f48E93F3dE90e65Ae568
-# NEXT_PUBLIC_VERIFIER_CONTRACT=0x07d14dfd8ee95b41fce179170d88ba1f0d5a512e13aeb232f19cfeec0a88f8bf
-# NEXT_PUBLIC_DEPRECATED_VERIFIER_CONTRACT=0x019e5204152a72891bf8cd0bed8f03593fdb29ceacd14fca587be5d9fcf87c0e
-# NEXT_PUBLIC_OLD_VERIFIER_CONTRACT=0x4d546c8d60cfd591557ac0613be5ceeb0ea6f797e7d11c0b5160d145fa3089f
-# NEXT_PUBLIC_VERIFIER_POP_CONTRACT=0x0293eb2ba9862f762bd3036586d5755a782bd22e6f5028320f1d0405fd47bff4
-# NEXT_PUBLIC_ETHER_CONTRACT=0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
-# NEXT_PUBLIC_L1BUYING_CONTRACT=0x2a8f4E6A844A7cAa602E77B45651635e81EeF0ce
-# NEXT_PUBLIC_VERIFIER_LINK=https://verifier.starknet.id
-# # NEXT_PUBLIC_IS_TESTNET=false
-# NEXT_PUBLIC_TRIBE_CONTRACT=0x021b4b01282f11c7847007c7f064e20413c66f3e71f2c36b4cacaaf2a244dca6
-# NEXT_PUBLIC_NFT_PP_VERIFIER=0x070aaa20ec4a46da57c932d9fd89ca5e6bb9ca3188d3df361a32306aff7d59c7
-# # NEXT_PUBLIC_RPC_URL=https://rpc.starknet.id
-# NEXT_PUBLIC_MULTICALL_CONTRACT=0x034ffb8f4452df7a613a0210824d6414dbadcddce6c6e19bf4ddc9e22ce5f970
-# NEXT_PUBLIC_DOMAIN_GIFT_CONTRACT=0x040803720a1723355f652e1b3609275f561541e65ebffdf87e4075f9181df452
-# NEXT_PUBLIC_AVNU_API=https://starknet.impulse.avnu.fi/v1

Likely invalid or redundant comment.

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

93-97: Review min-height setting for potential overflow.

The min-height setting of 90vh might cause issues with the card shifting mentioned in PR objectives.

Please verify that this height setting doesn't cause:

  1. Content overflow on smaller screens
  2. Unwanted scrollbars
  3. Card shifting when "View More" is clicked

Consider using a smaller value or removing the min-height constraint if it's not necessary.


100-106: Verify breakpoint change impact.

The media query breakpoint change from 1124px to 1200px might affect tablet layouts.

Please test these layout changes on:

  1. Tablets in landscape mode (typically 1024px-1366px)
  2. Smaller desktop screens
  3. Ensure the identity card maintains proper alignment across all breakpoints
context/StarknetIdJsProvider.tsx (2)

47-53: LGTM! Context values are properly memoized.

The context values are correctly memoized with appropriate dependencies.


28-32: Add error handling for RPC URL initialization.

The provider initialization should handle cases where the RPC URL is invalid or unavailable.

   const provider = useMemo(() => {
+     if (!process.env.NEXT_PUBLIC_RPC_URL) {
+       console.error('RPC URL not configured');
+       return null;
+     }
      return new Provider({
         nodeUrl: process.env.NEXT_PUBLIC_RPC_URL,
      });
   }, []);

.env.example Outdated Show resolved Hide resolved
components/identities/skeletons/identitiesSkeleton.tsx Outdated Show resolved Hide resolved
styles/Home.module.css Outdated Show resolved Hide resolved
context/StarknetIdJsProvider.tsx Outdated Show resolved Hide resolved
components/identities/identityCard.tsx Outdated Show resolved Hide resolved
components/identities/identityCard.tsx Outdated Show resolved Hide resolved
components/identities/identityCard.tsx Outdated Show resolved Hide resolved
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.

I still see the back button.
image
Also, when I check on an identity that doesn't have a domain, the interface is broken
image

.env.example Outdated
@@ -17,4 +17,34 @@ NEXT_PUBLIC_NFT_PP_VERIFIER=0x070aaa20ec4a46da57c932d9fd89ca5e6bb9ca3188d3df361a
NEXT_PUBLIC_RPC_URL=https://rpc.starknet.id
NEXT_PUBLIC_MULTICALL_CONTRACT=0x034ffb8f4452df7a613a0210824d6414dbadcddce6c6e19bf4ddc9e22ce5f970
NEXT_PUBLIC_DOMAIN_GIFT_CONTRACT=0x040803720a1723355f652e1b3609275f561541e65ebffdf87e4075f9181df452
NEXT_PUBLIC_AVNU_API=https://starknet.impulse.avnu.fi/v1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cancel all these changes to the env example

@Marchand-Nicolas Marchand-Nicolas added the ❌ Change request Change requested from reviewer label Jan 29, 2025
@Prosper1218
Copy link
Author

But you see my screenshots right?? There's actually no back button there🤔.. I'll crosscheck tho.
Updating the PR in a jiffy.....

@Marchand-Nicolas
Copy link
Collaborator

But you see my screenshots right?? There's actually no back button there🤔.. I'll crosscheck tho. Updating the PR in a jiffy.....

Yes but as I said, you need to click at least one identity to show it. It's because it's in https://app-starknet-8zlx2y05r-lfglabs.vercel.app/identities/519367049996 but not in https://app-starknet-8zlx2y05r-lfglabs.vercel.app/identities/

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 (1)
components/identities/skeletons/identitiesSkeleton.tsx (1)

9-9: Remove empty className prop.

The empty className="" prop is unnecessary and can be removed.

-            <Skeleton variant="rounded" width={300} height={546} className=""/>
+            <Skeleton variant="rounded" width={300} height={546} />
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ade753f and e4d83e2.

📒 Files selected for processing (5)
  • .env.example (1 hunks)
  • components/identities/availableIdentities.tsx (1 hunks)
  • components/identities/skeletons/identitiesSkeleton.tsx (1 hunks)
  • pages/identities/[tokenId].tsx (1 hunks)
  • styles/components/identitiesV1.module.css (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .env.example
🚧 Files skipped from review as they are similar to previous changes (3)
  • pages/identities/[tokenId].tsx
  • styles/components/identitiesV1.module.css
  • components/identities/availableIdentities.tsx
🔇 Additional comments (2)
components/identities/skeletons/identitiesSkeleton.tsx (2)

1-5: LGTM! Clean and well-organized imports.

The import statements are properly organized, and the component is correctly typed.


7-12: ⚠️ Potential issue

Fix layout shifts and update skeleton dimensions.

The current implementation has several issues:

  1. Using mt-20 and mt-32 classes on individual skeletons can cause layout shifts during loading
  2. Based on the PR feedback, the skeleton dimensions may not accurately represent the loading content
  3. The skeleton layout needs to be centered

Consider this implementation:

-      <div className="pt-20">
+      <div className="pt-20 flex justify-center">
         <div className={styles.identitiesSkeleton}>
-            <Skeleton variant="rounded" width={300} height={546} className=""/>
-            <Skeleton variant="rounded" width={598} height={346} className="mt-20 hidden md:flex"/>
-            <Skeleton variant="rounded" width={398} height={246} className="mt-32 hidden lg:flex"/>
+            <Skeleton variant="rounded" width={300} height={546} />
+            <Skeleton variant="rounded" width={598} height={346} className="hidden md:flex" />
+            <Skeleton variant="rounded" width={398} height={246} className="hidden lg:flex" />
         </div>
      </div>

Please verify that:

  1. The skeleton dimensions match the actual content being loaded
  2. The layout is properly centered
  3. The spacing between skeletons is handled by the parent container's CSS to prevent layout shifts

Likely invalid or redundant comment.

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.

On mid-width screens it doesn't fit. Please display the mobile version sooner
image

The left bar is not high enough, it should fit the whole container (blue part in my screenshot) so that it looks vertically centered
Screenshot 2025-01-29 at 6 37 39 PM

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.

Also if I select an identity, and then select a domain, I don't have the buttons on the right, like if it was an identity, but it's a domain.
Screenshot 2025-01-29 at 6 40 06 PM

And the icon for the "renew your domain" button is not the same as on figma
image

…icked, fixed nav height, changed renew icon, and finally, the identityActions are only visible when the ID is attached to a domain.
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 (1)
.env.example (1)

21-23: Remove unnecessary blank lines at the end of the file.

Multiple blank lines at the end of the file are unnecessary and should be removed.

 # NEXT_PUBLIC_DOMAIN_GIFT_CONTRACT=0x040803720a1723355f652e1b3609275f561541e65ebffdf87e4075f9181df452
-

-

-
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e4d83e2 and a2c16c0.

📒 Files selected for processing (4)
  • .env.example (1 hunks)
  • components/UI/iconsComponents/icons/renewalIcon.tsx (1 hunks)
  • components/identities/availableIdentities.tsx (1 hunks)
  • styles/components/identitiesV1.module.css (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/identities/availableIdentities.tsx
  • styles/components/identitiesV1.module.css
🔇 Additional comments (1)
components/UI/iconsComponents/icons/renewalIcon.tsx (1)

Line range hint 1-1: Verify IconProps interface definition.

Let's check the IconProps interface to ensure our suggestions align with the project's type system.

✅ Verification successful

IconProps type definition found and verified

The IconProps type is defined in types/frontTypes.d.ts with the following structure:

  • Required props: color and width (both strings)
  • Optional props: secondColor and className (both strings)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for IconProps interface definition
rg -t typescript "interface IconProps" -A 5

Length of output: 80


Script:

#!/bin/bash
# Search for IconProps using correct file extensions with ripgrep
rg "interface IconProps|type IconProps" --type-add 'ts:*.{ts,tsx}' -t ts -A 5

# Also try with ast-grep for TypeScript-specific parsing
ast-grep --pattern 'interface IconProps {
  $$$
}'

ast-grep --pattern 'type IconProps = {
  $$$
}'

Length of output: 662

components/UI/iconsComponents/icons/renewalIcon.tsx Outdated Show resolved Hide resolved
@@ -2,19 +2,12 @@ import React, { FunctionComponent } from "react";

const RenewalIcon: FunctionComponent<IconProps> = ({ color, width }) => {
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

Remove unused props or implement their functionality.

The component accepts color and width props but doesn't utilize them. Either remove these unused props or implement their functionality to make the icon customizable.

-const RenewalIcon: FunctionComponent<IconProps> = ({ color, width }) => {
+const RenewalIcon: FunctionComponent = () => {

Or implement the props:

 const RenewalIcon: FunctionComponent<IconProps> = ({ color, width }) => {
   return (
-    <svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+    <svg width={width || "21"} height={width ? width * (20/21) : "20"} viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">

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

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 check read the comments made by the ai.
This one is accurate: #1007 (comment)

.env.example Outdated Show resolved Hide resolved
…e background to "add identity" button, fixed nav height issues.
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

♻️ Duplicate comments (1)
components/UI/iconsComponents/icons/renewalIcon.tsx (1)

5-23: 🛠️ Refactor suggestion

Enhance SVG accessibility and customization.

The SVG icon needs improvements in accessibility and color customization.

       <svg 
         width={width || "21"} 
         height={width ? width * (20/21) : "20"} 
         viewBox="0 0 21 20" 
         fill="none"
+        role="img"
+        aria-label="Renewal Icon"
         xmlns="http://www.w3.org/2000/svg"
       >
+        <title>Renewal Icon</title>
-        <ellipse cx="17.137" cy="15.0669" rx="2.57449" ry="2.33056" fill="#0C8654" />
+        <ellipse cx="17.137" cy="15.0669" rx="2.57449" ry="2.33056" fill={color || "#0C8654"} />
         <path
           d="M19.7089 6.00473V6.28565C19.7089 6.62899 19.3034 6.90991 18.8078 6.90991H2.58857C2.09298 6.90991 1.6875 6.62899 1.6875 6.28565V5.99849C1.6875 4.56894 3.35448 3.41406 5.41793 3.41406H15.9695C18.0329 3.41406 19.7089 4.57518 19.7089 6.00473Z"
-          fill="#0C8654"
+          fill={color || "#0C8654"}
         />
         <path
           d="M1.6875 8.88911V12.8909C1.6875 14.7386 3.35448 16.2312 5.41793 16.2312H11.0586C11.5812 16.2312 12.0318 15.8358 11.9867 15.3679C11.8606 14.1334 12.3021 12.7941 13.5276 11.7291C14.0322 11.2854 14.6539 10.9465 15.3297 10.7529C16.456 10.4301 17.5463 10.4705 18.5105 10.7609C19.0962 10.9384 19.7089 10.5592 19.7089 10.0025V8.88104C19.7089 8.43729 19.3034 8.07422 18.8078 8.07422H2.58857C2.09298 8.08229 1.6875 8.44536 1.6875 8.88911ZM7.09392 13.5283H5.29178C4.92234 13.5283 4.61598 13.254 4.61598 12.9232C4.61598 12.5924 4.92234 12.3181 5.29178 12.3181H7.09392C7.46336 12.3181 7.76972 12.5924 7.76972 12.9232C7.76972 13.254 7.46336 13.5283 7.09392 13.5283Z"
-          fill="#0C8654"
+          fill={color || "#0C8654"}
         />
         <path
           d="M16.71 11.5703C14.8135 11.5703 13.2773 12.9609 13.2773 14.6777C13.2773 15.2604 13.4576 15.8119 13.7751 16.278C14.3672 17.1792 15.4571 17.7851 16.71 17.7851C17.9629 17.7851 19.0528 17.1792 19.6449 16.278C19.9624 15.8119 20.1426 15.2604 20.1426 14.6777C20.1426 12.9609 18.6065 11.5703 16.71 11.5703ZM18.4864 14.3437L16.6585 15.8741C16.5384 15.9751 16.3753 16.0295 16.2208 16.0295C16.0578 16.0295 15.8947 15.9751 15.766 15.8585L14.9164 15.0895C14.6676 14.8642 14.6676 14.4913 14.9164 14.266C15.1653 14.0407 15.5772 14.0407 15.8261 14.266L16.238 14.6389L17.6111 13.4891C17.8685 13.2716 18.2804 13.2872 18.5207 13.5202C18.761 13.7533 18.7438 14.1184 18.4864 14.3437Z"
-          fill="#0C8654"
+          fill={color || "#0C8654"}
         />
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a2c16c0 and 771155b.

📒 Files selected for processing (4)
  • components/UI/iconsComponents/icons/renewalIcon.tsx (1 hunks)
  • components/identities/availableIdentities.tsx (1 hunks)
  • components/identities/skeletons/identitiesSkeleton.tsx (1 hunks)
  • styles/components/identitiesV1.module.css (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • components/identities/availableIdentities.tsx
  • components/identities/skeletons/identitiesSkeleton.tsx
  • styles/components/identitiesV1.module.css

/>
</svg>
);
const RenewalIcon: FunctionComponent<IconProps> = ({color, width}) => {
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

Fix incorrect width and height handling.

The width prop is incorrectly used as both width and height, which will distort the icon's aspect ratio.

-      <svg width={width || "20"} height={width} viewBox="0 0 21 20" fill={color} xmlns="http://www.w3.org/2000/svg">
+      <svg 
+        width={width || "21"} 
+        height={width ? width * (20/21) : "20"} 
+        viewBox="0 0 21 20" 
+        fill="none" 
+        xmlns="http://www.w3.org/2000/svg"
+      >

Also applies to: 5-5


⚠️ Potential issue

Add missing type import.

The IconProps type is used but not imported.

Add the import at the top of the file:

 import React, {FunctionComponent} from "react";
+import { IconProps } from "../types";

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

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.

On a normal desktop screens, it doesn't fit. The buttons should be to the right of the card on desktop.

image

When going in https://app-starknet-c64oj54l4-lfglabs.vercel.app/identities
I see a scollbar at the right. Once I select an identity it disappear. It should never appear because I have enough space.
Screenshot 2025-01-31 at 12 57 19 PM

On mobile it looks almost perfect.
Just the padding & margins of the domain nav are too big. There should be 0 padding (red) and almost no margin (blue)
Screenshot 2025-01-31 at 12 59 58 PM

…lso, identityAction buttons don't go under on large screens.
@Prosper1218
Copy link
Author

Screenshot 2025-01-31 145618

Screenshot 2025-01-31 150046

no scrollbars on both large screen and mobile. also aligned the IDs to de left on large screen as it is on figma.

…padding too, corrected seperator color and fixed overflow on identities page.
@Prosper1218
Copy link
Author

Screenshot 2025-01-31 165401
No overflow in identities page 🎉🎉🎉

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 (4)
styles/components/identitiesV1.module.css (4)

59-70: Consider using relative units for better responsiveness.

The fixed dimensions might cause layout issues on different screen sizes:

  • min-height: 629px could be too large for smaller screens
  • Fixed width of 650px might not scale well

Consider this more responsive approach:

.IDScreen {
-  min-height: 629px;
+  min-height: min(629px, 80vh);
}

.CardContainer {
-  width: 650px;
-  max-width: 650px;
+  width: min(650px, 100%);
+  margin: 0 auto;
}

74-85: Remove commented media query if no longer needed.

The commented media query for .identitiesSkeleton should be removed if it's no longer used. This aligns with the PR feedback about updating the loading skeleton.

.identitiesSkeleton {
  display: flex;
  flex-direction: row;
  justify-content: center;
  width: 100%;
  gap: 16px;
}
-/* @media (max-width: 1000px) {
-  .identitiesSkeleton {
-    flex-direction: row;
-    flex-wrap:nowrap;
-  }
-} */

113-119: Remove commented properties in media query.

Remove the commented CSS properties if they're no longer needed. This improves code maintainability.

@media (min-width: 1200px) {
  .identityBox {
    flex-direction: row;
-    /* justify-content: center; */
    gap: 2rem;
-    /* align-items: center; */
  }
}

183-192: Clean up SIDENAV styles and simplify calculations.

Remove the commented height property and consider simplifying the viewport height calculation.

.SIDENAV {
  background-color: white;
  text-align: center;
}

@media (min-width: 1290px) {
  .SIDENAV {
    height: calc(80vh - 6rem);
-    /* height: 397px; */
  }
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 385fddc and ca44f48.

📒 Files selected for processing (4)
  • components/identities/availableIdentities.tsx (1 hunks)
  • pages/identities.tsx (2 hunks)
  • styles/Home.module.css (2 hunks)
  • styles/components/identitiesV1.module.css (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • pages/identities.tsx
  • styles/Home.module.css
  • components/identities/availableIdentities.tsx
🔇 Additional comments (2)
styles/components/identitiesV1.module.css (2)

2-42: LGTM! Well-structured gallery layout with smooth interactions.

The gallery implementation follows CSS best practices with proper use of flexbox, CSS variables, and transitions.


1-192: Verify alignment with Figma design.

While the CSS changes improve the layout and responsiveness, please ensure that:

  1. The margins between identity card and buttons match the Figma design
  2. The card remains static when "View More" is clicked
  3. The loading skeleton is properly centered

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

♻️ Duplicate comments (2)
components/UI/iconsComponents/icons/renewalIcon.tsx (2)

6-10: ⚠️ Potential issue

Fix SVG attributes to maintain aspect ratio and proper color handling.

The current implementation has several issues:

  1. Using width for height will distort the aspect ratio
  2. The fill attribute shouldn't use color directly as it affects all paths

Apply this diff to fix the issues:

-      width={width || "21"}
-      height={width}
-      viewBox="0 0 21 20"
-      fill={color}
+      width={width || "21"}
+      height={width ? width * (20/21) : "20"}
+      viewBox="0 0 21 20"
+      fill="none"

12-33: 🛠️ Refactor suggestion

Improve SVG accessibility and color customization.

The SVG elements need improvements in:

  1. Color customization - currently using hardcoded colors
  2. Accessibility - missing semantic information

Apply this diff to improve the SVG:

       <ellipse
         cx="17.137"
         cy="15.0669"
         rx="2.57449"
         ry="2.33056"
-        fill="#0C8654"
+        fill={color || "#0C8654"}
       />
       <path
         d="M19.7089 6.00473V6.28565C19.7089 6.62899 19.3034 6.90991 18.8078 6.90991H2.58857C2.09298 6.90991 1.6875 6.62899 1.6875 6.28565V5.99849C1.6875 4.56894 3.35448 3.41406 5.41793 3.41406H15.9695C18.0329 3.41406 19.7089 4.57518 19.7089 6.00473Z"
-        fill="#0C8654"
+        fill={color || "#0C8654"}
       />
       <path
         d="M1.6875 8.88911V12.8909C1.6875 14.7386 3.35448 16.2312 5.41793 16.2312H11.0586C11.5812 16.2312 12.0318 15.8358 11.9867 15.3679C11.8606 14.1334 12.3021 12.7941 13.5276 11.7291C14.0322 11.2854 14.6539 10.9465 15.3297 10.7529C16.456 10.4301 17.5463 10.4705 18.5105 10.7609C19.0962 10.9384 19.7089 10.5592 19.7089 10.0025V8.88104C19.7089 8.43729 19.3034 8.07422 18.8078 8.07422H2.58857C2.09298 8.08229 1.6875 8.44536 1.6875 8.88911ZM7.09392 13.5283H5.29178C4.92234 13.5283 4.61598 13.254 4.61598 12.9232C4.61598 12.5924 4.92234 12.3181 5.29178 12.3181H7.09392C7.46336 12.3181 7.76972 12.5924 7.76972 12.9232C7.76972 13.254 7.46336 13.5283 7.09392 13.5283Z"
-        fill="#0C8654"
+        fill={color || "#0C8654"}
       />
       <path
         d="M16.71 11.5703C14.8135 11.5703 13.2773 12.9609 13.2773 14.6777C13.2773 15.2604 13.4576 15.8119 13.7751 16.278C14.3672 17.1792 15.4571 17.7851 16.71 17.7851C17.9629 17.7851 19.0528 17.1792 19.6449 16.278C19.9624 15.8119 20.1426 15.2604 20.1426 14.6777C20.1426 12.9609 18.6065 11.5703 16.71 11.5703ZM18.4864 14.3437L16.6585 15.8741C16.5384 15.9751 16.3753 16.0295 16.2208 16.0295C16.0578 16.0295 15.8947 15.9751 15.766 15.8585L14.9164 15.0895C14.6676 14.8642 14.6676 14.4913 14.9164 14.266C15.1653 14.0407 15.5772 14.0407 15.8261 14.266L16.238 14.6389L17.6111 13.4891C17.8685 13.2716 18.2804 13.2872 18.5207 13.5202C18.761 13.7533 18.7438 14.1184 18.4864 14.3437Z"
-        fill="#0C8654"
+        fill={color || "#0C8654"}
       />

Also add role and title for accessibility:

     <svg
       width={width || "21"}
       height={width ? width * (20/21) : "20"}
       viewBox="0 0 21 20"
       fill="none"
       xmlns="http://www.w3.org/2000/svg"
+      role="img"
+      aria-label="Renewal Icon"
     >
+      <title>Renewal Icon</title>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2270ab8 and 861d621.

📒 Files selected for processing (3)
  • components/UI/iconsComponents/icons/renewalIcon.tsx (1 hunks)
  • components/identities/availableIdentities.tsx (4 hunks)
  • components/identities/skeletons/identitiesSkeleton.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/identities/availableIdentities.tsx
🔇 Additional comments (1)
components/identities/skeletons/identitiesSkeleton.tsx (1)

9-21: Prevent layout shifts and improve responsive behavior.

The current implementation uses margin-top classes that can cause layout shifts when content loads. Consider using consistent spacing through container classes instead.

Additionally, verify that the skeleton dimensions match the actual content dimensions to provide a more accurate loading representation:

  • 300x546 for mobile
  • 598x346 for tablet (md)
  • 398x246 for desktop (lg)
#!/bin/bash
# Description: Find the actual dimensions used in the identity card components
# to verify if skeleton dimensions match.

# Search for width/height values in identity card components
rg -A 5 'width|height' components/identities/

Comment on lines +7 to 8
<div className="">
<div className={styles.identitiesSkeleton}>
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

Add proper container styling for better layout control.

The empty className removes important layout controls. Consider adding appropriate flex and spacing utilities to maintain consistent layout:

-    <div className="">
+    <div className="flex flex-col space-y-6">
📝 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
<div className="">
<div className={styles.identitiesSkeleton}>
<div className="flex flex-col space-y-6">
<div className={styles.identitiesSkeleton}>

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: 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 861d621 and 20edc3e.

📒 Files selected for processing (2)
  • components/identities/actions/identityActions.tsx (1 hunks)
  • components/identities/availableIdentities.tsx (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/identities/actions/identityActions.tsx
🔇 Additional comments (4)
components/identities/availableIdentities.tsx (4)

22-22: LGTM! Import changes align with the new skeleton loader design.

The switch to IdentitiesSkeleton aligns with the PR objectives to improve the loading state representation.


111-117: LGTM! Effect properly manages action visibility.

The effect correctly manages the visibility of actions based on whether the identity is a domain.


189-194: LGTM! Improved layout structure with proper loading state.

The new layout with min-h-[80vh] and centered loading skeleton aligns with the PR objectives and addresses the loading state concerns mentioned in the PR comments.


195-235: Verify margins between identity card and buttons.

Per PR comments from Marchand-Nicolas, please verify that the margins between the identity card and buttons match the Figma design.

Also ensure that the card remains static when the "View More" button is clicked, similar to app.starknet.id.

Comment on lines +100 to +110
// this function does not work
const hideActionsHandler = (state: boolean) => {
// if (state === true) {
// // setHideActions(true);
// console.log("hello, it's true")
// } else {
// // setHideActions(false);
// console.log("hello, it's faalse")
// }
// console.log(state)
};
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

Remove or implement the non-functional handler.

The hideActionsHandler contains only commented code and appears to be non-functional. This should either be implemented or removed to maintain clean code.

If this handler is no longer needed, apply this diff:

-   // this function does not work
-   const hideActionsHandler = (state: boolean) => {
-      // if (state === true) {
-      //    // setHideActions(true);
-      //    console.log("hello, it's true")
-      // } else {
-      //    // setHideActions(false);
-      //    console.log("hello, it's faalse")
-      // }
-      // console.log(state)
-   };

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 of idendity card on my identities page
3 participants