@umituz/react-native-settings 4.23.14 → 4.23.15

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-settings",
3
- "version": "4.23.14",
3
+ "version": "4.23.15",
4
4
  "description": "Complete settings hub for React Native apps - consolidated package with settings, about, legal, appearance, feedback, FAQs, rating, and gamification",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import React, { useEffect, useRef } from "react";
7
- import { View, StyleSheet, Animated, type ViewStyle, type TextStyle } from "react-native";
7
+ import { View, StyleSheet, type ViewStyle, type TextStyle } from "react-native";
8
8
  import { useAppDesignTokens, AtomicText, withAlpha } from "@umituz/react-native-design-system";
9
9
 
10
10
  export interface AchievementToastProps {
@@ -37,7 +37,7 @@ export const AchievementToast: React.FC<AchievementToastProps> = ({
37
37
  labelColor,
38
38
  }) => {
39
39
  const tokens = useAppDesignTokens();
40
- const translateY = useRef(new Animated.Value(-100)).current;
40
+ const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
41
41
 
42
42
  const finalBackgroundColor = backgroundColor || tokens.colors.primary;
43
43
  const finalTextColor = textColor || tokens.colors.onPrimary;
@@ -45,34 +45,22 @@ export const AchievementToast: React.FC<AchievementToastProps> = ({
45
45
 
46
46
  useEffect(() => {
47
47
  if (visible) {
48
- Animated.sequence([
49
- Animated.timing(translateY, {
50
- toValue: 0,
51
- duration: 400,
52
- useNativeDriver: true,
53
- }),
54
- Animated.delay(duration),
55
- Animated.timing(translateY, {
56
- toValue: -100,
57
- duration: 300,
58
- useNativeDriver: true,
59
- }),
60
- ]).start(() => {
48
+ timeoutRef.current = setTimeout(() => {
61
49
  onDismiss();
62
- });
50
+ }, duration);
63
51
  }
64
- }, [visible, duration, onDismiss, translateY]);
52
+
53
+ return () => {
54
+ if (timeoutRef.current) {
55
+ clearTimeout(timeoutRef.current);
56
+ }
57
+ };
58
+ }, [visible, duration, onDismiss]);
65
59
 
66
60
  if (!visible) return null;
67
61
 
68
62
  return (
69
- <Animated.View
70
- style={[
71
- styles.container,
72
- { transform: [{ translateY }] },
73
- containerStyle,
74
- ]}
75
- >
63
+ <View style={[styles.container, containerStyle]}>
76
64
  <View style={[styles.toast, { backgroundColor: finalBackgroundColor }]}>
77
65
  <View style={styles.iconContainer}>{icon}</View>
78
66
  <View style={styles.content}>
@@ -84,7 +72,7 @@ export const AchievementToast: React.FC<AchievementToastProps> = ({
84
72
  </AtomicText>
85
73
  </View>
86
74
  </View>
87
- </Animated.View>
75
+ </View>
88
76
  );
89
77
  };
90
78