-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUIButton.js
More file actions
80 lines (77 loc) · 2.04 KB
/
Copy pathUIButton.js
File metadata and controls
80 lines (77 loc) · 2.04 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
import React from "react";
import { Text, View, TouchableOpacity } from "react-native";
import { LinearGradient } from "expo-linear-gradient";
import { Icon } from "react-native-eva-icons";
export default function UIButton(props) {
const renderCover = () =>
props.type == "outline" ? (
<View
style={{
width: 195,
height: 45,
borderRadius: 22.5,
backgroundColor: global.dark ? global.backgroundColor : "white",
position: "absolute",
}}
/>
) : null;
const renderIcon = () =>
props.icon ? (
<Icon
name={props.icon}
fill={
props.type
? global.dark
? props.type == "white"
? global.accentColor
: "white"
: global.accentColor
: "white"
}
width={25}
height={25}
style={{ marginRight: 10 }}
/>
) : null;
return (
<View style={[{ marginTop: 20 }, props.style]}>
<TouchableOpacity onPress={props?.onPress}>
<LinearGradient
colors={
props.type == "white"
? ["white", "white"]
: [global.gradientColor1, global.gradientColor2]
}
start={[0, 1]}
end={[1, 0]}
style={{
width: 200,
height: 50,
borderRadius: 25,
alignItems: "center",
justifyContent: "center",
flexDirection: "row",
}}
>
{renderCover()}
{renderIcon()}
<Text
style={{
fontFamily: global.boldFontFamily,
fontSize: 15,
color: props.type
? global.dark
? props.type == "white"
? global.accentColor
: "white"
: global.accentColor
: "white",
}}
>
{props.text || "Button"}
</Text>
</LinearGradient>
</TouchableOpacity>
</View>
);
}