Skip to content

Commit

Permalink
Style/UI update (#163)
Browse files Browse the repository at this point in the history
Co-authored-by: Sai Ranjit Tummalapalli <[email protected]>
Signed-off-by: Poonam Ghewande <[email protected]>
  • Loading branch information
poonam-ghewande and sairanjit committed Dec 14, 2023
1 parent c583c8e commit f45fce2
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 31 deletions.
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.
19 changes: 14 additions & 5 deletions app/onBordingstyle.ts → app/onboardingStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export const styles = StyleSheet.create({
container: {
height: hp('100%'),
width: wp('100%'),
padding: wp('5%'),
paddingTop: hp('5%'),
paddingTop: hp('3%'),
padding: hp('1%'),
},
headerText: {
alignSelf: 'center',
Expand Down Expand Up @@ -51,14 +51,23 @@ export const styles = StyleSheet.create({
textAlign: 'center',
color: '#2289F7',
},
descriptiionText: {
descriptionText: {
alignSelf: 'center',
marginHorizontal: wp('1%'),
},
startedButtonconatiner: {
startedButtonContainer: {
marginTop: 'auto',
margin: wp('5%'),
},
guideimages: {
guideImages: {
alignItems: 'center',
},
ScrollView: {
flex: 1,
padding: hp('0.5%'),
},
endPageContainer: {
height: '100%',
justifyContent: 'center',
},
})
41 changes: 21 additions & 20 deletions app/screens/OnboardingPages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import React from 'react'
import { Image, ScrollView, StyleSheet, Text, View, ImageBackground } from 'react-native'
import { SvgProps } from 'react-native-svg'

import onBoardingOrganizeease from '../assets/img/onBoardingOrganizeease.svg'
import onBoardingdatasafe from '../assets/img/onBoardingdatasafe.svg'
import onBoardingOrganizeEase from '../assets/img/onBoardingOrganizeease.svg'
import onBoardingDataSafe from '../assets/img/onBoardingdatasafe.svg'
import Button, { ButtonType } from '../components/buttons/Button'
import { useStore } from '../contexts/store'
import { styles } from '../onBordingstyle'
import { styles } from '../onboardingStyles'

import { ITheme, theme } from '../theme'
import { GenericFn } from '../types/fn'
Expand Down Expand Up @@ -88,18 +88,19 @@ const OnboardingPages = (onTutorialCompleted: GenericFn): Array<Element> => {

return (
<>
<ScrollView style={styles.container} contentContainerStyle={{ justifyContent: 'center' }}>
<Text style={[defaultStyle.headerText, styles.headerText]}>Share Securely</Text>
<Image source={require('../assets/img/sharesecure.png')} style={styles.backgroundImage} />
<View style={styles.descriptiionText}>
<Text style={[styles.bodyText]}>
Take complete control over your data. Securely connect with people and organizations to share necessary
information without compromising your privacy.
</Text>
</View>

<View style={styles.endPageContainer}>
<Text style={[defaultStyle.headerText, styles.headerText, { marginTop: 20 }]}>Share Securely</Text>
<ScrollView style={styles.ScrollView} contentContainerStyle={{ justifyContent: 'center' }}>
<Image source={require('../assets/img/sharesecure.png')} style={[styles.backgroundImage]} />
<View style={styles.descriptionText}>
<Text style={[styles.bodyText]}>
Take complete control over your data. Securely connect with people and organizations to share necessary
information without compromising your privacy.
</Text>
</View>
</ScrollView>
{!(store.onboarding.didCompleteTutorial && store.authentication.didAuthenticate) && (
<View style={styles.startedButtonconatiner}>
<View style={styles.startedButtonContainer}>
<Button
title="Get Started"
accessibilityLabel="Get Started"
Expand All @@ -109,7 +110,7 @@ const OnboardingPages = (onTutorialCompleted: GenericFn): Array<Element> => {
/>
</View>
)}
</ScrollView>
</View>
</>
)
}
Expand All @@ -123,7 +124,7 @@ const OnboardingPages = (onTutorialCompleted: GenericFn): Array<Element> => {
<Image source={require('../assets/img/face-scan.png')} style={styles.Image} />
</ImageBackground>

<View style={styles.descriptiionText}>
<View style={styles.descriptionText}>
<Text style={[styles.bodyText]}>
Unlock the power of your digital identity with our all-in-one wallet! Let's embark on a journey to take full
control of your digital presence.
Expand All @@ -139,12 +140,12 @@ const OnboardingPages = (onTutorialCompleted: GenericFn): Array<Element> => {
body: string
}> = [
{
image: onBoardingdatasafe,
image: onBoardingDataSafe,
title: 'Keep your data safe',
body: 'Safeguard your digital Credentials with ADEYA, ensuring that your data remains protected and shared with your consent only.',
},
{
image: onBoardingOrganizeease,
image: onBoardingOrganizeEase,
title: 'Organize with ease',
body: 'Organize and manage your digital credentials effortlessly within ADEYA. Say goodbye to paper documents and embrace the convenience of an identity wallet in your hand.',
},
Expand All @@ -160,8 +161,8 @@ const OnboardingPages = (onTutorialCompleted: GenericFn): Array<Element> => {
return (
<ScrollView style={styles.container}>
<Text style={[defaultStyle.headerText, styles.headerText]}>{title}</Text>
<View style={styles.guideimages}>{image(imageDisplayOptions)}</View>
<View style={styles.descriptiionText}>
<View style={styles.guideImages}>{image(imageDisplayOptions)}</View>
<View style={styles.descriptionText}>
<Text style={[styles.bodyText]}>{body}</Text>
</View>
</ScrollView>
Expand Down
45 changes: 39 additions & 6 deletions app/screens/PINEnter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,44 @@ const PINEnter: React.FC<PINEnterProps> = ({ setAuthenticated, usage = PINEntryU
}
}

const handlePINInput = async (PIN: string) => {
setPIN(PIN)
if (usage === PINEntryUsage.PINCheck) {
await verifyPIN(PIN)
}
if (PIN.length === minPINLength) {
try {
Keyboard.dismiss()
const result = await checkPIN(PIN)
if (!result) {
const newAttempt = store.loginAttempt.loginAttempts + 1
if (!getLockoutPenalty(newAttempt)) {
// skip displaying modals if we are going to lockout
setAlertModalVisible(true)
}
setContinueEnabled(true)

// log incorrect login attempts
dispatch({
type: DispatchAction.ATTEMPT_UPDATED,
payload: [{ loginAttempts: newAttempt }],
})

return
}

// reset login attempts if login is successful
dispatch({
type: DispatchAction.ATTEMPT_UPDATED,
payload: [{ loginAttempts: 0 }],
})

setAuthenticated(true)
} catch (error: unknown) {
// TODO:(jl) process error
}
}
}
const onPINInputCompleted = async (PIN: string) => {
try {
setContinueEnabled(false)
Expand Down Expand Up @@ -324,12 +362,7 @@ const PINEnter: React.FC<PINEnterProps> = ({ setAuthenticated, usage = PINEntryU
<Text style={[TextTheme.normal, { alignSelf: 'center', marginBottom: 16 }]}>{t('PINEnter.EnterPIN')}</Text>
)}
<PINInput
onPINChanged={(p: string) => {
setPIN(p)
if (p.length === minPINLength) {
Keyboard.dismiss()
}
}}
onPINChanged={(p: string) => handlePINInput(p)}
testID={testIdWithKey('EnterPIN')}
accessibilityLabel={t('PINEnter.EnterPIN')}
autoFocus={true}
Expand Down

0 comments on commit f45fce2

Please sign in to comment.