loginPage.tsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import { View, Text, StyleSheet, Pressable } from "react-native";
  2. import NormalButton from "../../../global/normal_button";
  3. import Logo from "../../../global/logo";
  4. import PhoneInput from "../../../global/phone_input";
  5. import NormalInput from "../../../global/normal_input";
  6. import { useState } from "react";
  7. type LoginPageProps = {
  8. goToNextPage: () => void;
  9. };
  10. const LoginPage: React.FC<LoginPageProps> = ({ goToNextPage }) => {
  11. const [loginPhone, setLoginPhone] = useState(""); //This loginPhone useState is only a placeholder, will be updated in the future
  12. return (
  13. <>
  14. <View style={styles.container}>
  15. <View style={styles.topContainerForLogo}>
  16. <Logo />
  17. </View>
  18. <View style={styles.bottomContainer}>
  19. <PhoneInput
  20. value={loginPhone}
  21. onChangeText={(t) => {
  22. setLoginPhone(t);
  23. console.log(loginPhone);
  24. }}
  25. placeholder="電話號碼"
  26. extendedStyle={{ borderRadius: 12, padding: 20 }}
  27. />
  28. <NormalInput
  29. placeholder="密碼"
  30. onChangeText={(password) => console.log(password)}
  31. secureTextEntry={true}
  32. extendedStyle={{ borderRadius: 12, padding: 20 }}
  33. />
  34. <Pressable>
  35. <Text style={styles.text}>忘記密碼</Text>
  36. </Pressable>
  37. <NormalButton
  38. onPress={() => console.log("登入")}
  39. title={<Text style={{ fontWeight: "700", fontSize: 20, color: "#fff" }}>登入</Text>}
  40. />
  41. <Pressable onPress={goToNextPage}>
  42. <Text style={styles.text}>註冊會員</Text>
  43. </Pressable>
  44. </View>
  45. </View>
  46. </>
  47. );
  48. };
  49. const styles = StyleSheet.create({
  50. container: {
  51. flex: 1,
  52. gap: 50,
  53. marginHorizontal: 20,
  54. },
  55. topContainerForLogo: {
  56. flex: 1 / 2,
  57. },
  58. bottomContainer: {
  59. flex: 1,
  60. gap: 10,
  61. },
  62. text: {
  63. color: "#02677D",
  64. fontSize: 16,
  65. paddingVertical: 5,
  66. },
  67. });
  68. export default LoginPage;