Skip to content

Commit

Permalink
Merge branch 'master' of github.com:GoodDollar/GoodDAPP into l10n_master
Browse files Browse the repository at this point in the history
  • Loading branch information
L03TJ3 committed Oct 11, 2024
2 parents b060605 + 743d4c6 commit b3b9182
Show file tree
Hide file tree
Showing 15 changed files with 193 additions and 52 deletions.
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,38 @@ 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.47.1-2](https://github.com/GoodDollar/GoodDAPP/compare/v2.47.3...v2.47.1-2)

- re-verification screen [`#4303`](https://github.com/GoodDollar/GoodDAPP/pull/4303)
- New Crowdin updates [`#4277`](https://github.com/GoodDollar/GoodDAPP/pull/4277)
- 4254 goodid onboardflow [`#4264`](https://github.com/GoodDollar/GoodDAPP/pull/4264)
- wip: dont show mainnet stats [`#4301`](https://github.com/GoodDollar/GoodDAPP/pull/4301)
- chore: remove unused deps [`ec6d7ea`](https://github.com/GoodDollar/GoodDAPP/commit/ec6d7ea74b9c73b6cd58c5da5dfd302d5dec82e0)
- chore: lingui [`973123c`](https://github.com/GoodDollar/GoodDAPP/commit/973123cd193c711f4c165fb2e1da72778c6ab3f6)
- fixes: remove wallet-chat, wip: goodid android fixes [`7449093`](https://github.com/GoodDollar/GoodDAPP/commit/7449093431297f1180ed58ad2c8e73955e420308)

#### [v2.47.3](https://github.com/GoodDollar/GoodDAPP/compare/v2.47.2...v2.47.3)

> 20 September 2024

- fix: remove old dontShowOffer item, fix: fire event for migration_denied [`a181add`](https://github.com/GoodDollar/GoodDAPP/commit/a181addbd845bcea75e7c4ac3aa6d7d16ddace3e)

#### [v2.47.2](https://github.com/GoodDollar/GoodDAPP/compare/v2.47.1...v2.47.2)

> 20 September 2024

- fix: wrong import [`925156e`](https://github.com/GoodDollar/GoodDAPP/commit/925156e2b6a3af20e99c789e272a513dfeeefea5)

#### [v2.47.1](https://github.com/GoodDollar/GoodDAPP/compare/v2.47.0...v2.47.1)

> 19 September 2024

- gatherStats stuck on infinite loop if no lastUbiEvent [`dbb6f99`](https://github.com/GoodDollar/GoodDAPP/commit/dbb6f9911eeccd02ac6fbe9856f25f9e02813869)

#### [v2.47.0](https://github.com/GoodDollar/GoodDAPP/compare/v2.46.3...v2.47.0)

> 18 September 2024

- add deprecation modal [`#4296`](https://github.com/GoodDollar/GoodDAPP/pull/4296)
- Commit notes: [`f6e86d2`](https://github.com/GoodDollar/GoodDAPP/commit/f6e86d2e285e9a7536e69903b27a53ced42906d7)
- hotfix-merge: deprecation modal [`e4425ae`](https://github.com/GoodDollar/GoodDAPP/commit/e4425ae2e0b28d4f73b212fa7ee0c341ffd09b7a)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gooddollar/gooddapp",
"version": "2.47.0",
"version": "2.47.1-2",
"engines": {
"node": "18.x",
"npm": "9.x"
Expand Down Expand Up @@ -74,12 +74,12 @@
"@ethersproject/wallet": "^5.7.0",
"@expo/react-native-action-sheet": "^3.9.0",
"@fingerprintjs/fingerprintjs-pro": "^3.8.1",
"@gooddollar/good-design": "0.1.58-beta.f9275089",
"@gooddollar/good-design": "0.1.58-beta.64fceb78",
"@gooddollar/goodcontracts": "^2.6.2",
"@gooddollar/goodprotocol": "^2.0.24",
"@gooddollar/react-native-facetec": "^1.0.45",
"@gooddollar/react-native-side-menu": "^2.0.2",
"@gooddollar/web3sdk-v2": "0.2.32-beta.f9275089",
"@gooddollar/web3sdk-v2": "0.2.32-beta.64fceb78",
"@hcaptcha/react-hcaptcha": "^1.6.0",
"@indexeddbshim/indexeddbshim": "^6.5.0",
"@lingui/react": "^3.13.0",
Expand Down
Binary file added src/assets/billy-verifies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions src/components/common/buttons/ClaimButton.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// @flow
import React from 'react'
import React, { useContext } from 'react'
import { Animated, Platform, View } from 'react-native'
import { noop } from 'lodash'

import { t } from '@lingui/macro'

import { useFlagWithPayload } from '../../../lib/hooks/useFeatureFlags'
import { GoodWalletContext } from '../../../lib/wallet/GoodWalletProvider'
import { PushButton } from '../../appNavigation/PushButton'
import { withStyles } from '../../../lib/styles'
import Config from '../../../config/config'
Expand Down Expand Up @@ -51,6 +53,10 @@ const ClaimButton = withStyles(getStylesFromProps)(({
const isPending = false
const canContinue = () => true

const { goodWallet } = useContext(GoodWalletContext)
const payload = useFlagWithPayload('uat-goodid-flow')
const { whitelist } = payload

// if there's no status the first time then get it
// otherwise just return true.
// in case we already have status then button is disabled if pending so its ok to return true here.
Expand All @@ -62,7 +68,7 @@ const ClaimButton = withStyles(getStylesFromProps)(({
<PushButton
disabled={isPending}
canContinue={canContinue}
routeName={Config.env !== 'development' ? 'Claim' : 'GoodIdOnboard'}
routeName={Config.env === 'development' || whitelist.includes(goodWallet.account) ? 'GoodIdOnboard' : 'Claim'}
testID="claim_button"
screenProps={screenProps}
style={[styles.claimButton, isPending ? styles.inQueue : undefined, style]}
Expand Down
9 changes: 6 additions & 3 deletions src/components/dashboard/Claim.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,11 @@ const Claim = props => {
const advanceClaimsCounter = useClaimCounter()
const [, , collectInviteBounty] = useInviteBonus()

const payload = useFlagWithPayload('next-tasks')
const nextTasks = useFlagWithPayload('next-tasks')
const uat = useFlagWithPayload('uat-goodid-flow')

const { tasks } = payload
const { tasks } = nextTasks
const { whitelist } = uat || {}

// format number of people who did claim today
const formattedNumberOfPeopleClaimedToday = useMemo(() => formatWithSIPrefix(peopleClaimed), [peopleClaimed])
Expand Down Expand Up @@ -310,7 +312,8 @@ const Claim = props => {
)

const handleFaceVerification = useCallback(() => {
const nextStep = Config.env !== 'development' ? 'FaceVerificationIntro' : 'GoodIdOnboard'
const nextStep =
Config.env === 'development' || whitelist.includes(goodWallet.account) ? 'GoodIdOnboard' : 'FaceVerificationIntro'
navigate(nextStep, { from: 'Claim' })
}, [navigate])

Expand Down
6 changes: 3 additions & 3 deletions src/components/dashboard/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ const PrivacyOption = ({ title, value, field, setPrivacy }) => {
</RadioButton.Group>
)
}
const supportedCountryCodes = ['US', 'GB', 'ES', 'FR', 'IT', 'KR', 'BR', 'UA', 'TR', 'VN', 'CN', 'IN', 'ID', 'AR']
const supportedCountryCodes = ['US', 'GB', 'ES', 'AR', 'FR', 'IT', 'KR', 'BR', 'UA', 'TR', 'VN', 'CN', 'IN', 'ID']
type CountryCode = $ElementType<typeof supportedCountryCodes, number>

const countryCodeToLocale: { [key: CountryCode]: string } = {
US: 'en',
GB: 'en-gb',
ES: 'es',
AR: 'es-419',
FR: 'fr',
IT: 'it',
KR: 'ko',
Expand All @@ -84,13 +85,13 @@ const countryCodeToLocale: { [key: CountryCode]: string } = {
CN: 'zh',
IN: 'hi',
ID: 'id',
AR: 'es-419',
}

const languageCustomLabels: { [key: CountryCode]: string } = {
US: 'English-US',
GB: 'English-UK',
ES: 'Spanish',
AR: 'Latin-Spanish',
FR: 'French',
IT: 'Italian',
KR: 'Korean',
Expand All @@ -102,7 +103,6 @@ const languageCustomLabels: { [key: CountryCode]: string } = {
CN: 'Chinese-Simplified',
IN: 'Hindi',
ID: 'Indonesian',
AR: 'Latin-Spanish',
}

const getKeyByValue = (object, value) => {
Expand Down
96 changes: 77 additions & 19 deletions src/components/faceVerification/screens/IntroScreen.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// libraries
import React, { useCallback, useContext, useEffect, useMemo } from 'react'
import { Platform, View } from 'react-native'
import { ActivityIndicator, Image, Platform, View } from 'react-native'
import { t } from '@lingui/macro'
import { useIdentityExpiryDate } from '@gooddollar/web3sdk-v2'

import useFVRedirect from '../standalone/hooks/useFVRedirect'

// components
import Text from '../../common/view/Text'
import { CustomButton, Section, Wrapper } from '../../common'
import WaitForCompleted from '../components/WaitForCompleted'

// hooks
import useOnPress from '../../../lib/hooks/useOnPress'
Expand All @@ -16,6 +17,8 @@ import usePermissions from '../../permissions/hooks/usePermissions'
import useDisposingState from '../hooks/useDisposingState'
import useEnrollmentIdentifier from '../hooks/useEnrollmentIdentifier'

import { useWallet } from '../../../lib/wallet/GoodWalletProvider'

// utils
import logger from '../../../lib/logger/js-logger'
import { getFirstWord } from '../../../lib/utils/getFirstWord'
Expand All @@ -35,9 +38,12 @@ import AsyncStorage from '../../../lib/utils/asyncStorage'

// assets
import Wait24HourSVG from '../../../assets/Claim/wait24Hour.svg'

import FashionShootSVG from '../../../assets/FaceVerification/FashionPhotoshoot.svg'
import BillyVerifies from '../../../assets/billy-verifies.png'
import useProfile from '../../../lib/userStorage/useProfile'
import useFVLoginInfoCheck from '../standalone/hooks/useFVLoginInfoCheck'

const log = logger.child({ from: 'FaceVerificationIntro' })

const WalletDeletedPopupText = ({ styles }) => (
Expand All @@ -57,12 +63,54 @@ const WalletDeletedPopupText = ({ styles }) => (
</View>
)

const IntroReVerification = ({ styles, firstName, ready, onVerify, onLearnMore }) => (
<Wrapper>
<Section style={styles.topContainer} grow>
<View style={styles.mainContent}>
<Section.Title fontWeight="bold" textTransform="none" style={styles.mainTitle}>
{firstName ? `${firstName},` : ``}
<Section.Text fontWeight="bold" textTransform="none" color="#00AEFF" fontSize={30} lineHeight={30}>
{firstName ? `\n` : ''}
{t`It’s time to update
your Face Verification!`}
{`\n`}
</Section.Text>
</Section.Title>
<Section>
<Section.Text textAlign="left" fontSize={18} lineHeight={25} letterSpacing={0.18}>
{t`Every so often, it's necessary to double-check that you're still you. You’ll go through the same verification process you went through when you first signed up for GoodDollar.`}
</Section.Text>
<Section.Text textAlign="left" fontSize={18} lineHeight={25} letterSpacing={0.18} style={styles.mainText}>
{t`You’ll be able to claim once this process is complete.`}
</Section.Text>
</Section>
<View style={styles.illustration}>
<Image source={BillyVerifies} resizeMode="center" style={{ width: 160, height: 160, marginLeft: 'auto' }} />
</View>
<Section.Text
fontWeight="bold"
fontSize={18}
lineHeight={26}
textDecorationLine="underline"
style={styles.learnMore}
onPress={onLearnMore}
>
{t`Learn More`}
</Section.Text>
<CustomButton style={[styles.button]} onPress={onVerify} disabled={!ready}>
{t`Continue`}
</CustomButton>
</View>
</Section>
</Wrapper>
)

const Intro = ({ styles, firstName, ready, onVerify, onLearnMore }) => (
<Wrapper>
<Section style={styles.topContainer} grow>
<View style={styles.mainContent}>
<Section.Title fontWeight="bold" textTransform="none" style={styles.mainTitle}>
{firstName && `${firstName},`}
{firstName ? `${firstName},` : ``}
<Section.Text fontWeight="regular" textTransform="none" fontSize={24} lineHeight={30}>
{firstName ? `\n` : ''}
{t`Verify you are a real live person`}
Expand Down Expand Up @@ -97,7 +145,11 @@ const IntroScreen = ({ styles, screenProps, navigation }) => {
const { fullName } = useProfile()
const { showDialog } = useDialog()

const { isDelta, firstName, isFVFlow, isFVFlowReady } = useContext(FVFlowContext)
const { account: externalAccount, isDelta, firstName, isFVFlow, isFVFlowReady } = useContext(FVFlowContext)
const goodWallet = useWallet()
const { account } = goodWallet ?? {}
const [expiryDate, , state] = useIdentityExpiryDate(externalAccount || account)

const { goToRoot, navigateTo, push } = screenProps
const fvRedirect = useFVRedirect()
const { faceIdentifier: enrollmentIdentifier, v1FaceIdentifier: fvSigner } = useEnrollmentIdentifier()
Expand Down Expand Up @@ -176,21 +228,23 @@ const IntroScreen = ({ styles, screenProps, navigation }) => {

useFVLoginInfoCheck(navigation)

useEffect(() => {
if (isFVFlow && isFVFlowReady && !disposing && enrollmentIdentifier) {
handleVerifyClick()
}
}, [isFVFlow, isFVFlowReady, disposing, enrollmentIdentifier])
if (state === 'pending') {
return (
<View display="flex" justifyContent="center">
<ActivityIndicator size="large" />
</View>
)
}

if (isFVFlow) {
if (!expiryDate?.lastAuthenticated?.isZero()) {
return (
<Wrapper>
<Section style={styles.topContainer} grow>
<View style={styles.mainContent}>
<WaitForCompleted />
</View>
</Section>
</Wrapper>
<IntroReVerification
styles={styles}
firstName={userName}
onLearnMore={openPrivacy}
onVerify={handleVerifyClick}
ready={false === disposing}
/>
)
}

Expand Down Expand Up @@ -223,19 +277,23 @@ const getStylesFromProps = ({ theme }) => ({
mainContent: {
flexGrow: 1,
justifyContent: 'space-between',
paddingHorizontal: '32',
width: '100%',
},
mainTitle: {
marginTop: getDesignRelativeHeight(isBrowser ? 16 : 8),
},
mainText: {
marginTop: getDesignRelativeHeight(isSmallDevice ? 12 : theme.sizes.defaultDouble),
marginTop: getDesignRelativeHeight(20),
},
illustration: {
marginTop: getDesignRelativeHeight(20),
marginBottom: getDesignRelativeHeight(31),
width: '100%',
alignItems: 'center',
marginLeft: 'auto',
marginRight: 'auto',
width: 160,
height: 160,
},
descriptionContainer: {
paddingHorizontal: getDesignRelativeHeight(theme.sizes.defaultHalf),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { useCallback, useContext, useMemo } from 'react'

import { identity } from 'lodash'

import { useFlagWithPayload } from '../../../lib/hooks/useFeatureFlags'
import Instructions from '../components/Instructions'

import Config from '../../../config/config'
Expand Down Expand Up @@ -35,6 +37,9 @@ const FaceVerification = ({ screenProps, navigation }) => {
const goodWallet = useWallet()
const userStorage = useUserStorage()
const { isFVFlow } = useContext(FVFlowContext)
const payload = useFlagWithPayload('uat-goodid-flow')
const { whitelist } = payload ?? {}

const { faceIdentifier: enrollmentIdentifier, chainId, v1FaceIdentifier: fvSigner } = useEnrollmentIdentifier()

// Redirects to the error screen, passing exception
Expand Down Expand Up @@ -142,7 +147,8 @@ const FaceVerification = ({ screenProps, navigation }) => {
userStorage.userProperties.set('fv2', true)
}

const nextStep = Config.env !== 'development' ? 'Claim' : 'GoodIdOnboard'
const nextStep =
Config.env === 'development' || whitelist.includes(goodWallet.account) ? 'GoodIdOnboard' : 'Claim'

//go to goodid to complete certificates
screenProps.navigateTo(nextStep, { isValid: true })
Expand Down
Loading

0 comments on commit b3b9182

Please sign in to comment.