Skip to content

Commit 9d4ac6e

Browse files
feat: Update grant consent message to clarify access vs payment (#2158)
* Update grant consent message to clarify access vs payment Signed-off-by: Arya Pratap Singh <notaryasingh@gmail.com> * lint fixed Signed-off-by: Arya Pratap Singh <notaryasingh@gmail.com> * remove duplication Signed-off-by: Arya Pratap Singh <notaryasingh@gmail.com> --------- Signed-off-by: Arya Pratap Singh <notaryasingh@gmail.com>
1 parent e7074e8 commit 9d4ac6e

1 file changed

Lines changed: 30 additions & 41 deletions

File tree

  • packages/wallet/frontend/src/pages/grant-interactions

packages/wallet/frontend/src/pages/grant-interactions/index.tsx

Lines changed: 30 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ const GrantInteractionPage = ({
2222
grant,
2323
interactionId,
2424
nonce,
25-
clientName
25+
clientName: _clientName
2626
}: GrantInteractionPageProps) => {
2727
const [openDialog, closeDialog] = useDialog()
28-
const client = clientName ? clientName : grant.client
2928
const router = useRouter()
3029
const isPendingGrant = grant.state === 'PENDING'
3130
const imageName =
@@ -67,33 +66,27 @@ const GrantInteractionPage = ({
6766
height={150}
6867
/>
6968
<div className="mt-20 text-base">
70-
<div>
71-
<span className="font-semibold">{client}</span> is requesting access
72-
to make{' '}
73-
{grant.access.length > 1 ? 'a list of payments' : 'a payment'} on
74-
your behalf.
75-
</div>
76-
<div>
77-
Wallet Address client:{' '}
78-
<span className="font-semibold">{grant.client}</span>
79-
</div>
8069
{grant.access.length === 1 ? (
8170
<div>
82-
Total amount to debit:{' '}
83-
<span className="font-semibold">
84-
{grant.access[0]?.limits?.debitAmount?.formattedAmount}
85-
</span>
71+
Your wallet is requesting access to an amount of{' '}
72+
{grant.access[0]?.limits?.debitAmount?.formattedAmount}.
8673
</div>
8774
) : (
88-
<div className="mt-4">
89-
<div className="font-semibold mb-2">Payment Amounts:</div>
90-
{grant.access.map((accessItem, index) => (
91-
<div key={index} className="mb-1">
92-
{accessItem.limits?.debitAmount?.formattedAmount}
93-
</div>
94-
))}
75+
<div>
76+
Your wallet is requesting access to the following amounts:{' '}
77+
{grant.access
78+
.map(
79+
(accessItem) =>
80+
accessItem.limits?.debitAmount?.formattedAmount
81+
)
82+
.join(', ')}
83+
.
9584
</div>
9685
)}
86+
<div>
87+
Wallet Address client:{' '}
88+
<span className="font-semibold">{grant.client}</span>
89+
</div>
9790
</div>
9891
<div className="mx-auto mt-10 flex w-full max-w-xl justify-evenly">
9992
<Button
@@ -128,26 +121,22 @@ const GrantInteractionPage = ({
128121
height={150}
129122
/>
130123
<div className="mt-20 text-xl">
131-
The request from <span className="font-semibold">{client}</span> was
132-
previously processed
133-
{grant.access.length > 1 ? ' with a list of payments' : ''}.
134124
{grant.access.length === 1 ? (
135-
<>
136-
{' '}
137-
for the amount of{' '}
138-
{grant.access[0]?.limits?.debitAmount?.formattedAmount}
139-
</>
125+
<div>
126+
Your wallet previously granted access to an amount of{' '}
127+
{grant.access[0]?.limits?.debitAmount?.formattedAmount}.
128+
</div>
140129
) : (
141-
<>
142-
<div className="mt-4">
143-
<div className="font-semibold mb-2">Payment Amounts:</div>
144-
{grant.access.map((accessItem, index) => (
145-
<div key={index} className="mb-1">
146-
{accessItem.limits?.debitAmount?.formattedAmount}
147-
</div>
148-
))}
149-
</div>
150-
</>
130+
<div>
131+
Your wallet previously granted access to the following amounts:{' '}
132+
{grant.access
133+
.map(
134+
(accessItem) =>
135+
accessItem.limits?.debitAmount?.formattedAmount
136+
)
137+
.join(', ')}
138+
.
139+
</div>
151140
)}
152141
</div>
153142
<div className="mx-auto mt-10 flex w-full max-w-xl justify-evenly">

0 commit comments

Comments
 (0)