Skip to content

Commit 3c5f852

Browse files
committed
fix: more fixes
1 parent cbf9857 commit 3c5f852

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

src/core/i18n/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { locale } from 'expo-localization';
12
import i18n from 'i18next';
23
import { initReactI18next } from 'react-i18next';
34
import { I18nManager } from 'react-native';
@@ -8,7 +9,7 @@ export * from './utils';
89

910
i18n.use(initReactI18next).init({
1011
resources,
11-
lng: getLanguage() || 'en',
12+
lng: getLanguage() || locale, // TODO: if you are not supporting multiple languages or languages with multiple directions you can set the default value to `en`
1213
fallbackLng: 'en',
1314
compatibilityJSON: 'v3', // By default React Native projects does not support Intl
1415

src/core/test-utils.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import '@shopify/flash-list/jestSetup';
2+
13
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
24
import { NavigationContainer } from '@react-navigation/native';
35
import type { RenderOptions } from '@testing-library/react-native';

src/ui/select.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable max-lines-per-function */
2-
import '@shopify/flash-list/jestSetup';
32

43
import React from 'react';
54

src/ui/select.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
/* eslint-disable max-lines-per-function */
2-
import { type BottomSheetModal } from '@gorhom/bottom-sheet';
2+
import {
3+
BottomSheetFlatList,
4+
type BottomSheetModal,
5+
} from '@gorhom/bottom-sheet';
6+
import { FlashList } from '@shopify/flash-list';
37
import { useColorScheme } from 'nativewind';
48
import * as React from 'react';
59
import type { FieldValues } from 'react-hook-form';
610
import { useController } from 'react-hook-form';
7-
import { TouchableOpacity, View } from 'react-native';
11+
import { Platform, TouchableOpacity, View } from 'react-native';
812
import { Pressable, type PressableProps } from 'react-native';
913
import type { SvgProps } from 'react-native-svg';
1014
import Svg, { Path } from 'react-native-svg';
@@ -14,7 +18,6 @@ import colors from '@/ui/colors';
1418
import { CaretDown } from '@/ui/icons';
1519

1620
import type { InputControllerType } from './input';
17-
import { List } from './list';
1821
import { useModal } from './modal';
1922
import { Modal } from './modal';
2023
import { Text } from './text';
@@ -72,6 +75,9 @@ export const Options = React.forwardRef<BottomSheetModal, OptionsProps>(
7275
const snapPoints = React.useMemo(() => [height], [height]);
7376
const { colorScheme } = useColorScheme();
7477
const isDark = colorScheme === 'dark';
78+
79+
const List = Platform.OS === 'web' ? FlashList : BottomSheetFlatList;
80+
7581
const renderSelectItem = React.useCallback(
7682
({ item }: { item: Option }) => (
7783
<Option

0 commit comments

Comments
 (0)