@jescon-technologies/react-native-ui-kit 0.0.11 → 0.0.12
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/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
- package/src/Alerts/ABlink.tsx +56 -0
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as ErrorBoundary } from './src/Common/ErrorBoundary';
|
|
2
2
|
export { default as AAlertIOS } from './src/Alerts/AAlertIOS';
|
|
3
3
|
export { default as AAlert } from './src/Alerts/AAlert';
|
|
4
|
+
export { default as ABlink } from './src/Alerts/ABlink';
|
|
4
5
|
export { default as HIcons } from './src/Hoc/HIcons';
|
|
5
6
|
export { default as NetworkServiceCall } from './src/Common/NetworkServiceCall';
|
|
6
7
|
export * from './src/Navigation/useNavigation';
|
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as ErrorBoundary } from './src/Common/ErrorBoundary';
|
|
2
2
|
export { default as AAlertIOS } from './src/Alerts/AAlertIOS';
|
|
3
3
|
export { default as AAlert } from './src/Alerts/AAlert';
|
|
4
|
+
export { default as ABlink } from './src/Alerts/ABlink';
|
|
4
5
|
export { default as HIcons } from './src/Hoc/HIcons';
|
|
5
6
|
export { default as NetworkServiceCall } from './src/Common/NetworkServiceCall';
|
|
6
7
|
export * from './src/Navigation/useNavigation';
|
package/package.json
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { Animated, View, ViewStyle, StyleProp } from 'react-native';
|
|
3
|
+
|
|
4
|
+
interface ABlinkProps {
|
|
5
|
+
duration?: number;
|
|
6
|
+
repeat_count?: number;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface ABlinkState {
|
|
12
|
+
// No state needed, but keeping for consistency
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default class ABlink extends Component<ABlinkProps, ABlinkState> {
|
|
16
|
+
private fadeAnimation: Animated.Value;
|
|
17
|
+
|
|
18
|
+
constructor(props: ABlinkProps) {
|
|
19
|
+
super(props);
|
|
20
|
+
this.fadeAnimation = new Animated.Value(0);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
componentDidMount(): void {
|
|
24
|
+
const { duration = 1000, repeat_count = -1 } = this.props;
|
|
25
|
+
|
|
26
|
+
Animated.loop(
|
|
27
|
+
Animated.sequence([
|
|
28
|
+
Animated.timing(this.fadeAnimation, {
|
|
29
|
+
toValue: 0,
|
|
30
|
+
duration: duration,
|
|
31
|
+
useNativeDriver: true,
|
|
32
|
+
}),
|
|
33
|
+
Animated.timing(this.fadeAnimation, {
|
|
34
|
+
toValue: 1,
|
|
35
|
+
duration: duration,
|
|
36
|
+
useNativeDriver: true,
|
|
37
|
+
}),
|
|
38
|
+
]),
|
|
39
|
+
{
|
|
40
|
+
iterations: repeat_count,
|
|
41
|
+
}
|
|
42
|
+
).start();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
render(): React.JSX.Element {
|
|
46
|
+
const { style, children } = this.props;
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<View style={style}>
|
|
50
|
+
<Animated.View style={{ opacity: this.fadeAnimation }}>
|
|
51
|
+
{children}
|
|
52
|
+
</Animated.View>
|
|
53
|
+
</View>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|