Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
chore: (demo-tt) Wallet should use TTD as the default currency code (#41
Browse files Browse the repository at this point in the history
)

* chore: add ttd currency

* feat: ensure account initialization

* chore: set currency default on store init

* chore: pin skips phone number

* fix: remove rewards for test event

* chore: remove unnecessary notifications

* chore: bump to 1.34.2
  • Loading branch information
shottah authored Aug 17, 2022
1 parent be20e9a commit ab4dbf5
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 184 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode appVersionCode
versionName "1.34.1"
versionName "1.34.2"
multiDexEnabled true
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CELO_RELEASE_KEY_ALIAS=celo-key-alias

# Setting this manually based on version number until we have this deploying via Cloud Build
# Example: v1.5.1 deployment number 1 = 1005001001 (1 005 001 001)
VERSION_CODE=1021071630
VERSION_CODE=1021071631
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
Expand Down
16 changes: 8 additions & 8 deletions ios/celo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = celo/celo.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 22;
CURRENT_PROJECT_VERSION = 23;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 48TPT4QN6K;
HEADER_SEARCH_PATHS = "$(inherited)";
Expand All @@ -1189,7 +1189,7 @@
"$(inherited)",
"$(PROJECT_DIR)",
);
MARKETING_VERSION = 1.34.1;
MARKETING_VERSION = 1.34.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand All @@ -1212,7 +1212,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = celo/celo.entitlements;
CURRENT_PROJECT_VERSION = 22;
CURRENT_PROJECT_VERSION = 23;
DEVELOPMENT_TEAM = 48TPT4QN6K;
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = celo/Info.plist;
Expand All @@ -1221,7 +1221,7 @@
"$(inherited)",
"$(PROJECT_DIR)",
);
MARKETING_VERSION = 1.34.1;
MARKETING_VERSION = 1.34.2;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -1423,7 +1423,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 22;
CURRENT_PROJECT_VERSION = 23;
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
Expand All @@ -1442,7 +1442,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
MARKETING_VERSION = 1.34.1;
MARKETING_VERSION = 1.34.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -1469,7 +1469,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 22;
CURRENT_PROJECT_VERSION = 23;
ENABLE_BITCODE = NO;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -1482,7 +1482,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
MARKETING_VERSION = 1.34.1;
MARKETING_VERSION = 1.34.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
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": "@valora/wallet",
"version": "1.34.1",
"version": "1.34.2",
"author": "Celo",
"license": "Apache-2.0",
"private": true,
Expand Down
32 changes: 11 additions & 21 deletions src/account/NuxInterests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@ import { useFocusEffect } from '@react-navigation/native'
import { StackScreenProps, useHeaderHeight } from '@react-navigation/stack'
import { includes } from 'lodash'
import React, { useCallback, useEffect, useLayoutEffect, useState } from 'react'
import { useAsync } from 'react-async-hook'
import { useTranslation } from 'react-i18next'
import { Image, ScrollView, StyleSheet, Text, View } from 'react-native'
import { TouchableOpacity } from 'react-native-gesture-handler'
import Modal from 'react-native-modal'
import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { FlatGrid } from 'react-native-super-grid'
import { useDispatch, useSelector } from 'react-redux'
import { addUserInterest, removeUserInterest } from 'src/account/actions'
import { addUserInterest, initializeAccount, removeUserInterest } from 'src/account/actions'
import InterestsLearnMoreDialog from 'src/account/InterestsLearnMoreDialog'
import { NuxInterestChoice } from 'src/account/reducer'
import { choseToRestoreAccountSelector, currentInterestsSelector } from 'src/account/selectors'
import { currentInterestsSelector } from 'src/account/selectors'
import { VerificationEvents } from 'src/analytics/Events'
import ValoraAnalytics from 'src/analytics/ValoraAnalytics'
import {
hideVerificationSelector,
numberVerifiedSelector,
registrationStepsSelector,
} from 'src/app/selectors'
import { registrationStepsSelector } from 'src/app/selectors'
import BackButton from 'src/components/BackButton'
import Button, { BtnSizes, BtnTypes } from 'src/components/Button'
import TextButton from 'src/components/TextButton'
Expand All @@ -38,13 +35,13 @@ import { navigate, navigateHome } from 'src/navigator/NavigationService'
import { Screens } from 'src/navigator/Screens'
import { TopBarTextButton } from 'src/navigator/TopBarButton'
import { StackParamList } from 'src/navigator/types'
import useTypedSelector from 'src/redux/useSelector'
import { waitUntilSagasFinishLoading } from 'src/redux/sagas'
import colors, { Colors } from 'src/styles/colors'
import fontStyles from 'src/styles/fonts'
import { Spacing } from 'src/styles/styles'
import Logger from 'src/utils/Logger'
import { useAsyncKomenciReadiness } from 'src/verify/hooks'
import {
checkIfKomenciAvailable,
currentStateSelector,
reset,
setKomenciContext,
Expand All @@ -55,26 +52,22 @@ import {
verificationStatusSelector,
} from 'src/verify/reducer'
import VerificationSkipDialog from 'src/verify/VerificationSkipDialog'
import { currentAccountSelector } from 'src/web3/selectors'

type ScreenProps = StackScreenProps<StackParamList, Screens.NuxInterests>

type Props = ScreenProps

function NuxInterestsScreen({ route, navigation }: Props) {
const showSkipDialog = route.params?.showSkipDialog || false
const account = useTypedSelector(currentAccountSelector)
const [showLearnMoreDialog, setShowLearnMoreDialog] = useState(false)
const { t } = useTranslation()
const dispatch = useDispatch()
const headerHeight = useHeaderHeight()
const insets = useSafeAreaInsets()
const numberVerified = useSelector(numberVerifiedSelector)
const partOfOnboarding = !route.params?.hideOnboardingStep
const currentState = useSelector(currentStateSelector)
const shouldUseKomenci = useSelector(shouldUseKomenciSelector)
const verificationStatus = useSelector(verificationStatusSelector)
const choseToRestoreAccount = useSelector(choseToRestoreAccountSelector)
const { step, totalSteps } = useSelector(registrationStepsSelector)
const currentInterests = useSelector(currentInterestsSelector)
const [allowContinue, showContinue] = useState(false)
Expand All @@ -101,11 +94,6 @@ function NuxInterestsScreen({ route, navigation }: Props) {
}
}

const onPressContinueWhenVerificationUnavailable = () => {
dispatch(setHasSeenVerificationNux(true))
navigateHome()
}

const onPressLearnMore = () => {
setShowLearnMoreDialog(true)
}
Expand Down Expand Up @@ -148,9 +136,11 @@ function NuxInterestsScreen({ route, navigation }: Props) {
showContinue(currentInterests.length > 0)
}, [currentInterests])

