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: proof request label #1325

Merged
merged 4 commits into from
Nov 26, 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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
CredoError,
ProofExchangeRecord,
ProofState,
V2RequestPresentationMessage,
} from '@credo-ts/core'
import { useAgent, useConnectionById } from '@credo-ts/react-hooks'
import { markProofAsViewed } from '@hyperledger/aries-bifold-verifier'
Expand Down Expand Up @@ -258,13 +259,12 @@ const NotificationListItem: React.FC<NotificationListItemProps> = ({
break
case NotificationType.ProofRequest: {
const proofId = (notification as ProofExchangeRecord).id
let message
let message: V2RequestPresentationMessage | V1RequestPresentationMessage | null | undefined
try {
message = await agent?.proofs.findRequestMessage(proofId)
} catch (error) {
logger.error('Error finding request message:', error as CredoError)
}

if (message instanceof V1RequestPresentationMessage && message.indyProofRequest) {
details = {
type: InfoBoxType.Info,
Expand All @@ -276,7 +276,7 @@ const NotificationListItem: React.FC<NotificationListItemProps> = ({
details = {
type: InfoBoxType.Info,
title: t('ProofRequest.NewProofRequest'),
body: '',
body: message?.comment ?? '',
buttonTitle: undefined,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ const CredentialCard11: React.FC<CredentialCard11Props> = ({
},
})

const backgroundColorIfErrorState = (backgroundColor?: string) =>
error || predicateError || isProofRevoked ? ColorPallet.notification.errorBorder : backgroundColor

const backgroundColorIfRevoked = (backgroundColor?: string) =>
isProofRevoked ? ColorPallet.notification.errorBorder : backgroundColor

Expand All @@ -242,7 +239,7 @@ const CredentialCard11: React.FC<CredentialCard11Props> = ({
}

const c =
backgroundColorIfErrorState(overlay.brandingOverlay?.primaryBackgroundColor) ?? ColorPallet.grayscale.lightGrey
backgroundColorIfRevoked(overlay.brandingOverlay?.primaryBackgroundColor) ?? ColorPallet.grayscale.lightGrey
const shade = shadeIsLightOrDark(c)

return shade == Shade.Light ? ColorPallet.grayscale.darkGrey : ColorPallet.grayscale.lightGrey
Expand Down