@umituz/react-native-sentry 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-sentry",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Production-ready error tracking and performance monitoring for React Native apps",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -53,3 +53,10 @@ export {
53
53
  setTestUser,
54
54
  runTestSuite,
55
55
  } from './presentation/utils/testHelpers';
56
+
57
+ // UI Components (for settings integration)
58
+ export {
59
+ SentryTestSetting,
60
+ createSentryTestSetting,
61
+ } from './presentation/components/SentryTestSetting';
62
+ export type { SentryTestSettingProps } from './presentation/components/SentryTestSetting';
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Sentry Test Setting Component
3
+ * Single Responsibility: Provide Sentry test setting config (DEV only)
4
+ * Framework-agnostic design - returns configuration object
5
+ */
6
+
7
+ import { runTestSuite } from "../utils/testHelpers";
8
+
9
+ export interface SentryTestSettingProps {
10
+ title?: string;
11
+ description?: string;
12
+ userId?: string;
13
+ iconColor?: string;
14
+ titleColor?: string;
15
+ isLast?: boolean;
16
+ onPress?: (userId?: string) => void;
17
+ }
18
+
19
+ /**
20
+ * Creates Sentry test setting configuration
21
+ * Returns setting item props for use with any UI framework
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * import { createSentryTestSetting } from '@umituz/react-native-sentry';
26
+ *
27
+ * const sentryTestConfig = createSentryTestSetting({ userId: 'user123' });
28
+ * // Use with your UI framework's SettingItem component
29
+ * ```
30
+ */
31
+ export function createSentryTestSetting(props: SentryTestSettingProps = {}) {
32
+ // Only return config in DEV mode
33
+ if (!__DEV__) {
34
+ return null;
35
+ }
36
+
37
+ return {
38
+ type: "setting-item" as const,
39
+ icon: "bug" as const,
40
+ title: props.title || "Test Sentry",
41
+ value: props.description || "Send test error to Sentry dashboard",
42
+ onPress: () => {
43
+ if (props.onPress) {
44
+ props.onPress(props.userId);
45
+ } else {
46
+ runTestSuite(props.userId);
47
+ }
48
+ },
49
+ iconColor: props.iconColor || "#EF4444",
50
+ titleColor: props.titleColor || "#EF4444",
51
+ isLast: props.isLast ?? false,
52
+ devOnly: true,
53
+ };
54
+ }
55
+
56
+ // Alias for backward compatibility
57
+ export const SentryTestSetting = createSentryTestSetting;