SELF-1554 : Fix Country Picker (#1492)

* country picker is always euclid.

* track when users press the info icon
This commit is contained in:
Aaron DeRuvo
2025-12-12 17:13:26 +01:00
committed by GitHub
parent a3ec81b8fa
commit 198297e96e
4 changed files with 10 additions and 13 deletions

View File

@@ -77,16 +77,12 @@ const documentsScreens = {
},
CountryPicker: {
screen: CountryPickerScreen,
options: IS_EUCLID_ENABLED
? ({
header: HeadlessNavForEuclid,
statusBarHidden: CountryPickerScreen.statusBar?.hidden,
statusBarStyle: CountryPickerScreen.statusBar?.style,
headerShown: true,
} as NativeStackNavigationOptions)
: {
headerShown: false,
},
options: {
header: HeadlessNavForEuclid,
statusBarHidden: CountryPickerScreen.statusBar?.hidden,
statusBarStyle: CountryPickerScreen.statusBar?.style,
headerShown: true,
} as NativeStackNavigationOptions,
},
IDPicker: {
screen: IDPickerScreen,

View File

@@ -8,4 +8,4 @@
* Use this constant instead of checking __DEV__ directly throughout the codebase.
*/
export const IS_DEV_MODE = typeof __DEV__ !== 'undefined' && __DEV__;
export const IS_EUCLID_ENABLED = IS_DEV_MODE; // just in case we forgot to turn it off before pushing to prod.
export const IS_EUCLID_ENABLED = false; //IS_DEV_MODE; // just in case we forgot to turn it off before pushing to prod.

View File

@@ -79,6 +79,7 @@ export const BackupEvents = {
};
export const DocumentEvents = {
COUNTRY_HELP_TAPPED: 'Document: Country Help Tapped',
ADD_NEW_AADHAAR_SELECTED: 'Document: Add Aadhaar',
ADD_NEW_MOCK_SELECTED: 'Document: Add New Document via Mock',
ADD_NEW_SCAN_SELECTED: 'Document: Add New Document via Scan',

View File

@@ -8,6 +8,7 @@ import { commonNames } from '@selfxyz/common/constants/countries';
import { CountryPickerScreen as CountryPickerUI, type SafeArea } from '@selfxyz/euclid';
import { RoundFlag } from '../../components';
import { DocumentEvents } from '../../constants/analytics';
import { useSelfClient } from '../../context';
import { useCountries } from '../../documents/useCountries';
import { buttonTap } from '../../haptic';
@@ -59,7 +60,6 @@ const CountryPickerScreen: React.FC<SafeArea> & { statusBar: typeof CountryPicke
const onSearchChange = useCallback((value: string) => {
setSearchValue(value);
}, []);
return (
<CountryPickerUI
insets={insets}
@@ -72,7 +72,7 @@ const CountryPickerScreen: React.FC<SafeArea> & { statusBar: typeof CountryPicke
getCountryName={getCountryName}
searchValue={searchValue}
onClose={selfClient.goBack}
onInfoPress={() => console.log('Info pressed TODO: Implement')}
onInfoPress={() => selfClient.trackEvent(DocumentEvents.COUNTRY_HELP_TAPPED)}
onSearchChange={onSearchChange}
/>
);