Skip to content

Commit ff27a79

Browse files
committed
Update style of MessagePopup.js and message text
1 parent 0791e8b commit ff27a79

File tree

2 files changed

+37
-36
lines changed

2 files changed

+37
-36
lines changed

src/components/Popups/MessagePopup.js

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,47 @@
11
// MessagePopup.js
22
import React from 'react';
3-
import { FaShare } from 'react-icons/fa';
3+
import { FaCheckCircle, FaExclamationCircle } from 'react-icons/fa';
44

55
const MessagePopup = ({ type, message, onClose }) => {
6-
const { title, description } = message || {};
6+
const { title, description } = message || {};
77

8-
const titleColor = type === 'error' ? 'text-red-500' : 'text-custom-blue';
9-
const descriptionColor = type === 'error' ? 'text-red-500' : '';
8+
const IconComponent = type === 'error' ? FaExclamationCircle : FaCheckCircle;
109

11-
return (
12-
<div className="fixed inset-0 flex items-center justify-center z-50">
13-
<div className="absolute inset-0 bg-black opacity-50" onClick={() => onClose()}></div>
10+
const titleColor = type === 'error' ? 'text-red-500' : 'text-green-600';
1411

15-
<div className="bg-white p-4 rounded-lg shadow-lg w-full lg:w-[33.33%] sm:w-[66.67%] z-10 relative m-4">
16-
<div class="flex items-start justify-between border-b rounded-t dark:border-gray-600">
12+
return (
13+
<div className="fixed inset-0 flex items-center justify-center z-50">
14+
<div className="absolute inset-0 bg-black opacity-50" onClick={() => onClose()}></div>
1715

18-
<h2 className={`text-lg font-bold mb-2 flex items-center ${titleColor}`}>
19-
<FaShare size={20} className="inline mr-1 mb-1" />
20-
{title}
21-
</h2>
22-
<button type="button" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ml-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white" onClick={() => onClose()}>
23-
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
24-
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" />
25-
</svg>
26-
</button>
27-
</div>
28-
<hr className="mb-2 border-t border-custom-blue/80" />
29-
<p className={`mb-2 mt-4 ${descriptionColor}`}>
30-
{description}
31-
</p>
32-
<div className="flex justify-end space-x-2 pt-4">
33-
<button
34-
type="button"
35-
className="rounded-md text-sm border border-transparent shadow-sm px-4 py-2 bg-gray-500 text-white hover:bg-gray-600"
36-
onClick={onClose}
37-
>
38-
Close
39-
</button>
40-
</div>
41-
</div>
42-
</div>
43-
);
16+
<div className="bg-white p-4 rounded-lg shadow-lg w-full lg:w-[33.33%] sm:w-[66.67%] z-10 relative m-4">
17+
<div className="flex items-start justify-between border-b rounded-t dark:border-gray-600">
18+
19+
<h2 className={`text-lg font-bold mb-2 flex items-center ${titleColor}`}>
20+
<IconComponent size={20} className="inline mr-1" />
21+
{title}
22+
</h2>
23+
<button type="button" className="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ml-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white" onClick={() => onClose()}>
24+
<svg className="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
25+
<path stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" />
26+
</svg>
27+
</button>
28+
</div>
29+
<hr className="mb-2 border-t border-custom-blue/80" />
30+
<p className="mb-2 mt-4">
31+
{description}
32+
</p>
33+
<div className="flex justify-end space-x-2 pt-4">
34+
<button
35+
type="button"
36+
className="px-4 py-2 text-white bg-gray-500 hover:bg-gray-600 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-gray-300 dark:hover:bg-gray-400"
37+
onClick={onClose}
38+
>
39+
Close
40+
</button>
41+
</div>
42+
</div>
43+
</div>
44+
);
4445
};
4546

4647
export default MessagePopup;

src/components/useCheckURL.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function useCheckURL(urlToCheck: string): {
4141
const { redirect_to, conformantCredentialsMap, verifierDomainName, preauth, ask_for_pin, error } = res.data;
4242
if (error && error == HandleOutboundRequestError.INSUFFICIENT_CREDENTIALS) {
4343
console.error(`${HandleOutboundRequestError.INSUFFICIENT_CREDENTIALS}`);
44-
setTextMessagePopup({ title: "Insufficient Credentials", description: "One more credentials you want present not have them!" });
44+
setTextMessagePopup({ title: "Insufficient Credentials", description: "One or more of the credentials you want to present do not exist for selection." });
4545
setTypeMessagePopup('error');
4646
setMessagePopup(true);
4747
return false;

0 commit comments

Comments
 (0)