Skip to content

Commit 93c261f

Browse files
fix: polygon UI issues (#1039)
* fix: polygon UI issues Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com> * remove: uneccessary code Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com> * fix: display user profile organization issue Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com> --------- Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>
1 parent 15a221e commit 93c261f

File tree

8 files changed

+30
-16
lines changed

8 files changed

+30
-16
lines changed

nextjs/src/app/globals.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ a[href] {
181181
color: white;
182182
}
183183

184+
.bg-warning {
185+
background-color: #facc15;
186+
}
187+
184188
.bg-error {
185189
background-color: var(--error);
186190
color: white;

nextjs/src/features/profile/components/DisplayUserProfile.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,18 @@ const DisplayUserProfile = ({
4242
toggleEditProfile,
4343
userProfileInfo,
4444
}: IDisplayUserProfileProps): React.JSX.Element => {
45-
const orgPresent = useMemo(
46-
() =>
47-
userProfileInfo?.userOrgRoles?.filter((role) => role.organisation) || [],
48-
[userProfileInfo],
49-
)
45+
const orgPresent = useMemo(() => {
46+
const roles = userProfileInfo?.userOrgRoles || []
47+
const uniqueOrgsMap = new Map<string, UserOrgRole>()
48+
49+
roles.forEach((role) => {
50+
if (role.organisation && !uniqueOrgsMap.has(role.organisation.id)) {
51+
uniqueOrgsMap.set(role.organisation.id, role)
52+
}
53+
})
54+
55+
return Array.from(uniqueOrgsMap.values())
56+
}, [userProfileInfo])
5057

5158
return (
5259
<Card className="flex h-full flex-col p-8 sm:py-6">

nextjs/src/features/wallet/DedicatedAgentLedgerConfig.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ const DedicatedLedgerConfig = ({
555555
For eg. use{' '}
556556
<a
557557
href="https://faucet.polygon.technology/"
558-
className="text-primary underline"
558+
className="font-semibold underline"
559559
>
560560
https://faucet.polygon.technology/
561561
</a>{' '}
@@ -574,7 +574,7 @@ const DedicatedLedgerConfig = ({
574574
balance on{' '}
575575
<a
576576
href={polygonScan}
577-
className="text-primary underline"
577+
className="font-semibold underline"
578578
>
579579
{polygonScan}
580580
</a>

nextjs/src/features/wallet/DidListComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ const DIDListComponent = ({ orgId }: { orgId: string }): React.JSX.Element => {
821821
For eg. use{' '}
822822
<a
823823
href="https://faucet.polygon.technology/"
824-
className="underline"
824+
className="font-semibold underline"
825825
target="_blank"
826826
rel="noopener noreferrer"
827827
>

nextjs/src/features/wallet/GenerateBtnPolygon.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ const GenerateButtonPolygon = ({
1212
}: IProps): React.JSX.Element => (
1313
<div className="relative my-3 grid w-fit grid-cols-2 gap-x-9 md:gap-56">
1414
<div className="mt-4">
15-
<Label htmlFor="generateKey">Generate private key</Label>
16-
<span className="text-destructive text-xs">*</span>
15+
<Label htmlFor="generateKey">
16+
Generate private key <span className="text-destructive text-xs">*</span>
17+
</Label>
1718
</div>
1819

1920
<Button

nextjs/src/features/wallet/LedgerConfig.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ const LedgerConfig = ({
611611
For example, use{' '}
612612
<a
613613
href="https://faucet.polygon.technology/"
614-
className="underline"
614+
className="font-semibold underline"
615615
>
616616
https://faucet.polygon.technology/
617617
</a>{' '}
@@ -626,7 +626,10 @@ const LedgerConfig = ({
626626
<div className="mt-1">
627627
For example, copy the address and check the
628628
balance on{' '}
629-
<a href={polygonScan} className="underline">
629+
<a
630+
href={polygonScan}
631+
className="font-semibold underline"
632+
>
630633
{polygonScan}
631634
</a>
632635
.

nextjs/src/features/wallet/SetPrivateKeyValue.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const SetPrivateKeyValueInput = ({
132132

133133
{generatedKeys && (
134134
<>
135-
<div className="mt-3 relative flex items-center">
135+
<div className="relative mt-3 flex items-center">
136136
<CopyDid value={generatedKeys.privateKey.slice(2)} />
137137
</div>
138138

@@ -162,7 +162,7 @@ const SetPrivateKeyValueInput = ({
162162
as={Input}
163163
id="privatekey"
164164
name="privatekey"
165-
className="w-[480px]"
165+
className=""
166166
value={privateKeyValue}
167167
onChange={(e: ChangeEvent<HTMLInputElement>) => {
168168
setPrivateKeyValue(e.target.value)
@@ -171,7 +171,6 @@ const SetPrivateKeyValueInput = ({
171171
onBlur={formikHandlers.handleBlur}
172172
placeholder="Enter private key"
173173
/>
174-
<CopyDid value={privateKeyValue || ''} />
175174
</div>
176175

177176
<span className="text-destructive static bottom-0 text-xs">

nextjs/src/features/wallet/TokenWarningMessage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { cn } from '@/lib/utils'
55
const TokenWarningMessage = (): React.JSX.Element => (
66
<span
77
className={cn(
8-
'mt-2 mr-2 inline-flex items-center rounded-sm px-2 py-2 text-xs font-medium',
8+
'bg-warning mt-2 mr-2 inline-flex items-center rounded-sm px-2 py-2 text-xs font-medium',
99
'',
1010
)}
1111
>

0 commit comments

Comments
 (0)