Skip to content

Commit

Permalink
Merge branch 'master' of github.com:GoodDollar/GoodDAPP
Browse files Browse the repository at this point in the history
  • Loading branch information
L03TJ3 committed Feb 4, 2025
2 parents d331ae4 + 0af917f commit 1b3882b
Show file tree
Hide file tree
Showing 19 changed files with 344 additions and 150 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v2.55.1-0](https://github.com/GoodDollar/GoodDAPP/compare/v2.55.0...v2.55.1-0)

- add: mvp age verification [`#4331`](https://github.com/GoodDollar/GoodDAPP/pull/4331)
- add faq link, change from included countries to excluded countries [`757a391`](https://github.com/GoodDollar/GoodDAPP/commit/757a391642db717ec90ddee2ba753787c4b42f2f)
- - Fix faucet min balance check [`cfa61d6`](https://github.com/GoodDollar/GoodDAPP/commit/cfa61d663851b19a6535574aa566f4035c846569)
- fix: wrong link used for faq about ngw [`c8c93ec`](https://github.com/GoodDollar/GoodDAPP/commit/c8c93ecdfd7957c6844364ad21e6159231807cc8)

#### [v2.55.0](https://github.com/GoodDollar/GoodDAPP/compare/v2.54.0...v2.55.0)

> 7 January 2025

- fix: update deprecation dialog with welcome offer styles [`ac225b4`](https://github.com/GoodDollar/GoodDAPP/commit/ac225b41eb76c11805685e85b282d4daf9312603)
- remove welcome offer from dashboard [`0d49179`](https://github.com/GoodDollar/GoodDAPP/commit/0d491793a71eb21c9043c1c4ec6be8b289a3f755)
- fix: update goodid language files, bump gd sdks [`4fb5651`](https://github.com/GoodDollar/GoodDAPP/commit/4fb5651ac5c54441a27a992c00a585c2a6c9780e)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gooddollar/gooddapp",
"version": "2.55.0",
"version": "2.55.1-0",
"engines": {
"node": "18.x",
"npm": "9.x"
Expand Down
30 changes: 25 additions & 5 deletions src/components/common/buttons/CheckBox.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
import React from 'react'
import { View } from 'react-native'
import { CheckBox as WebCheckBox } from 'react-native-web'
import RNCheckBox from '@react-native-community/checkbox'
import { isMobileNative } from '../../../lib/utils/platform'
import { withStyles } from '../../../lib/styles'

const CheckBox = ({ onClick, children }) => (
<label style={{ marginBottom: 24, display: 'flex', alignItems: 'center', flexDirection: 'row' }}>
<input type="checkbox" onClick={onClick} style={{ width: 24, height: 24 }} />
const CheckBoxComponent = isMobileNative ? RNCheckBox : WebCheckBox
const CheckBox = ({ onClick, value, styles, children }) => (
<View style={styles.container}>
<CheckBoxComponent value={value} onValueChange={onClick} style={styles.checkbox} />
{children}
</label>
</View>
)

export default CheckBox
const mapStylesToProps = () => ({
container: {
flexDirection: 'row',
alignItems: 'center',
},
checkbox: {
width: 24,
height: 24,
marginRight: 8,
},
})

export default withStyles(mapStylesToProps)(CheckBox)

// export default CheckBox
26 changes: 0 additions & 26 deletions src/components/common/buttons/CheckBox.native.jsx

This file was deleted.

88 changes: 88 additions & 0 deletions src/components/faceVerification/components/AgeCheckError.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import React, { useEffect } from 'react'
import { View } from 'react-native'
import { t } from '@lingui/macro'

import Text from '../../common/view/Text'
import Separator from '../../common/layout/Separator'
import { Section } from '../../common'
import FaceVerificationErrorSmiley from '../../common/animations/FaceVerificationErrorSmiley'

import { isMobileOnly } from '../../../lib/utils/platform'
import { getDesignRelativeHeight, getDesignRelativeWidth } from '../../../lib/utils/sizes'
import { withStyles } from '../../../lib/styles'

import { fireEvent, FV_AGECHECKERROR } from '../../../lib/analytics/analytics'

const AgeCheckError = ({ styles, displayTitle, onRetry, nav, exception }) => {
useEffect(() => {
if (!exception) {
return
}

fireEvent(FV_AGECHECKERROR)
}, [])

return (
<Section style={styles.descriptionContainer} justifyContent="space-evenly">
<Section.Title fontWeight="medium" textTransform="none" color="red">
{t`You must be 18 years or older to get verified.`}
</Section.Title>
<Section.Row justifyContent="space-around">
<View style={styles.halfIllustration}>
<FaceVerificationErrorSmiley />
</View>
</Section.Row>
<Section style={styles.errorSection}>
<Separator width={2} />
<View style={styles.descriptionWrapper}>
<Text color="primary" fontWeight="bold" fontSize={18} lineHeight={25}>
{t`It seems your are under 18 years of age.`}
</Text>
<Text color="primary" fontSize={18} lineHeight={25}>
{t`If you think this is a mistake
please contact support.`}
</Text>
</View>
<Separator width={2} />
</Section>
</Section>
)
}

const getStylesFromProps = ({ theme }) => {
return {
halfIllustration: {
marginTop: isMobileOnly ? getDesignRelativeHeight(25) : 0,
marginBottom: isMobileOnly ? getDesignRelativeHeight(30) : 0,
width: getDesignRelativeWidth(130, false),
maxHeight: isMobileOnly ? getDesignRelativeHeight(97) : 'auto',
display: 'flex',
justifyContent: 'center',
marginRight: 0,
marginLeft: 0,
},
descriptionContainer: {
flex: 1,
marginBottom: 0,
paddingBottom: getDesignRelativeHeight(theme.sizes.defaultDouble),
paddingLeft: getDesignRelativeWidth(theme.sizes.default),
paddingRight: getDesignRelativeWidth(theme.sizes.default),
paddingTop: getDesignRelativeHeight(theme.sizes.default),
width: '100%',
},
actionsSpace: {
marginBottom: getDesignRelativeHeight(16),
},
errorSection: {
paddingBottom: 0,
paddingTop: 0,
marginBottom: 0,
},
descriptionWrapper: {
paddingTop: getDesignRelativeHeight(25),
paddingBottom: getDesignRelativeHeight(25),
},
}
}

export default withStyles(getStylesFromProps)(AgeCheckError)
50 changes: 36 additions & 14 deletions src/components/faceVerification/components/DuplicateFoundError.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useEffect } from 'react'
import { View } from 'react-native'
import React, { useCallback, useEffect } from 'react'
import { Linking, View } from 'react-native'
import { t } from '@lingui/macro'

import { get } from 'lodash'
import moment from 'moment'
import Text from '../../common/view/Text'
import { Section } from '../../common'

Expand All @@ -13,6 +14,12 @@ import FVErrorTwinSVG from '../../../assets/FaceVerification/FVErrorTwin.svg'
import { fireEvent, FV_DUPLICATEERROR } from '../../../lib/analytics/analytics'

const DuplicateFoundError = ({ styles, displayTitle, onRetry, nav, exception }) => {
const onLearnMore = useCallback(() => {
Linking.openURL('https://docs.gooddollar.org/frequently-asked-questions/troubleshooting#help-it-says-i-have-a-twin')
}, [])

const expiration = get(exception, 'response.enrollmentResult.duplicate.expiration')

useEffect(() => {
if (!exception) {
return
Expand All @@ -29,23 +36,38 @@ const DuplicateFoundError = ({ styles, displayTitle, onRetry, nav, exception })
{displayTitle}
</Section.Title>
)}
{(displayTitle ? `,\n` : '') +
t`Unfortunately we found
your twin...`}
{(displayTitle ? `,\n` : '') + t`We found your twin...`}
</Section.Title>
<Section style={styles.errorSection}>
<View style={styles.descriptionWrapper}>
<Text>
<Text fontSize={18} lineHeight={25} fontWeight="bold">
{t`You can open ONLY ONE account
<Text fontSize={16} lineHeight={25} fontWeight="bold">
{t`You can verify ONLY ONE wallet address
per person. `}
</Text>
<Text fontSize={18} lineHeight={25}>
{t`If this is your only active
account - please contact our support`}
</Text>
</Text>
<Text fontSize={18} lineHeight={25}>
{t`If this is your only active
account - please contact support.`}
</Text>
</View>
{expiration && (
<View marginTop={20}>
<Text fontSize={16} lineHeight={25} fontWeight="bold">
{t`The existing identity will expire on ${moment(expiration).format('l')}.
After this expiry, you may verify a different wallet address.`}
</Text>
<Text
color="primary"
fontWeight="bold"
fontSize={18}
lineHeight={26}
textDecorationLine="underline"
style={styles.learnMore}
onPress={onLearnMore}
>
{t`Learn More`}
</Text>
</View>
)}
</Section>
<Section.Row justifyContent="space-evenly">
<View style={styles.errorImage}>
Expand Down
16 changes: 11 additions & 5 deletions src/components/faceVerification/components/ErrorButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,27 @@ import { withStyles } from '../../../lib/styles'

const { fvTypeformUrl } = Config

const ErrorButtons = ({ styles, screenProps, navigation, onRetry, reachedMax }) => {
const ErrorButtons = ({ styles, screenProps, navigation, onRetry, reachedMax, invert = false }) => {
const onContactSupport = useCallback(() => openLink(fvTypeformUrl), [])

return (
<View style={styles.buttonsContainer}>
{!reachedMax ? (
<View>
<CustomButton onPress={onRetry} style={styles.actionsSpace}>
<View style={{ flex: 1 }}>
<CustomButton onPress={onRetry} style={styles.actionsSpace} mode={invert ? 'outlined' : undefined}>
TRY AGAIN
</CustomButton>
<CustomButton onPress={onContactSupport} mode="outlined">
<CustomButton onPress={onContactSupport} mode={invert ? undefined : 'outlined'}>
{t`CONTACT SUPPORT`}
</CustomButton>
</View>
) : (
<GiveUpButton navigation={navigation} />
<View>
<GiveUpButton navigation={navigation} />
<CustomButton onPress={onRetry} style={styles.actionsSpace}>
TRY AGAIN
</CustomButton>
</View>
)}
</View>
)
Expand All @@ -37,6 +42,7 @@ const getStylesFromProps = ({ theme }) => ({
width: '100%',
},
actionsSpace: {
marginTop: 10, //native design fix
marginBottom: getDesignRelativeHeight(16),
},
})
Expand Down
59 changes: 43 additions & 16 deletions src/components/faceVerification/components/Instructions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { CustomButton, Section, Wrapper } from '../../common'
import { getDesignRelativeHeight, getDesignRelativeWidth, isLargeDevice } from '../../../lib/utils/sizes'
import normalize from '../../../lib/utils/normalizeText'
import { withStyles } from '../../../lib/styles'
import { isBrowser } from '../../../lib/utils/platform'
import { isBrowser, isMobile } from '../../../lib/utils/platform'

// assets
import illustration from '../../../assets/FRInstructions.png'
Expand All @@ -32,26 +32,42 @@ const Dot = () => (
</Text>
)

const Instructions = ({ styles, onDismiss = noop, ready }) => (
const Instructions = ({ styles, onDismiss = noop, ready, fvStarted = false }) => (
<Wrapper>
<Section style={styles.topContainer} grow>
<View style={styles.mainContent}>
<Image source={illustration} resizeMode="contain" style={styles.illustration} />
<View style={styles.descriptionContainer}>
<View style={styles.descriptionWrapper}>
<Text style={styles.text}>
<Dot />
{t`Hold Your Camera at Eye Level`}
</Text>
<Text style={styles.text}>
<Dot />
{t`Light Your Face Evenly`}
</Text>
<Text style={styles.text}>
<Dot />
{t`Avoid Smiling & Back Light`}
</Text>
</View>
{!fvStarted ? (
<View style={styles.descriptionWrapper}>
{!isMobile && (
<Text style={styles.text}>
<Dot />
{t`Face Directly In Front of the Camera`}
</Text>
)}
<Text style={styles.text}>
<Dot />
{t`Hold Your Camera at Eye Level`}
</Text>
<Text style={styles.text}>
<Dot />
{t`Light Your Face Evenly`}
</Text>
<Text style={styles.text}>
<Dot />
{t`Avoid Smiling & Back Light`}
</Text>
</View>
) : (
<View style={styles.warnDescriptionWrapper}>
<Text style={styles.warnText}>{t`Notice:
Face verifying for someone else's use is against the terms & service policy.`}</Text>
<Text
style={styles.warnText}
>{t`Doing so may result in a loss of funds and/or your account being blocked.`}</Text>
</View>
)}
</View>
<CustomButton
loading={!ready}
Expand Down Expand Up @@ -123,6 +139,10 @@ const getStylesFromProps = ({ theme }) => ({
flexDirection: 'column',
alignItems: 'flex-start',
},
warnDescriptionWrapper: {
flexDirection: 'column',
alignItems: 'center',
},
descriptionWrapperB: {
backgroundColor: theme.colors.darkGray,
borderRadius: 8,
Expand All @@ -136,6 +156,13 @@ const getStylesFromProps = ({ theme }) => ({
fontSize: normalize(isLargeDevice ? 22 : 20),
lineHeight: isLargeDevice ? 36 : 34,
},
warnText: {
// textAlign: 'center',
fontSize: normalize(isLargeDevice ? 22 : 20),
lineHeight: isLargeDevice ? 36 : 34,
fontWeight: 'bold',
color: theme.colors.red,
},
textB: {
textAlign: 'left',
fontSize: 16,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ export default (options = null) => {
name = 'DuplicateFoundError'
} else if (/face.+n.t\s+match/.test(message)) {
name = 'NotMatchError'
} else if (/age check failed/.test(message)) {
name = 'AgeCheckError'
} else {
// the following code is needed to categorize exceptions
// then we could display specific error messages
Expand Down
Loading

0 comments on commit 1b3882b

Please sign in to comment.