Skip to content

Commit

Permalink
Merge pull request mosip#615 from ravikp/develop-06-03-2023
Browse files Browse the repository at this point in the history
UI changes and app stability fixes
  • Loading branch information
ravikp authored Mar 6, 2023
2 parents 7ef1399 + 7ce81a8 commit 8867f3c
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 88 deletions.
38 changes: 3 additions & 35 deletions components/SingleVcItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,6 @@ const VerifiedIcon: React.FC = () => {
};

const getDetails = (arg1, arg2, verifiableCredential) => {
if (arg1 === 'Full Name') {
return (
<Column>
<Text color={Theme.Colors.DetailsLabel} size="smaller">
{arg1}
</Text>
<Text
numLines={4}
color={Theme.Colors.Details}
weight="bold"
size="smaller"
style={
!verifiableCredential
? Theme.Styles.loadingTitle
: Theme.Styles.subtitle
}>
{!verifiableCredential ? '' : arg2}
</Text>
</Column>
);
}
if (arg1 === 'Status') {
return (
<Column>
Expand Down Expand Up @@ -79,7 +58,7 @@ const getDetails = (arg1, arg2, verifiableCredential) => {
{arg1}
</Text>
<Text
numLines={1}
numLines={4}
color={Theme.Colors.Details}
weight="bold"
size="smaller"
Expand Down Expand Up @@ -114,18 +93,9 @@ export const SingleVcItem: React.FC<VcItemProps> = (props) => {
? ''
: getLocalizedField(verifiableCredential.credentialSubject.fullName);

const selectableOrCheck = props.selectable ? (
<CheckBox
checked={props.selected}
checkedIcon={<Icon name="radio-button-checked" />}
uncheckedIcon={<Icon name="radio-button-unchecked" />}
onPress={() => props.onPress(service)}
/>
) : null;

return (
<Pressable
style={Theme.Styles.closeCardBgContainer}
style={Theme.Styles.selectedBindedVc}
onPress={() => props.onPress(service)}>
<ImageBackground
source={!verifiableCredential ? null : Theme.CloseCard}
Expand Down Expand Up @@ -170,9 +140,7 @@ export const SingleVcItem: React.FC<VcItemProps> = (props) => {
</Column>
</Column>

{verifiableCredential ? (
selectableOrCheck
) : (
{!verifiableCredential && (
<RotatingIcon name="sync" color={Theme.Colors.rotatingIcon} />
)}
</Row>
Expand Down
13 changes: 1 addition & 12 deletions components/VcItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,6 @@ export const VcItem: React.FC<VcItemProps> = (props) => {
? ''
: getLocalizedField(verifiableCredential.credentialSubject.fullName);

const selectableOrCheck = props.selectable ? (
<CheckBox
checked={props.selected}
checkedIcon={<Icon name="radio-button-checked" />}
uncheckedIcon={<Icon name="radio-button-unchecked" />}
onPress={() => props.onPress(service)}
/>
) : null;

const tag = useSelector(service, selectTag);

return (
Expand Down Expand Up @@ -229,9 +220,7 @@ export const VcItem: React.FC<VcItemProps> = (props) => {
</Column>
</Column>

{verifiableCredential ? (
selectableOrCheck
) : (
{!verifiableCredential && (
<RotatingIcon name="sync" color={Theme.Colors.rotatingIcon} />
)}
</Row>
Expand Down
2 changes: 1 addition & 1 deletion components/ui/themes/DefaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const DefaultTheme = {
borderRadius: 10,
margin: 5,
borderWidth: 2,
borderColor: Colors.Orange,
borderColor: Colors.Green,
},
labelPartContainer: {
marginLeft: 16,
Expand Down
6 changes: 3 additions & 3 deletions i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export const SUPPORTED_LANGUAGES = {
en: 'English',
fil: 'Filipino',
ar: 'عربى',
hi: 'Hindi',
kn: 'Kannada',
ta: 'Tamil',
hi: 'हिंदी',
kn: 'ಕನ್ನಡ',
ta: 'தமிழ்',
};

i18next
Expand Down
4 changes: 4 additions & 0 deletions machines/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,10 @@ export function selectIsReviewing(state: State) {
return state.matches('reviewing');
}

export function selectIsReviewingInIdle(state: State) {
return state.matches('reviewing.idle');
}

export function selectIsAccepted(state: State) {
return state.matches('reviewing.accepted');
}
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"react-native-gesture-handler": "~2.1.0",
"react-native-keychain": "^8.0.0",
"react-native-location-enabler": "^4.1.0",
"react-native-openid4vp-ble": "github:mosip/tuvali#v0.3.6",
"react-native-openid4vp-ble": "github:mosip/tuvali#v0.3.7",
"react-native-permissions": "^3.6.0",
"react-native-popable": "^0.4.3",
"react-native-qrcode-svg": "^6.1.1",
Expand Down
5 changes: 0 additions & 5 deletions screens/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ export const AppLayout: React.FC = () => {
title: '',
headerTitleAlign: 'center',
headerShadowVisible: false,
headerRight: () => (
<LanguageSelector
triggerComponent={<Icon name="language" color={Theme.Colors.Icon} />}
/>
),
headerBackVisible: false,
};

Expand Down
5 changes: 0 additions & 5 deletions screens/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ export const MainLayout: React.FC<RootRouteProps> = () => {
const options: BottomTabNavigationOptions = {
headerLeft: () => <Icon name="notifications" color={Theme.Colors.Icon} />,
headerLeftContainerStyle: { paddingStart: 16 },
headerRight: () => (
<LanguageSelector
triggerComponent={<Icon name="language" color={Theme.Colors.Icon} />}
/>
),
headerRightContainerStyle: { paddingEnd: 16 },
headerTitleAlign: 'center',
tabBarShowLabel: false,
Expand Down
6 changes: 6 additions & 0 deletions screens/Profile/ProfileScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const LanguageSetting: React.FC = () => {
<LanguageSelector
triggerComponent={
<ListItem bottomDivider>
<Icon
name="language"
size={20}
color={Theme.Colors.Icon}
style={Theme.Styles.profileIconBg}
/>
<ListItem.Content>
<ListItem.Title>
<Text>{t('language')}</Text>
Expand Down
3 changes: 3 additions & 0 deletions screens/Request/ReceiveVcScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const ReceiveVcScreen: React.FC = () => {
title={t('verifyAndSave')}
margin="12 0 12 0"
onPress={controller.ACCEPT_AND_VERIFY}
disabled={!controller.isReviewingInIdle}
/>
) : (
<Button
Expand All @@ -45,13 +46,15 @@ export const ReceiveVcScreen: React.FC = () => {
})}
margin="12 0 12 0"
onPress={controller.ACCEPT}
disabled={!controller.isReviewingInIdle}
/>
)}
<Button
type="clear"
title={t('discard')}
margin="0 0 12 0"
onPress={controller.REJECT}
disabled={!controller.isReviewingInIdle}
/>
</Column>
</Column>
Expand Down
2 changes: 2 additions & 0 deletions screens/Request/ReceiveVcScreenController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
selectIncomingVc,
selectIsIncomingVp,
selectIsInvalidIdentity,
selectIsReviewingInIdle,
selectIsVerifyingIdentity,
selectSenderInfo,
} from '../../machines/request';
Expand All @@ -22,6 +23,7 @@ export function useReceiveVcScreen() {
vcLabel: useSelector(settingsService, selectVcLabel),

isIncomingVp: useSelector(requestService, selectIsIncomingVp),
isReviewingInIdle: useSelector(requestService, selectIsReviewingInIdle),
isVerifyingIdentity: useSelector(requestService, selectIsVerifyingIdentity),
isInvalidIdentity: useSelector(requestService, selectIsInvalidIdentity),

Expand Down
8 changes: 0 additions & 8 deletions screens/Request/RequestLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ export const RequestLayout: React.FC = () => {
screenOptions={{
headerTitleAlign: 'center',
headerShadowVisible: false,
headerRight: () =>
I18nManager.isRTL && Platform.OS !== 'ios' ? null : (
<LanguageSelector
triggerComponent={
<Icon name="language" color={Theme.Colors.Icon} />
}
/>
),
headerLeft: () =>
I18nManager.isRTL && Platform.OS !== 'ios' ? (
<LanguageSelector
Expand Down
8 changes: 0 additions & 8 deletions screens/Scan/ScanLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ export const ScanLayout: React.FC = () => {
initialRouteName="ScanScreen"
screenOptions={{
headerTitleAlign: 'center',
headerRight: () =>
I18nManager.isRTL && Platform.OS !== 'ios' ? null : (
<LanguageSelector
triggerComponent={
<Icon name="language" color={Theme.Colors.Icon} />
}
/>
),
headerLeft: () =>
I18nManager.isRTL && Platform.OS !== 'ios' ? (
<LanguageSelector
Expand Down
6 changes: 1 addition & 5 deletions screens/Scan/SendVcScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ export const SendVcScreen: React.FC = () => {
<Column fill backgroundColor={Theme.Colors.lightGreyBackgroundColor}>
<Column padding="16 0" scroll>
<DeviceInfoList of="receiver" deviceInfo={controller.receiverInfo} />
<CheckBox
title={t('consentToPhotoVerification')}
checked={controller.selectedVc.shouldVerifyPresence}
onPress={controller.TOGGLE_USER_CONSENT}
/>

<Column padding="24">
<Input
value={controller.reason ? controller.reason : ''}
Expand Down

0 comments on commit 8867f3c

Please sign in to comment.