// CB TEMPORARY HOTFIX: Pinging Komenci endpoint to ensure availability
const hideVerification = useSelector(hideVerificationSelector)
const asyncKomenciReadiness = useAsyncKomenciReadiness()
useAsync(async () => {
await waitUntilSagasFinishLoading()
dispatch(initializeAccount())
dispatch(checkIfKomenciAvailable())
}, [])

useFocusEffect(
// useCallback is needed here: https://bit.ly/2G0WKTJ
Expand Down
151 changes: 2 additions & 149 deletions src/home/NotificationBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import { useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { NativeScrollEvent, ScrollView, StyleSheet, View } from 'react-native'
import { useDispatch } from 'react-redux'
import {
dismissGetVerified,
dismissGoldEducation,
dismissKeepSupercharging,
dismissStartSupercharging,
} from 'src/account/actions'
import { HomeEvents, RewardsEvents } from 'src/analytics/Events'
import { ScrollDirection } from 'src/analytics/types'
import ValoraAnalytics from 'src/analytics/ValoraAnalytics'
Expand All @@ -26,7 +20,7 @@ import { getReclaimableEscrowPayments } from 'src/escrow/reducer'
import { dismissNotification } from 'src/home/actions'
import { DEFAULT_PRIORITY } from 'src/home/reducers'
import { getExtraNotifications } from 'src/home/selectors'
import { backupKey, boostRewards, getVerified, learnCelo } from 'src/images/Images'
import { backupKey, boostRewards } from 'src/images/Images'
import { ensurePincode, navigate } from 'src/navigator/NavigationService'
import { Screens } from 'src/navigator/Screens'
import IncomingPaymentRequestSummaryNotification from 'src/paymentRequest/IncomingPaymentRequestSummaryNotification'
Expand Down Expand Up @@ -83,13 +77,7 @@ interface Notification {
}

function useSimpleActions() {
const {
backupCompleted,
dismissedGetVerified,
dismissedGoldEducation,
dismissedKeepSupercharging,
dismissedStartSupercharging,
} = useSelector((state) => state.account)
const { backupCompleted } = useSelector((state) => state.account)

const numberVerified = useSelector((state) => state.app.numberVerified)
const goldEducationCompleted = useSelector((state) => state.goldToken.educationCompleted)
Expand Down Expand Up @@ -167,113 +155,9 @@ function useSimpleActions() {
},
],
})
} else {
if (isSupercharging && !dismissedKeepSupercharging) {
actions.push({
id: 'keepSupercharging',
text: t('superchargingNotificationBodyV1_33', { apy: superchargeApy }),
icon: boostRewards,
priority: SUPERCHARGE_INFO_PRIORITY,
callToActions: [
{
text: t('superchargingNotificationStart'),
onPress: () => {
ValoraAnalytics.track(HomeEvents.notification_select, {
notificationType: NotificationBannerTypes.supercharging,
selectedAction: NotificationBannerCTATypes.accept,
})
navigate(Screens.ConsumerIncentivesHomeScreen)
ValoraAnalytics.track(RewardsEvents.rewards_screen_opened, {
origin: RewardsScreenOrigin.SuperchargingNotification,
})
},
},
{
text: t('dismiss'),
isSecondary: true,
onPress: () => {
ValoraAnalytics.track(HomeEvents.notification_select, {
notificationType: NotificationBannerTypes.supercharging,
selectedAction: NotificationBannerCTATypes.decline,
})
dispatch(dismissKeepSupercharging())
},
},
],
})
}

if (!isSupercharging && !dismissedStartSupercharging) {
actions.push({
id: 'startSupercharging',
text: t('startSuperchargingNotificationBody'),
icon: boostRewards,
priority: SUPERCHARGE_INFO_PRIORITY,
callToActions: [
{
text: t('startSuperchargingNotificationStart'),
onPress: () => {
ValoraAnalytics.track(HomeEvents.notification_select, {
notificationType: NotificationBannerTypes.start_supercharging,
selectedAction: NotificationBannerCTATypes.accept,
})
navigate(Screens.ConsumerIncentivesHomeScreen)
ValoraAnalytics.track(RewardsEvents.rewards_screen_opened, {
origin: RewardsScreenOrigin.StartSuperchargingNotification,
})
},
},
{
text: t('dismiss'),
isSecondary: true,
onPress: () => {
ValoraAnalytics.track(HomeEvents.notification_select, {
notificationType: NotificationBannerTypes.supercharging,
selectedAction: NotificationBannerCTATypes.decline,
})
dispatch(dismissStartSupercharging())
},
},
],
})
}
}
}

