Skip to content

Commit

Permalink
Dev (#186)
Browse files Browse the repository at this point in the history
Co-authored-by: Poonam Ghewande <[email protected]>
Co-authored-by: Ajay Jadhav <[email protected]>
Co-authored-by: Sai Ranjit Tummalapalli <[email protected]>
Co-authored-by: Amit Padmani <[email protected]>
  • Loading branch information
4 people authored Apr 16, 2024
1 parent 0e106e8 commit 792c542
Show file tree
Hide file tree
Showing 44 changed files with 2,611 additions and 607 deletions.
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ MEDIATOR_URL=
MEDIATOR_USE_PUSH_NOTIFICATIONS=true
MEDIATOR_LABEL=Mediator

# Client code to use push notifications
CLIENT_CODE=CLIENT_CODE

# OCA
OCA_URL=https://raw.githubusercontent.com/credebl/credebl-aries-oca-bundles/release

Expand Down
3 changes: 3 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */
global.Buffer = require('buffer').Buffer

import { AdeyaAgentProvider } from '@adeya/ssi'
import * as React from 'react'
import { useEffect, useMemo } from 'react'
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ android {
applicationId "id.credebl.adeya"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 8
versionName "1.0.5"
versionCode 11
versionName "1.0.8"

missingDimensionStrategy 'react-native-camera', 'general'
}
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
<data android:scheme="https" />

<data android:host="agent.credebl.id" />
<data android:host="dev-agent.credebl.id" />
<data android:host="s3.ap-south-1.amazonaws.com" />
</intent-filter>

</activity>
Expand Down
7 changes: 7 additions & 0 deletions app/assets/img/active-explore-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/img/adeya-logo-secondary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/components/misc/CredentialCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const CredentialCard: React.FC<CredentialCardProps> = ({
hasAltCredentials={hasAltCredentials}
proof
elevated
onPress={onPress}
/>
)
}
Expand Down
6 changes: 2 additions & 4 deletions app/components/misc/SharedProofData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,8 @@ const SharedDataCard: React.FC<{ sharedData: GroupedSharedProofDataItem }> = ({
return (
<View key={item.name} style={[styles.attributeContainer]}>
<Text style={styles.attributeName}>{item.label || item.name}</Text>
{!parsedPredicate && <AttributeValue style={styles.attributeValue} field={item as Attribute} shown={true} />}
{item instanceof Predicate && (
<Text style={styles.attributeValue}>{`${parsedPredicate?.pType} ${parsedPredicate?.pValue}`}</Text>
)}
{!item?.pType && <AttributeValue style={styles.attributeValue} field={item as Attribute} shown={true} />}
{item?.pType && <Text style={styles.attributeValue}>{`${item?.pType} ${item?.pValue}`}</Text>}
</View>
)
}
Expand Down
48 changes: 46 additions & 2 deletions app/components/modals/CommonRemoveModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,18 @@ const CommonRemoveModal: React.FC<CommonRemoveModalProps> = ({ usage, visible, d
...TextTheme.modalNormal,
marginTop: 25,
},
buttonsContainer: {
paddingTop: 10,
paddingBottom: 25,
},
})

const titleForConfirmButton = (): string => {
switch (usage) {
case ModalUsage.ContactRemoveWithCredentialsOffer:
return t('ContactDetails.GoToCredentialsOffer')
case ModalUsage.ContactRemoveWithProofRequest:
return t('ContactDetails.GoToProofRequest')
case ModalUsage.ContactRemove:
return t('ContactDetails.RemoveContact')
case ModalUsage.ContactRemoveWithCredentials:
Expand All @@ -142,6 +150,10 @@ const CommonRemoveModal: React.FC<CommonRemoveModalProps> = ({ usage, visible, d

const labelForConfirmButton = (): string => {
switch (usage) {
case ModalUsage.ContactRemoveWithCredentialsOffer:
return t('ContactDetails.GoToCredentialsOffer')
case ModalUsage.ContactRemoveWithProofRequest:
return t('ContactDetails.GoToProofRequest')
case ModalUsage.ContactRemove:
return t('ContactDetails.RemoveContact')
case ModalUsage.ContactRemoveWithCredentials:
Expand All @@ -156,6 +168,8 @@ const CommonRemoveModal: React.FC<CommonRemoveModalProps> = ({ usage, visible, d
const testIdForConfirmButton = (): string => {
switch (usage) {
case ModalUsage.ContactRemove:
case ModalUsage.ContactRemoveWithCredentialsOffer:
case ModalUsage.ContactRemoveWithProofRequest:
case ModalUsage.CredentialRemove:
return testIdWithKey('ConfirmRemoveButton')
case ModalUsage.ContactRemoveWithCredentials:
Expand All @@ -171,6 +185,8 @@ const CommonRemoveModal: React.FC<CommonRemoveModalProps> = ({ usage, visible, d
const testIdForCancelButton = (): string => {
switch (usage) {
case ModalUsage.ContactRemove:
case ModalUsage.ContactRemoveWithCredentialsOffer:
case ModalUsage.ContactRemoveWithProofRequest:
case ModalUsage.CredentialRemove:
return testIdWithKey('CancelRemoveButton')
case ModalUsage.ContactRemoveWithCredentials:
Expand Down Expand Up @@ -250,6 +266,28 @@ const CommonRemoveModal: React.FC<CommonRemoveModalProps> = ({ usage, visible, d
</View>
</View>
)
case ModalUsage.ContactRemoveWithCredentialsOffer:
return (
<View style={[{ marginBottom: 25 }]}>
<View style={[{ marginBottom: 25 }]}>
<Text style={[TextTheme.modalTitle]}>{t('ContactDetails.UnableToRemoveTitle')}</Text>
</View>
<View>
<Text style={[styles.bodyText]}>{t('ContactDetails.UnableToRemoveCaptionLabel')}</Text>
</View>
</View>
)
case ModalUsage.ContactRemoveWithProofRequest:
return (
<View style={[{ marginBottom: 25 }]}>
<View style={[{ marginBottom: 25 }]}>
<Text style={[TextTheme.modalTitle]}>{t('ContactDetails.UnableToRemoveTitle')}</Text>
</View>
<View>
<Text style={[styles.bodyText]}>{t('ContactDetails.UnableToRemoveCaptionRequestLabel')}</Text>
</View>
</View>
)
case ModalUsage.CredentialOfferDecline:
return (
<View style={[{ marginBottom: 25 }]}>
Expand Down Expand Up @@ -317,11 +355,17 @@ const CommonRemoveModal: React.FC<CommonRemoveModalProps> = ({ usage, visible, d
onPress={onSubmit}
disabled={disabled}
buttonType={
usage === ModalUsage.ContactRemoveWithCredentials ? ButtonType.ModalPrimary : ButtonType.ModalCritical
usage === ModalUsage.ContactRemoveWithCredentials
? ButtonType.ModalPrimary
: ButtonType.ModalCritical && usage === ModalUsage.ContactRemoveWithCredentialsOffer
? ButtonType.ModalPrimary
: ButtonType.ModalCritical && usage === ModalUsage.ContactRemoveWithProofRequest
? ButtonType.ModalPrimary
: ButtonType.ModalCritical
}
/>
</View>
<View style={[{ paddingTop: 10 }]}>
<View style={styles.buttonsContainer}>
<Button
title={t('Global.Cancel')}
accessibilityLabel={t('Global.Cancel')}
Expand Down
16 changes: 16 additions & 0 deletions app/components/record/RecordField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ const RecordField: React.FC<RecordFieldProps> = ({
},
})

const isJSON = (text: string) => {
if (typeof text !== 'string') {
return false
}
try {
JSON.parse(text)
return true
} catch (error) {
return false
}
}

if (isJSON(field?.value)) {
return
}

return (
<View style={styles.container}>
<View style={styles.valueContainer}>
Expand Down
4 changes: 4 additions & 0 deletions app/localization/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ const translation = {
"RemoveCaption": "To add credentials, the issuing organization needs to be a Contact.",
"UnableToRemoveTitle": "Unable to remove Contact",
"UnableToRemoveCaption": "Unable to remove because there are credentials issued by this Contact in your wallet. Remove the credentials first then remove this Contact.",
"UnableToRemoveCaptionLabel": "Unable to remove because there are credential offer issued by this Contact in your wallet. Remove the credentials offer first then remove this Contact.",
"UnableToRemoveCaptionRequestLabel": "Unable to remove because there are proof request issued by this Contact in your wallet. Remove the Proof request first then remove this Contact.",
"GoToCredentials": "Go to Credentials",
"GoToCredentialsOffer": "Go to CredentialsOffer",
"GoToProofRequest": "Go to ProofRequest",
"RemoveContact": "Remove Contact",
"ContactRemoved": "Contact removed",
"RemoveContactMessageTop": "By removing this Contact you'll no longer be able to:",
Expand Down
2 changes: 1 addition & 1 deletion app/navigators/TabStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const TabStack: React.FC = () => {
tabBarIconStyle: styles.tabBarIcon,
tabBarIcon: ({ focused }) => (
<View style={{ ...TabTheme.tabBarContainerStyle, justifyContent: showLabels ? 'flex-end' : 'center' }}>
<Assets.svg.ExploreIcon />
{focused ? <Assets.svg.ExploreIconActive /> : <Assets.svg.ExploreIcon />}
{showLabels && (
<Text
style={{
Expand Down
73 changes: 73 additions & 0 deletions app/onboardingStyles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import { StyleSheet } from 'react-native'
import { widthPercentageToDP as wp, heightPercentageToDP as hp } from 'react-native-responsive-screen'

export const styles = StyleSheet.create({
container: {
height: hp('100%'),
width: wp('100%'),
paddingTop: hp('3%'),
padding: hp('1%'),
},
headerText: {
alignSelf: 'center',
marginBottom: hp('2.5%'),
justifyContent: 'center',
color: '#1F4EAD',
paddingBottom: hp('2%'),
fontSize: 28,
},
backgroundImage: {
height: 245,
width: 343,
alignSelf: 'center',
},

Image: {
width: 78,
height: 78,
flexShrink: 0,
position: 'absolute',
right: 100,
top: 70,
left: 132,
bottom: 0,
},
qrImage: {
width: wp('21%'),
height: wp('21%'),
flexShrink: 0,
position: 'absolute',
right: wp('20%'),
top: hp('12.5%'),
left: wp('37.5%'),
},
bodyText: {
marginTop: hp('2.5%'),
display: 'flex',
width: wp('80%'),
flexDirection: 'column',
flexShrink: 0,
fontSize: hp('2.5%'),
textAlign: 'center',
color: '#2289F7',
},
descriptionText: {
alignSelf: 'center',
marginHorizontal: wp('1%'),
},
startedButtonContainer: {
marginTop: 'auto',
margin: wp('5%'),
},
guideImages: {
alignItems: 'center',
},
ScrollView: {
flex: 1,
padding: hp('0.5%'),
},
endPageContainer: {
height: '100%',
justifyContent: 'center',
},
})
Loading

0 comments on commit 792c542

Please sign in to comment.