-
Notifications
You must be signed in to change notification settings - Fork 73
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
base: testnet
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@Prosper1218 is attempting to deploy a commit to the LFG Labs Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe pull request makes updates across environment variables, React components, and CSS files. It re-includes the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
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? 🪧 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 (
|
Hello @Prosper1218 just merged the buttons: #1006 |
alright. i'll work on that right away. |
Hey @Prosper1218 the nav has been added here #1001 In addition, fix the skeleton, which is not representative anymore of what is loading (+ it's not centered anymore) |
Hey, just merged the last PR (for the card) #1004 now you have everything! |
…ew more button is clicked
…tton is clicked, removed the back button and edited the loading skeleton
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 (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
⛔ 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 suggestionRemove 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/v1Likely 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:
- Content overflow on smaller screens
- Unwanted scrollbars
- 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:
- Tablets in landscape mode (typically 1024px-1366px)
- Smaller desktop screens
- 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, }); }, []);
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.
.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 |
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.
Cancel all these changes to the env example
But you see my screenshots right?? There's actually no back button there🤔.. I'll crosscheck tho. |
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/ |
…ayout shift when a domain isn't connected.
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 (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
📒 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 issueFix layout shifts and update skeleton dimensions.
The current implementation has several issues:
- Using
mt-20
andmt-32
classes on individual skeletons can cause layout shifts during loading- Based on the PR feedback, the skeleton dimensions may not accurately represent the loading content
- 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:
- The skeleton dimensions match the actual content being loaded
- The layout is properly centered
- The spacing between skeletons is handled by the parent container's CSS to prevent layout shifts
Likely invalid or redundant comment.
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.
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.
…icked, fixed nav height, changed renew icon, and finally, the identityActions are only visible when the ID is attached to a domain.
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 (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
📒 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 intypes/frontTypes.d.ts
with the following structure:
- Required props:
color
andwidth
(both strings)- Optional props:
secondColor
andclassName
(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 5Length 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
@@ -2,19 +2,12 @@ import React, { FunctionComponent } from "react"; | |||
|
|||
const RenewalIcon: FunctionComponent<IconProps> = ({ color, width }) => { |
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.
🛠️ 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.
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.
Please check read the comments made by the ai.
This one is accurate: #1007 (comment)
…e background to "add identity" button, fixed nav height issues.
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
♻️ Duplicate comments (1)
components/UI/iconsComponents/icons/renewalIcon.tsx (1)
5-23
: 🛠️ Refactor suggestionEnhance 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
📒 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}) => { |
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.
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
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.
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.
On a normal desktop screens, it doesn't fit. The buttons should be to the right of the card on desktop.
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.
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)
…lso, identityAction buttons don't go under on large screens.
…padding too, corrected seperator color and fixed overflow on identities page.
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 (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 wellConsider 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
📒 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:
- The margins between identity card and buttons match the Figma design
- The card remains static when "View More" is clicked
- The loading skeleton is properly centered
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: 1
♻️ Duplicate comments (2)
components/UI/iconsComponents/icons/renewalIcon.tsx (2)
6-10
:⚠️ Potential issueFix SVG attributes to maintain aspect ratio and proper color handling.
The current implementation has several issues:
- Using
width
for height will distort the aspect ratio- The
fill
attribute shouldn't usecolor
directly as it affects all pathsApply 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 suggestionImprove SVG accessibility and color customization.
The SVG elements need improvements in:
- Color customization - currently using hardcoded colors
- 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
📒 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/
<div className=""> | ||
<div className={styles.identitiesSkeleton}> |
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.
🛠️ 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.
<div className=""> | |
<div className={styles.identitiesSkeleton}> | |
<div className="flex flex-col space-y-6"> | |
<div className={styles.identitiesSkeleton}> |
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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.
// 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) | ||
}; |
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.
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)
- };
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
Bug Fixes
Style