Skip to content

Commit

Permalink
fix: w3c credential detail navigation
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Ranjit Tummalapalli <[email protected]>
  • Loading branch information
sairanjit committed Aug 28, 2024
1 parent 9c00999 commit 59b1cc1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions app/components/record/W3CCredentialRecord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ const W3CCredentialRecord: React.FC<RecordProps> = ({
const [showAll, setShowAll] = useState<boolean>(true)
const { ListItems, TextTheme, ColorPallet } = useTheme()

const isPrettyVcAvailable =
w3cCredential?.credential?.prettyVc && Object.keys(w3cCredential?.credential?.prettyVc).length > 0

const styles = StyleSheet.create({
linkContainer: {
...ListItems.recordContainer,
Expand All @@ -58,7 +61,7 @@ const W3CCredentialRecord: React.FC<RecordProps> = ({
},
rowContainer: {
flexDirection: 'row',
justifyContent: w3cCredential?.credential?.prettyVc ? 'space-between' : 'flex-end',
justifyContent: isPrettyVcAvailable ? 'space-between' : 'flex-end',
backgroundColor: ColorPallet.grayscale.white,
},
linkText: {
Expand Down Expand Up @@ -120,7 +123,7 @@ const W3CCredentialRecord: React.FC<RecordProps> = ({
<RecordHeader>
{header()}
<View style={styles.rowContainer}>
{w3cCredential?.credential?.prettyVc && (
{isPrettyVcAvailable && (
<View style={styles.linkContainer}>
{isCertificateLoading ? (
<ActivityIndicator size={'small'} />
Expand Down
4 changes: 4 additions & 0 deletions app/screens/CredentialDetailsW3C.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
deleteCredentialExchangeRecordById,
useCredentialByState,
CredentialState,
useConnections,
} from '@adeya/ssi'
import { BrandingOverlay } from '@hyperledger/aries-oca'
import { CredentialOverlay } from '@hyperledger/aries-oca/build/legacy'
Expand Down Expand Up @@ -61,6 +62,7 @@ const CredentialDetailsW3C: React.FC<CredentialDetailsProps> = ({ navigation, ro
const credentialsList = useCredentialByState(CredentialState.Done)
const [isDeletingCredential, setIsDeletingCredential] = useState<boolean>(false)
const [isGeneratingPdf, setIsGeneratingPdf] = useState<boolean>(false)
const { records: connectionRecords } = useConnections()

const [overlay, setOverlay] = useState<CredentialOverlay<BrandingOverlay>>({
bundle: undefined,
Expand Down Expand Up @@ -129,6 +131,8 @@ const CredentialDetailsW3C: React.FC<CredentialDetailsProps> = ({ navigation, ro
} else if (credential instanceof CredentialExchangeRecord) {
const credentialRecordId = credential.credentials[0].credentialRecordId
const record = await getW3cCredentialRecordById(agent, credentialRecordId)
const connection = connectionRecords.find(connection => connection.id === credential?.connectionId)
record.connectionLabel = connection?.theirLabel
return record
}
}
Expand Down
4 changes: 2 additions & 2 deletions ios/AdeyaWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = AdeyaWallet/AdeyaWallet.entitlements;
CURRENT_PROJECT_VERSION = 42;
CURRENT_PROJECT_VERSION = 43;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = Z5W7KRPGHZ;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -545,7 +545,7 @@
CODE_SIGN_ENTITLEMENTS = AdeyaWallet/AdeyaWallet.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 42;
CURRENT_PROJECT_VERSION = 43;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = Z5W7KRPGHZ;
INFOPLIST_FILE = AdeyaWallet/Info.plist;
Expand Down

0 comments on commit 59b1cc1

Please sign in to comment.