penambahan folder screens, styles dan navigation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import HomeView from "@/components/Home/HomeView";
|
||||
import HomeView from "@/screens/Home/HomeView";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Stack } from "expo-router";
|
||||
import React from "react";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import HomeView from "@/components/Home/HomeView";
|
||||
import { Styles } from "@/constants/global-styles";
|
||||
import HomeView from "@/screens/Home/HomeView";
|
||||
import { Styles } from "@/styles/global-styles";
|
||||
import { View } from "react-native";
|
||||
|
||||
export default function Application() {
|
||||
|
||||
@@ -1,80 +1,9 @@
|
||||
|
||||
import ButtonCustom from "@/components/_ShareComponent/Button/ButtonCustom";
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Styles } from "@/constants/global-styles";
|
||||
import { useRouter } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import PhoneInput, { ICountry } from "react-native-international-phone-number";
|
||||
import LoginView from "@/screens/Authentication/LoginView";
|
||||
|
||||
export default function Login() {
|
||||
const router = useRouter();
|
||||
|
||||
const [selectedCountry, setSelectedCountry] = useState<null | ICountry>(null);
|
||||
const [inputValue, setInputValue] = useState<string>("");
|
||||
|
||||
function handleInputValue(phoneNumber: string) {
|
||||
setInputValue(phoneNumber);
|
||||
}
|
||||
|
||||
function handleSelectedCountry(country: ICountry) {
|
||||
setSelectedCountry(country);
|
||||
}
|
||||
|
||||
function handleLogin() {
|
||||
const callingCode = selectedCountry?.callingCode.replace(/^\+/, "") || "";
|
||||
const fixNumber = callingCode + inputValue;
|
||||
console.log(fixNumber);
|
||||
router.push("/verification");
|
||||
}
|
||||
|
||||
return (
|
||||
<ViewWrapper withBackground>
|
||||
<View style={Styles.authContainer}>
|
||||
<View>
|
||||
<View style={Styles.authContainerTitle}>
|
||||
<Text style={Styles.authSubTitle}>WELCOME TO</Text>
|
||||
<Spacing height={5} />
|
||||
<Text style={Styles.authTitle}>HIPMI BADUNG APPS</Text>
|
||||
<Spacing height={5} />
|
||||
</View>
|
||||
<Spacing height={50} />
|
||||
<Text
|
||||
style={{
|
||||
position: "absolute",
|
||||
bottom: 30,
|
||||
right: 20,
|
||||
fontSize: 10,
|
||||
fontWeight: "thin",
|
||||
fontStyle: "italic",
|
||||
color: MainColor.white,
|
||||
}}
|
||||
>
|
||||
powered by muku.id
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
<PhoneInput
|
||||
value={inputValue}
|
||||
onChangePhoneNumber={handleInputValue}
|
||||
selectedCountry={selectedCountry}
|
||||
onChangeSelectedCountry={handleSelectedCountry}
|
||||
defaultCountry="ID"
|
||||
placeholder="Masukkan nomor"
|
||||
/>
|
||||
|
||||
<Spacing height={20} />
|
||||
|
||||
<ButtonCustom
|
||||
title="Login"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={handleLogin}
|
||||
/>
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
<>
|
||||
<LoginView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,55 +1,9 @@
|
||||
import ButtonCustom from "@/components/_ShareComponent/Button/ButtonCustom";
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { TextInputCustom } from "@/components/_ShareComponent/TextInput/TextInputCustom";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Styles } from "@/constants/global-styles";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
import { Text, View } from "react-native";
|
||||
import RegisterView from "@/screens/Authentication/RegisterView";
|
||||
|
||||
export default function Register() {
|
||||
return (
|
||||
<ViewWrapper withBackground>
|
||||
<View style={Styles.authContainer}>
|
||||
<View>
|
||||
<View style={Styles.authContainerTitle}>
|
||||
<Text style={Styles.authTitle}>REGISTRASI</Text>
|
||||
<Spacing />
|
||||
<MaterialCommunityIcons name="account" size={100} color={MainColor.yellow} />
|
||||
<Spacing />
|
||||
|
||||
<Text style={Styles.textLabel}>
|
||||
Anda akan terdaftar dengan nomor
|
||||
</Text>
|
||||
<Text style={Styles.textLabel}>+6282xxxxxxxxx</Text>
|
||||
<Spacing />
|
||||
</View>
|
||||
<TextInputCustom placeholder="Masukkan username" />
|
||||
|
||||
<ButtonCustom
|
||||
title="Daftar"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={() => (
|
||||
console.log("Success register"),
|
||||
router.push("/(application)/(tabs)")
|
||||
)}
|
||||
/>
|
||||
<Spacing />
|
||||
{/* <ButtonCustom
|
||||
title="Home"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={() => {
|
||||
console.log("Home clicked");
|
||||
router.push("/(application)/home");
|
||||
}}
|
||||
/> */}
|
||||
</View>
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
<>
|
||||
<RegisterView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,60 +1,9 @@
|
||||
import ButtonCustom from "@/components/_ShareComponent/Button/ButtonCustom";
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Styles } from "@/constants/global-styles";
|
||||
import { useRouter } from "expo-router";
|
||||
import { Text, View } from "react-native";
|
||||
import { OtpInput } from "react-native-otp-entry";
|
||||
import VerificationView from "@/screens/Authentication/VerificationView";
|
||||
|
||||
export default function Validasi() {
|
||||
const router = useRouter();
|
||||
export default function Verification() {
|
||||
return (
|
||||
<ViewWrapper withBackground>
|
||||
<View style={Styles.authContainer}>
|
||||
<View>
|
||||
<View style={Styles.authContainerTitle}>
|
||||
<Text style={Styles.authTitle}>Verifikasi KOde OTP</Text>
|
||||
<Spacing height={30} />
|
||||
<Text style={Styles.textLabel}>Masukan 4 digit kode otp</Text>
|
||||
<Text style={Styles.textLabel}>
|
||||
Yang di kirim ke +6282xxxxxxxxx
|
||||
</Text>
|
||||
<Spacing height={30} />
|
||||
<OtpInput
|
||||
numberOfDigits={4}
|
||||
theme={{
|
||||
pinCodeContainerStyle: {
|
||||
backgroundColor: MainColor.login,
|
||||
borderRadius: 10,
|
||||
borderWidth: 1,
|
||||
borderColor: MainColor.yellow,
|
||||
width: 60,
|
||||
height: 60,
|
||||
},
|
||||
containerStyle: {
|
||||
paddingLeft: 10,
|
||||
paddingRight: 10,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<Spacing height={30} />
|
||||
<Text style={Styles.textLabel}>
|
||||
Tidak menerima kode ?{" "}
|
||||
<Text style={Styles.textLabel}>Kirim Ulang</Text>
|
||||
</Text>
|
||||
</View>
|
||||
<Spacing height={30} />
|
||||
</View>
|
||||
|
||||
<ButtonCustom
|
||||
title="Verifikasi"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
radius={10}
|
||||
onPress={() => router.push("/register")}
|
||||
/>
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
<>
|
||||
<VerificationView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user