Skip to content

Commit 77ffe4e

Browse files
committed
new: Example with the login screen example is here
1 parent 39c56e1 commit 77ffe4e

File tree

2 files changed

+105
-13
lines changed

2 files changed

+105
-13
lines changed

example/App.tsx

Lines changed: 105 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,119 @@
99
*/
1010

1111
import React from "react";
12-
import { Alert, SafeAreaView } from "react-native";
12+
import {
13+
Alert,
14+
Text,
15+
View,
16+
TouchableOpacity,
17+
Image,
18+
Dimensions,
19+
SafeAreaView,
20+
} from "react-native";
1321
import InteractiveTextInput from "./lib/InteractiveTextInput";
1422

23+
const { width: ScreenWidth } = Dimensions.get("screen");
24+
1525
const App = () => {
26+
const renderHeader = () => (
27+
<View style={{ marginTop: 24 }}>
28+
<Text style={{ color: "#2a41cb", fontWeight: "bold", fontSize: 32 }}>
29+
Welcome Back 👋
30+
</Text>
31+
<Text style={{ color: "#8e9496", letterSpacing: 1, marginTop: 8 }}>
32+
I am so happy to see you. You can continue to login for manage your
33+
finance
34+
</Text>
35+
</View>
36+
);
37+
38+
const renderTextInputs = () => (
39+
<View style={{ marginTop: 52 }}>
40+
<InteractiveTextInput textInputStyle={{ width: ScreenWidth * 0.88 }} />
41+
<View
42+
style={{
43+
marginTop: 24,
44+
flexDirection: "row",
45+
alignItems: "center",
46+
justifyContent: "space-between",
47+
}}
48+
>
49+
<InteractiveTextInput
50+
placeholder="Password"
51+
secureTextEntry
52+
enableIcon
53+
textInputStyle={{ width: ScreenWidth * 0.7 }}
54+
iconImageSource={require("./assets/visibility-button.png")}
55+
onIconPress={() => {}}
56+
/>
57+
<TouchableOpacity
58+
style={{
59+
height: 50,
60+
width: 50,
61+
alignItems: "center",
62+
justifyContent: "center",
63+
borderColor: "#2a41cb",
64+
borderWidth: 1,
65+
borderRadius: 8,
66+
}}
67+
>
68+
<Image
69+
source={require("./assets/fingerprint.png")}
70+
style={{ height: 25, width: 25, tintColor: "#2a41cb" }}
71+
/>
72+
</TouchableOpacity>
73+
</View>
74+
<TouchableOpacity style={{ marginLeft: "auto", marginTop: 16 }}>
75+
<Text style={{ color: "#2a41cb", fontWeight: "500" }}>
76+
Forgot Password?
77+
</Text>
78+
</TouchableOpacity>
79+
</View>
80+
);
81+
82+
const renderLoginButton = () => (
83+
<TouchableOpacity
84+
style={{
85+
height: 50,
86+
width: ScreenWidth * 0.88,
87+
backgroundColor: "#2a41cb",
88+
marginTop: ScreenWidth * 0.5,
89+
borderRadius: 12,
90+
alignItems: "center",
91+
justifyContent: "center",
92+
shadowRadius: 8,
93+
shadowOpacity: 0.3,
94+
shadowColor: "#2a41cb",
95+
shadowOffset: {
96+
width: 0,
97+
height: 5,
98+
},
99+
}}
100+
>
101+
<Text style={{ fontWeight: "bold", color: "#fff" }}>Login</Text>
102+
</TouchableOpacity>
103+
);
104+
105+
const renderDontHaveAccountButton = () => (
106+
<TouchableOpacity
107+
style={{ marginTop: ScreenWidth * 0.4, alignItems: "center" }}
108+
>
109+
<Text style={{ fontWeight: "700" }}>Don't have an account</Text>
110+
</TouchableOpacity>
111+
);
112+
16113
return (
17114
<SafeAreaView
18115
style={{
19-
height: 300,
20-
alignItems: "center",
21-
justifyContent: "space-evenly",
116+
flex: 1,
117+
marginLeft: 24,
118+
marginRight: 24,
22119
}}
23120
>
24-
<InteractiveTextInput mainColor="red" />
25-
<InteractiveTextInput
26-
placeholder="Password"
27-
secureTextEntry
28-
enableIcon
29-
iconImageSource={require("./assets/visibility-button.png")}
30-
onIconPress={() => Alert.alert("hello", "hello")}
31-
/>
32-
<InteractiveTextInput />
121+
{renderHeader()}
122+
{renderTextInputs()}
123+
{renderLoginButton()}
124+
{renderDontHaveAccountButton()}
33125
</SafeAreaView>
34126
);
35127
};

example/assets/fingerprint.png

5.87 KB
Loading

0 commit comments

Comments
 (0)