Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AfraHussaindeen committed Sep 22, 2024
1 parent d3fe27b commit 89b57ac
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ export const isClaimVerified = async (claimToVerify: string, config: ConfigInter
.then((response: HttpResponse<IdVClaim[]>) => {
const claims = response.data as IdVClaim[];
const claim = claims.find((claim) => claim.uri === claimToVerify);
console.log("Found claim : ", claim );
return getClaimVerificationStatus(claim);
})
.catch((error) => {
throw error;
});
}

function getClaimVerificationStatus(claim: IdVClaim | undefined): ClaimVerificationStatus {
export const getClaimVerificationStatus = (claim: IdVClaim): ClaimVerificationStatus => {
// If the claim is undefined, it means no verification has been initiated for this claim with Onfido
if (!claim) {
return { isVerified: undefined, workflowStatus: undefined };
}
Expand Down
18 changes: 10 additions & 8 deletions samples/react-sample-app/src/components/AgeVerificationDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ interface AgeVerificationDrawerProps {
showButton: boolean;
}

export const AgeVerificationDrawer: React.FC<AgeVerificationDrawerProps> = ({
isOpen,
setIsOpen,
verifyAge,
message,
type,
showButton
}) => {
export const AgeVerificationDrawer: React.FC<AgeVerificationDrawerProps> = (props) => {
const {
isOpen,
setIsOpen,
verifyAge,
message,
type,
showButton
} = props;

const getBannerBackgroundColorByMessageType = (messageType: string) => {
switch(messageType){
case "info":
Expand Down
2 changes: 1 addition & 1 deletion samples/react-sample-app/src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const NavBar = () => {
};

const handleLogout = () => {
signOut().catch((e) => console.log("Something went wrong while signing out. ", e));
signOut().catch((e) => console.error("Error while signing out. ", e));
handleClose();
};

Expand Down
1 change: 0 additions & 1 deletion samples/react-sample-app/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const HomePage: FunctionComponent = (): ReactElement => {
}
isClaimVerified("http://wso2.org/claims/dob", config)
.then((status: ClaimVerificationStatus) => {
console.log("Verification status:", status);
setVerificationStatus(status);

if (status.isVerified === true) {
Expand Down
2 changes: 0 additions & 2 deletions samples/react-sample-app/src/pages/VerifyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ export const VerifyPage: FunctionComponent<VerifyPageProps> = () => {
response = await initiateVerification(config);
}

console.log("Verification response:", response);

const token = response?.claims?.[0]?.claimMetadata?.sdk_token;
const workflowRunId = response?.claims?.[0]?.claimMetadata?.onfido_workflow_run_id;

Expand Down

0 comments on commit 89b57ac

Please sign in to comment.