create-better-t-stack 3.1.8-canary.932e5243 → 3.1.8
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/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-EpWSiOd8.js → src-DeOVz-ZI.js} +13 -51
- package/package.json +1 -1
- package/templates/auth/better-auth/convex/backend/convex/auth.ts.hbs +2 -10
- package/templates/auth/better-auth/native/{base → native-base}/lib/auth-client.ts.hbs +2 -3
- package/templates/frontend/native/nativewind/app/(drawer)/index.tsx.hbs +100 -151
- package/templates/frontend/native/nativewind/app/_layout.tsx.hbs +0 -21
- package/templates/frontend/native/unistyles/app/(drawer)/index.tsx.hbs +91 -201
- package/templates/frontend/native/unistyles/app/_layout.tsx.hbs +0 -28
- package/templates/auth/better-auth/convex/native/base/lib/auth-client.ts.hbs +0 -19
- package/templates/auth/better-auth/convex/native/nativewind/components/sign-in.tsx.hbs +0 -86
- package/templates/auth/better-auth/convex/native/nativewind/components/sign-up.tsx.hbs +0 -97
- package/templates/auth/better-auth/convex/native/unistyles/components/sign-in.tsx.hbs +0 -127
- package/templates/auth/better-auth/convex/native/unistyles/components/sign-up.tsx.hbs +0 -145
- /package/templates/frontend/native/{base → native-base}/assets/images/android-icon-background.png +0 -0
- /package/templates/frontend/native/{base → native-base}/assets/images/android-icon-foreground.png +0 -0
- /package/templates/frontend/native/{base → native-base}/assets/images/android-icon-monochrome.png +0 -0
- /package/templates/frontend/native/{base → native-base}/assets/images/favicon.png +0 -0
- /package/templates/frontend/native/{base → native-base}/assets/images/icon.png +0 -0
- /package/templates/frontend/native/{base → native-base}/assets/images/partial-react-logo.png +0 -0
- /package/templates/frontend/native/{base → native-base}/assets/images/react-logo.png +0 -0
- /package/templates/frontend/native/{base → native-base}/assets/images/react-logo@2x.png +0 -0
- /package/templates/frontend/native/{base → native-base}/assets/images/react-logo@3x.png +0 -0
- /package/templates/frontend/native/{base → native-base}/assets/images/splash-icon.png +0 -0
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { authClient } from "@/lib/auth-client";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
ActivityIndicator,
|
|
5
|
-
Text,
|
|
6
|
-
TextInput,
|
|
7
|
-
TouchableOpacity,
|
|
8
|
-
View,
|
|
9
|
-
} from "react-native";
|
|
10
|
-
import { StyleSheet } from "react-native-unistyles";
|
|
11
|
-
|
|
12
|
-
export function SignIn() {
|
|
13
|
-
const [email, setEmail] = useState("");
|
|
14
|
-
const [password, setPassword] = useState("");
|
|
15
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
16
|
-
const [error, setError] = useState<string | null>(null);
|
|
17
|
-
|
|
18
|
-
const handleLogin = async () => {
|
|
19
|
-
setIsLoading(true);
|
|
20
|
-
setError(null);
|
|
21
|
-
|
|
22
|
-
await authClient.signIn.email(
|
|
23
|
-
{
|
|
24
|
-
email,
|
|
25
|
-
password,
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
onError: (error) => {
|
|
29
|
-
setError(error.error?.message || "Failed to sign in");
|
|
30
|
-
setIsLoading(false);
|
|
31
|
-
},
|
|
32
|
-
onSuccess: () => {
|
|
33
|
-
setEmail("");
|
|
34
|
-
setPassword("");
|
|
35
|
-
},
|
|
36
|
-
onFinished: () => {
|
|
37
|
-
setIsLoading(false);
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<View style={styles.container}>
|
|
45
|
-
<Text style={styles.title}>Sign In</Text>
|
|
46
|
-
|
|
47
|
-
{error && (
|
|
48
|
-
<View style={styles.errorContainer}>
|
|
49
|
-
<Text style={styles.errorText}>{error}</Text>
|
|
50
|
-
</View>
|
|
51
|
-
)}
|
|
52
|
-
|
|
53
|
-
<TextInput
|
|
54
|
-
style={styles.input}
|
|
55
|
-
placeholder="Email"
|
|
56
|
-
value={email}
|
|
57
|
-
onChangeText={setEmail}
|
|
58
|
-
keyboardType="email-address"
|
|
59
|
-
autoCapitalize="none"
|
|
60
|
-
/>
|
|
61
|
-
|
|
62
|
-
<TextInput
|
|
63
|
-
style={styles.input}
|
|
64
|
-
placeholder="Password"
|
|
65
|
-
value={password}
|
|
66
|
-
onChangeText={setPassword}
|
|
67
|
-
secureTextEntry
|
|
68
|
-
/>
|
|
69
|
-
|
|
70
|
-
<TouchableOpacity
|
|
71
|
-
onPress={handleLogin}
|
|
72
|
-
disabled={isLoading}
|
|
73
|
-
style={styles.button}
|
|
74
|
-
>
|
|
75
|
-
{isLoading ? (
|
|
76
|
-
<ActivityIndicator size="small" color="#fff" />
|
|
77
|
-
) : (
|
|
78
|
-
<Text style={styles.buttonText}>Sign In</Text>
|
|
79
|
-
)}
|
|
80
|
-
</TouchableOpacity>
|
|
81
|
-
</View>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const styles = StyleSheet.create((theme) => ({
|
|
86
|
-
container: {
|
|
87
|
-
marginTop: 24,
|
|
88
|
-
padding: 16,
|
|
89
|
-
borderRadius: 8,
|
|
90
|
-
borderWidth: 1,
|
|
91
|
-
borderColor: theme.colors.border,
|
|
92
|
-
},
|
|
93
|
-
title: {
|
|
94
|
-
fontSize: 18,
|
|
95
|
-
fontWeight: "600",
|
|
96
|
-
color: theme.colors.typography,
|
|
97
|
-
marginBottom: 16,
|
|
98
|
-
},
|
|
99
|
-
errorContainer: {
|
|
100
|
-
marginBottom: 16,
|
|
101
|
-
padding: 12,
|
|
102
|
-
borderRadius: 6,
|
|
103
|
-
},
|
|
104
|
-
errorText: {
|
|
105
|
-
color: theme.colors.destructive,
|
|
106
|
-
fontSize: 14,
|
|
107
|
-
},
|
|
108
|
-
input: {
|
|
109
|
-
marginBottom: 12,
|
|
110
|
-
padding: 16,
|
|
111
|
-
borderRadius: 6,
|
|
112
|
-
color: theme.colors.typography,
|
|
113
|
-
borderWidth: 1,
|
|
114
|
-
borderColor: theme.colors.border,
|
|
115
|
-
},
|
|
116
|
-
button: {
|
|
117
|
-
backgroundColor: theme.colors.primary,
|
|
118
|
-
padding: 16,
|
|
119
|
-
borderRadius: 6,
|
|
120
|
-
flexDirection: "row",
|
|
121
|
-
justifyContent: "center",
|
|
122
|
-
alignItems: "center",
|
|
123
|
-
},
|
|
124
|
-
buttonText: {
|
|
125
|
-
fontWeight: "500",
|
|
126
|
-
},
|
|
127
|
-
}));
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { authClient } from "@/lib/auth-client";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import {
|
|
4
|
-
ActivityIndicator,
|
|
5
|
-
Text,
|
|
6
|
-
TextInput,
|
|
7
|
-
TouchableOpacity,
|
|
8
|
-
View,
|
|
9
|
-
} from "react-native";
|
|
10
|
-
import { StyleSheet } from "react-native-unistyles";
|
|
11
|
-
|
|
12
|
-
export function SignUp() {
|
|
13
|
-
const [name, setName] = useState("");
|
|
14
|
-
const [email, setEmail] = useState("");
|
|
15
|
-
const [password, setPassword] = useState("");
|
|
16
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
17
|
-
const [error, setError] = useState<string | null>(null);
|
|
18
|
-
|
|
19
|
-
const handleSignUp = async () => {
|
|
20
|
-
setIsLoading(true);
|
|
21
|
-
setError(null);
|
|
22
|
-
|
|
23
|
-
await authClient.signUp.email(
|
|
24
|
-
{
|
|
25
|
-
name,
|
|
26
|
-
email,
|
|
27
|
-
password,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
onError: (error) => {
|
|
31
|
-
setError(error.error?.message || "Failed to sign up");
|
|
32
|
-
setIsLoading(false);
|
|
33
|
-
},
|
|
34
|
-
onSuccess: () => {
|
|
35
|
-
setName("");
|
|
36
|
-
setEmail("");
|
|
37
|
-
setPassword("");
|
|
38
|
-
},
|
|
39
|
-
onFinished: () => {
|
|
40
|
-
setIsLoading(false);
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<View style={styles.container}>
|
|
48
|
-
<Text style={styles.title}>Create Account</Text>
|
|
49
|
-
|
|
50
|
-
{error && (
|
|
51
|
-
<View style={styles.errorContainer}>
|
|
52
|
-
<Text style={styles.errorText}>{error}</Text>
|
|
53
|
-
</View>
|
|
54
|
-
)}
|
|
55
|
-
|
|
56
|
-
<TextInput
|
|
57
|
-
style={styles.input}
|
|
58
|
-
placeholder="Name"
|
|
59
|
-
value={name}
|
|
60
|
-
onChangeText={setName}
|
|
61
|
-
/>
|
|
62
|
-
|
|
63
|
-
<TextInput
|
|
64
|
-
style={styles.input}
|
|
65
|
-
placeholder="Email"
|
|
66
|
-
value={email}
|
|
67
|
-
onChangeText={setEmail}
|
|
68
|
-
keyboardType="email-address"
|
|
69
|
-
autoCapitalize="none"
|
|
70
|
-
/>
|
|
71
|
-
|
|
72
|
-
<TextInput
|
|
73
|
-
style={styles.inputLast}
|
|
74
|
-
placeholder="Password"
|
|
75
|
-
value={password}
|
|
76
|
-
onChangeText={setPassword}
|
|
77
|
-
secureTextEntry
|
|
78
|
-
/>
|
|
79
|
-
|
|
80
|
-
<TouchableOpacity
|
|
81
|
-
onPress={handleSignUp}
|
|
82
|
-
disabled={isLoading}
|
|
83
|
-
style={styles.button}
|
|
84
|
-
>
|
|
85
|
-
{isLoading ? (
|
|
86
|
-
<ActivityIndicator size="small" color="#fff" />
|
|
87
|
-
) : (
|
|
88
|
-
<Text style={styles.buttonText}>Sign Up</Text>
|
|
89
|
-
)}
|
|
90
|
-
</TouchableOpacity>
|
|
91
|
-
</View>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const styles = StyleSheet.create((theme) => ({
|
|
96
|
-
container: {
|
|
97
|
-
marginTop: 24,
|
|
98
|
-
padding: 16,
|
|
99
|
-
borderRadius: 8,
|
|
100
|
-
borderWidth: 1,
|
|
101
|
-
borderColor: theme.colors.border,
|
|
102
|
-
},
|
|
103
|
-
title: {
|
|
104
|
-
fontSize: 18,
|
|
105
|
-
fontWeight: "600",
|
|
106
|
-
color: theme.colors.typography,
|
|
107
|
-
marginBottom: 16,
|
|
108
|
-
},
|
|
109
|
-
errorContainer: {
|
|
110
|
-
marginBottom: 16,
|
|
111
|
-
padding: 12,
|
|
112
|
-
borderRadius: 6,
|
|
113
|
-
},
|
|
114
|
-
errorText: {
|
|
115
|
-
color: theme.colors.destructive,
|
|
116
|
-
fontSize: 14,
|
|
117
|
-
},
|
|
118
|
-
input: {
|
|
119
|
-
marginBottom: 12,
|
|
120
|
-
padding: 16,
|
|
121
|
-
borderRadius: 6,
|
|
122
|
-
color: theme.colors.typography,
|
|
123
|
-
borderWidth: 1,
|
|
124
|
-
borderColor: theme.colors.border,
|
|
125
|
-
},
|
|
126
|
-
inputLast: {
|
|
127
|
-
marginBottom: 16,
|
|
128
|
-
padding: 16,
|
|
129
|
-
borderRadius: 6,
|
|
130
|
-
color: theme.colors.typography,
|
|
131
|
-
borderWidth: 1,
|
|
132
|
-
borderColor: theme.colors.border,
|
|
133
|
-
},
|
|
134
|
-
button: {
|
|
135
|
-
backgroundColor: theme.colors.primary,
|
|
136
|
-
padding: 16,
|
|
137
|
-
borderRadius: 6,
|
|
138
|
-
flexDirection: "row",
|
|
139
|
-
justifyContent: "center",
|
|
140
|
-
alignItems: "center",
|
|
141
|
-
},
|
|
142
|
-
buttonText: {
|
|
143
|
-
fontWeight: "500",
|
|
144
|
-
},
|
|
145
|
-
}));
|
/package/templates/frontend/native/{base → native-base}/assets/images/android-icon-background.png
RENAMED
|
File without changes
|
/package/templates/frontend/native/{base → native-base}/assets/images/android-icon-foreground.png
RENAMED
|
File without changes
|
/package/templates/frontend/native/{base → native-base}/assets/images/android-icon-monochrome.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/frontend/native/{base → native-base}/assets/images/partial-react-logo.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|