Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added reset password screen #377

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ npm-debug.*
*.mobileprovision
*.orig.*
web-build/
package-lock.json

# macOS
.DS_Store
Expand Down
26 changes: 25 additions & 1 deletion apps/native/app/(auth)/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import {
Platform,
ScrollView,
} from "react-native";
import { router } from "expo-router";
import { router, Link } from "expo-router";
import CustomTextInput from "@/components/ui/common/CustomTextInput";
import CustomTitle from "@/components/ui/common/CustomTitle";
import CustomSubmitButton from "@/components/ui/common/CustomSubmitButton";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { ThemedText } from "@/components/ThemedText";

const LoginScreen = () => {
const [email, setEmail] = useState("");
Expand Down Expand Up @@ -64,6 +65,20 @@ const LoginScreen = () => {
]}
/>
</View>

<View>
<ThemedText type="title" darkColor="dark" style={[styles.commonText]}>
Forgot password?{" "}
<Link replace href="/reset">
<ThemedText
type="link"
darkColor="green"
style={[styles.commonText, styles.resetText]}>
Reset
</ThemedText>
</Link>
</ThemedText>
</View>
</ScrollView>
</KeyboardAvoidingView>
);
Expand Down Expand Up @@ -104,6 +119,15 @@ const styles = StyleSheet.create({
fontWeight: "bold",
color: "white",
},
commonText: {
textAlign: "center",
color: "#222629DE",
fontSize: 19,
},
resetText: {
color: "#61892F",
fontWeight: "bold",
},
});

export default LoginScreen;
115 changes: 115 additions & 0 deletions apps/native/app/(auth)/reset.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import React, { useState } from "react";
import {
View,
StyleSheet,
KeyboardAvoidingView,
Platform,
ScrollView,
} from "react-native";
import { Link } from "expo-router";
import CustomTextInput from "@/components/ui/common/CustomTextInput";
import CustomSubmitButton from "@/components/ui/common/CustomSubmitButton";
import { ThemedText } from "@/components/ThemedText";
import { Feather } from "@expo/vector-icons";

const ResetPasswordScreen = () => {
const [email, setEmail] = useState("");
const isLoginEnabled = email.length > 0;

const handleReset = () => {};

return (
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : "height"}
style={styles.keyboardContainer}>
<View style={styles.iconContainer}>
<Link replace href="/login">
<Feather name="arrow-left" size={28} color={"#2226298F"} />
</Link>
</View>

<ScrollView contentContainerStyle={styles.scrollContainer}>
<ThemedText type="title" style={[styles.titleText]} darkColor="dark">
Forgot your password?
</ThemedText>
<ThemedText type="default" style={[styles.commonText]} darkColor="dark">
Confirm your email and we'll send you a link to create a brand new
password.
</ThemedText>
<CustomTextInput
label="Email"
placeholder="Enter your email"
value={email}
onChangeText={setEmail}
keyboardType="email-address"
error={false}
/>

<View style={styles.buttonContainer}>
<CustomSubmitButton
title="SEND THE LINK"
onPress={handleReset}
disabled={isLoginEnabled}
style={
(isLoginEnabled ? styles.buttonActive : styles.buttonDisabled,
[{ textTransform: "uppercase" }])
}
/>
</View>
</ScrollView>
</KeyboardAvoidingView>
);
};

const styles = StyleSheet.create({
container: {
backgroundColor: "white",
},
iconContainer: {
paddingHorizontal: 20,
paddingVertical: 20,
},
keyboardContainer: {
flex: 1,
},
scrollContainer: {
flex: 1,
justifyContent: "center",
paddingHorizontal: 20,
},

buttonContainer: {
paddingVertical: 13,
alignItems: "center",
},
buttonActive: {
backgroundColor: "#61892F",
paddingVertical: 15,
width: "100%",
alignItems: "center",
},
buttonDisabled: {
backgroundColor: "gray",
opacity: 0.5,
paddingVertical: 15,
width: "100%",
alignItems: "center",
},
buttonText: {
fontSize: 18,
fontWeight: "bold",
color: "white",
},
titleText: {
color: "#222629DE",
fontSize: 32,
fontWeight: "bold",
marginVertical: 16,
},
commonText: {
color: "#222629DE",
fontSize: 18,
},
});

export default ResetPasswordScreen;
Loading
Loading