if (!dismissedGetVerified && !numberVerified && verificationPossible) {
actions.push({
id: 'getVerified',
text: t('notification.body'),
icon: getVerified,
priority: VERIFICATION_PRIORITY,
callToActions: [
{
text: t('notification.cta'),
onPress: () => {
ValoraAnalytics.track(HomeEvents.notification_select, {
notificationType: NotificationBannerTypes.verification_prompt,
selectedAction: NotificationBannerCTATypes.accept,
})
navigate(Screens.VerificationEducationScreen, {
hideOnboardingStep: true,
})
},
},
{
text: t('dismiss'),
isSecondary: true,
onPress: () => {
ValoraAnalytics.track(HomeEvents.notification_select, {
notificationType: NotificationBannerTypes.verification_prompt,
selectedAction: NotificationBannerCTATypes.decline,
})
dispatch(dismissGetVerified())
},
},
],
})
}

for (const [id, notification] of Object.entries(extraNotifications)) {
if (!notification) {
continue
Expand Down Expand Up @@ -316,37 +200,6 @@ function useSimpleActions() {
})
}

if (!dismissedGoldEducation && !goldEducationCompleted) {
actions.push({
id: 'celoEducation',
text: t('whatIsGold'),
icon: learnCelo,
priority: CELO_EDUCATION_PRIORITY,
callToActions: [
{
text: t('learnMore'),
onPress: () => {
ValoraAnalytics.track(HomeEvents.notification_select, {
notificationType: NotificationBannerTypes.celo_asset_education,
selectedAction: NotificationBannerCTATypes.accept,
})
navigate(Screens.GoldEducation)
},
},
{
text: t('dismiss'),
isSecondary: true,
onPress: () => {
ValoraAnalytics.track(HomeEvents.notification_select, {
notificationType: NotificationBannerTypes.celo_asset_education,
selectedAction: NotificationBannerCTATypes.decline,
})
dispatch(dismissGoldEducation())
},
},
],
})
}
return actions
}

Expand Down
Loading

0 comments on commit ab4dbf5

Please sign in to comment.