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

fix: verified details popup data display #540

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/Verification/ProofRequestPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const ProofRequest = (props: IProofRrquestDetails) => {
<p className="text-xl font-semibold text-gray-700 dark:bg-gray-800 dark:text-white flex flex-start pb-2">
Verified Details
</p>
{!props.userData ? (
{props.verifyLoading ? (
<div className="flex items-center justify-center m-4">
<CustomSpinner />
</div>
Expand All @@ -206,16 +206,17 @@ const ProofRequest = (props: IProofRrquestDetails) => {
)}
</div>
<div className="flex justify-center items-center space-x-4">
<button
<Button
onClick={() => {
setButtonLoader(false);
props.closeModal(false, '', false);
}}
disabled={props.verifyLoading}
className="py-1 px-2 medium text-center text-white bg-primary-700 hover:!bg-primary-800 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800"
style={{ height: '2.5rem', minWidth: '100px' }}
>
Close
</button>
</Button>
</div>
</div>
</Modal>
Expand Down
9 changes: 6 additions & 3 deletions src/components/Verification/VerificationCredentialList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const VerificationCredentialList = () => {
const [listAPIParameter, setListAPIParameter] =
useState<IConnectionListAPIParameter>(initialPageState);
const [totalItem, setTotalItem] = useState(0);
const [verifyLoading, setVerifyLoading]= useState(true)
const [pageInfo, setPageInfo] = useState({
totalItem: '',
nextPage: '',
Expand All @@ -60,14 +61,17 @@ const VerificationCredentialList = () => {

const getProofPresentationData = async (proofId: string) => {
try {
setVerifyLoading(true)
const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const response = await getVerifiedProofDetails(proofId, orgId);

const { data } = response as AxiosResponse;
if (data?.statusCode === apiStatusCodes?.API_STATUS_SUCCESS) {
setUserData(data?.data);
setVerifyLoading(false)
} else {
setErrMsg(response as string);
setVerifyLoading(false)
}
} catch (error) {
throw error;
Expand Down Expand Up @@ -102,8 +106,6 @@ const VerificationCredentialList = () => {
const { data } = response as AxiosResponse;
if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
const { totalItems, nextPage, lastPage } = data.data;
console.log('data.data', data.data);

setPageInfo({
totalItem: totalItems,
nextPage: nextPage,
Expand Down Expand Up @@ -435,11 +437,12 @@ const VerificationCredentialList = () => {
{userData && (
<ProofRequest
openModal={openModal}
closeModal={() => openProofRequestModel(false, '', '')}
closeModal={() => {openProofRequestModel(false, '', '')}}
onSucess={requestProof}
requestId={requestId}
userData={userData}
view={view}
verifyLoading={verifyLoading}
/>
)}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/Verification/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface SchemaDetails {
}

export interface IProofRrquestDetails {
verifyLoading: boolean;
openModal: boolean;
closeModal: (flag: boolean, id: string, state: boolean) => void;
onSucess: (verifyPresentationId: string) => void;
Expand Down