-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOldWithCode.js
More file actions
96 lines (91 loc) · 2.11 KB
/
OldWithCode.js
File metadata and controls
96 lines (91 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import React, { Component } from "react";
import { StyleSheet, View, Animated, Text, TouchableWithoutFeedback } from "react-native";
// import { MaterialCommunityIcons as Icon } from "@expo/vector-icons";
export default class animations extends Component {
state = {
animation: new Animated.Value(0),
};
toggleOpen = () => {
if (this._open) {
Animated.timing(this.state.animation, {
toValue: 0,
duration: 300,
}).start();
} else {
Animated.timing(this.state.animation, {
toValue: 1,
duration: 300,
}).start();
}
this._open = !this._open;
};
render() {
const scaleInterpolate = this.state.animation.interpolate({
inputRange: [0, 1],
outputRange: [0, 30],
});
const bgStyle = {
transform: [
{
scale: scaleInterpolate,
},
],
};
return (
<View style={styles.container}>
<Animated.View style={[styles.background, bgStyle]} >
<Text title='ssss'></Text>
</Animated.View>
<TouchableWithoutFeedback onPress={this.toggleOpen}>
<View style={[styles.button, styles.pay]}>
{/* <Animated.Text style={[styles.label, labelStyle]}>Pay</Animated.Text> */}
<Text style={styles.payText}>$5.00</Text>
</View>
</TouchableWithoutFeedback>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
background: {
backgroundColor: "green",
position: "absolute",
width: 60,
height: 60,
bottom: 20,
right: 20,
borderRadius: 30,
},
button: {
width: 60,
height: 60,
alignItems: "center",
justifyContent: "center",
shadowColor: "#333",
shadowOpacity: 0.1,
shadowOffset: { x: 2, y: 0 },
shadowRadius: 2,
borderRadius: 30,
position: "absolute",
bottom: 20,
right: 20,
},
other: {
backgroundColor: "#FFF",
},
payText: {
color: "#FFF",
},
pay: {
backgroundColor: "#00B15E",
},
label: {
color: "#FFF",
position: "absolute",
fontSize: 18,
backgroundColor: "transparent",
},
});