Skip to content

feat: update sample app #1400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ public String getName() {
}

@ReactMethod
public void sendNativeNonFatal(final String exceptionObject) {
public void sendNativeNonFatal() {
final IBGNonFatalException exception = new IBGNonFatalException.Builder(new IllegalStateException("Test exception"))
.build();
CrashReporting.report(exception);

}

@ReactMethod
Expand Down
50 changes: 25 additions & 25 deletions examples/default/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2027,21 +2027,21 @@ SPEC CHECKSUMS:
Instabug: 9e81b71be68626dafc74759f3458f7c5894dd2e1
instabug-reactnative-ndk: d765ac289d56e8896398d02760d9abf2562fc641
OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74
RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740
RCT-Folly: 34124ae2e667a0e5f0ea378db071d27548124321
RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1
RCTRequired: a94e7febda6db0345d207e854323c37e3a31d93b
RCTTypeSafety: 28e24a6e44f5cbf912c66dde6ab7e07d1059a205
React: c2830fa483b0334bda284e46a8579ebbe0c5447e
React-callinvoker: 4aecde929540c26b841a4493f70ebf6016691eb8
React-Core: 9c059899f00d46b5cec3ed79251f77d9c469553d
React-CoreModules: 9fac2d31803c0ed03e4ddaa17f1481714f8633a5
React-cxxreact: a979810a3ca4045ceb09407a17563046a7f71494
React-Core: 32a581847d74ce9b5f51d9d11a4e4d132ad61553
React-CoreModules: f53e0674e1747fa41c83bc970e82add97b14ad87
React-cxxreact: 86f3b1692081fd954a0cb27cc90d14674645b64b
React-debug: 3d21f69d8def0656f8b8ec25c0f05954f4d862c5
React-defaultsnativemodule: 2fa2bdb7bd03ff9764facc04aa8520ebf14febae
React-domnativemodule: 986e6fe7569e1383dce452a7b013b6c843a752df
React-Fabric: 3bc7be9e3a6b7581fc828dc2aa041e107fc8ffb8
React-FabricComponents: 668e0cb02344c2942e4c8921a643648faa6dc364
React-FabricImage: 3f44dd25a2b020ed5215d4438a1bb1f3461cd4f1
React-defaultsnativemodule: 2ed121c5a1edeab09cff382b8d9b538260f07848
React-domnativemodule: 4393dd5dd7e13dbe42e69ebc791064a616990f91
React-Fabric: cbf38ceefb1ac6236897abdb538130228e126695
React-FabricComponents: dd4b01c4a60920d8dc15f3b5594c6fe9e7648a38
React-FabricImage: 8b13aedfbd20f349b9b3314baf993c71c02995d9
React-featureflags: ee1abd6f71555604a36cda6476e3c502ca9a48e5
React-featureflagsnativemodule: 7ccc0cd666c2a6257401dceb7920818ac2b42803
React-graphics: d7dd9c8d75cad5af19e19911fa370f78f2febd96
Expand All @@ -2065,25 +2065,25 @@ SPEC CHECKSUMS:
react-native-slider: 4a0f3386a38fc3d2d955efc515aef7096f7d1ee4
react-native-webview: c0b91a4598bd54e9fbc70353aebf1e9bab2e5bb9
React-nativeconfig: 8c83d992b9cc7d75b5abe262069eaeea4349f794
React-NativeModulesApple: 9f7920224a3b0c7d04d77990067ded14cee3c614
React-NativeModulesApple: 97f606f09fd9840b3868333984d6a0e7bcc425b5
React-perflogger: 59e1a3182dca2cee7b9f1f7aab204018d46d1914
React-performancetimeline: a9d05533ff834c6aa1f532e05e571f3fd2e3c1ed
React-performancetimeline: 3e3f5c5576fe1cc2dd5fcfb1ae2046d5dceda3d7
React-RCTActionSheet: d80e68d3baa163e4012a47c1f42ddd8bcd9672cc
React-RCTAnimation: bde981f6bd7f8493696564da9b3bd05721d3b3cc
React-RCTAppDelegate: 0176615c51476c88212bf3edbafb840d39ea7631
React-RCTBlob: 520a0382bf8e89b9153d60e3c6293e51615834e9
React-RCTFabric: c9da097b19b30017a99498b8c66a69c72f3ce689
React-RCTImage: 90448d2882464af6015ed57c98f463f8748be465
React-RCTLinking: 1bd95d0a704c271d21d758e0f0388cced768d77d
React-RCTNetwork: 218af6e63eb9b47935cc5a775b7a1396cf10ff91
React-RCTSettings: e10b8e42b0fce8a70fbf169de32a2ae03243ef6b
React-RCTText: e7bf9f4997a1a0b45c052d4ad9a0fe653061cf29
React-RCTVibration: 5b70b7f11e48d1c57e0d4832c2097478adbabe93
React-RCTAnimation: 051f0781709c5ed80ba8aa2b421dfb1d72a03162
React-RCTAppDelegate: 106d225d076988b06aa4834e68d1ab754f40cacf
React-RCTBlob: 895eaf8bca2e76ee1c95b479235c6ccebe586fc6
React-RCTFabric: 8d01df202ee9e933f9b5dd44b72ec89a7ac6ee01
React-RCTImage: b73149c0cd54b641dba2d6250aaf168fee784d9f
React-RCTLinking: 23e519712285427e50372fbc6e0265d422abf462
React-RCTNetwork: a5d06d122588031989115f293654b13353753630
React-RCTSettings: 87d03b5d94e6eadd1e8c1d16a62f790751aafb55
React-RCTText: 75e9dd39684f4bcd1836134ac2348efaca7437b3
React-RCTVibration: 033c161fe875e6fa096d0d9733c2e2501682e3d4
React-rendererconsistency: f620c6e003e3c4593e6349d8242b8aeb3d4633f0
React-rendererdebug: e697680f4dd117becc5daf9ea9800067abcee91c
React-rendererdebug: 5be7b834677b2a7a263f4d2545f0d4966cafad82
React-rncore: c22bd84cc2f38947f0414fab6646db22ff4f80cd
React-RuntimeApple: de0976836b90b484305638616898cbc665c67c13
React-RuntimeCore: 3c4a5aa63d9e7a3c17b7fb23f32a72a8bcfccf57
React-RuntimeApple: 71160e6c02efa07d198b84ef5c3a52a7d9d0399d
React-RuntimeCore: f88f79ec995c12af56a265d7505c7630733d9d82
React-runtimeexecutor: ea90d8e3a9e0f4326939858dafc6ab17c031a5d3
React-RuntimeHermes: c6b0afdf1f493621214eeb6517fb859ce7b21b81
React-runtimescheduler: 84f0d876d254bce6917a277b3930eb9bc29df6c7
Expand All @@ -2102,4 +2102,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: a1b532d67a1a86843e1f086101751ad55afa52da

COCOAPODS: 1.14.0
COCOAPODS: 1.16.2
10 changes: 8 additions & 2 deletions examples/default/src/components/InputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface InputFieldProps {
maxLength?: number;
accessibilityLabel?: string;
flex?: number;
testID?: string;
}

export const InputField = forwardRef<TextInput, InputFieldProps>(
Expand All @@ -34,6 +35,7 @@ export const InputField = forwardRef<TextInput, InputFieldProps>(
maxLength,
keyboardType,
errorText,
testID,
...restProps
},
ref,
Expand All @@ -43,11 +45,14 @@ export const InputField = forwardRef<TextInput, InputFieldProps>(
<TextInput
ref={ref}
placeholder={placeholder}
placeholderTextColor={'gray'}
style={[styles.textInput, style]}
maxLength={maxLength}
accessible={true}
accessibilityLabel={accessibilityLabel}
keyboardType={keyboardType}
value={value}
testID={testID}
onChangeText={onChangeText}
{...restProps}
/>
Expand All @@ -63,9 +68,10 @@ const styles = StyleSheet.create({
borderWidth: 1,
borderColor: '#ccc',
paddingVertical: 10,
paddingHorizontal: 24,
fontSize: 16,
paddingHorizontal: 16,
fontSize: 12,
borderRadius: 5,
color: 'black',
},
errorText: {
color: '#ff0000',
Expand Down
29 changes: 26 additions & 3 deletions examples/default/src/components/ListTile.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
import React, { PropsWithChildren } from 'react';

import { Box, HStack, Pressable, Text } from 'native-base';
import { Box, HStack, Pressable, Text, VStack } from 'native-base';

interface ListTileProps extends PropsWithChildren {
title: string;
subtitle?: string;
onPress?: () => void;
testID?: string;
truncateSubtitle?: boolean;
}

export const ListTile: React.FC<ListTileProps> = ({ title, onPress, children }) => {
export const ListTile: React.FC<ListTileProps> = ({
title,
subtitle,
onPress,
children,
testID,
truncateSubtitle = false,
}) => {
return (
<Pressable
onPress={onPress}
p="4"
rounded="2"
testID={testID}
shadow="1"
accessible={true}
borderBottomWidth="1"
borderColor="coolGray.300"
bg="coolGray.100"
_pressed={{ bg: 'coolGray.200' }}>
<HStack justifyContent="space-between" alignItems="center">
<Text>{title}</Text>
<VStack space={2}>
<Text>{title}</Text>
{subtitle && (
<Text
fontSize="xs"
color="coolGray.500"
numberOfLines={truncateSubtitle ? 1 : undefined}
ellipsizeMode={truncateSubtitle ? 'tail' : undefined}>
{subtitle}
</Text>
)}
</VStack>
<Box width={160}>{children}</Box>
</HStack>
</Pressable>
Expand Down
5 changes: 4 additions & 1 deletion examples/default/src/components/PlatformListTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ interface PlatformListTileProps extends PropsWithChildren {
title: string;
onPress?: () => void;
platform?: 'ios' | 'android';
testID?: string;
}

export const PlatformListTile: React.FC<PlatformListTileProps> = ({
title,
onPress,
platform,
children,
testID,
}) => {
if (Platform.OS === platform || !platform) {
return (
Expand All @@ -25,7 +27,8 @@ export const PlatformListTile: React.FC<PlatformListTileProps> = ({
borderBottomWidth="1"
borderColor="coolGray.300"
bg="coolGray.100"
_pressed={{ bg: 'coolGray.200' }}>
_pressed={{ bg: 'coolGray.200' }}
testID={testID}>
<HStack justifyContent="space-between" alignItems="center">
<Text>{title}</Text>
<Box width={160}>{children}</Box>
Expand Down
6 changes: 4 additions & 2 deletions examples/default/src/components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ interface SelectItem<T> {
label: string;
value: T;
isInitial?: boolean;
testID?: string;
}

interface SelectProps<T> {
label: string;
items: SelectItem<T>[];
onValueChange: (value: T) => void;
testID?: string;
}

export function Select<T>({ label, items, onValueChange }: SelectProps<T>) {
export function Select<T>({ label, items, onValueChange, testID }: SelectProps<T>) {
const initialItem = items.find((i) => i.isInitial) ?? items[0];
const [selectedItem, setSelectedItem] = useState(initialItem);

Expand All @@ -35,7 +37,7 @@ export function Select<T>({ label, items, onValueChange }: SelectProps<T>) {
endIcon: <CheckIcon size="4" />,
}}>
{items.map((item) => (
<NativeBaseSelect.Item key={item.label} label={item.label} value={item.label} />
<NativeBaseSelect.Item key={item.label} label={item.label} value={item.label} testID={testID} />
))}
</NativeBaseSelect>
);
Expand Down
Loading