loginPage.tsx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. type LoginPageProps = {
  7. goToNextPage: () => void;
  8. };
  9. const LoginPage: React.FC<LoginPageProps> = ({ goToNextPage }) => {
  10. return (
  11. <>
  12. <View style={styles.container}>
  13. <View style={styles.topContainerForLogo}>
  14. <Logo />
  15. </View>
  16. <View style={styles.bottomContainer}>
  17. <PhoneInput
  18. placeholder="電話號碼"
  19. handleFormDataChange={(field, value) => console.log(`${field}: ${value}`)}
  20. extendedStyle={{ borderRadius: 12, padding: 20 }}
  21. />
  22. <NormalInput
  23. placeholder="密碼"
  24. onChangeText={(password) => console.log(password)}
  25. secureTextEntry={true}
  26. extendedStyle={{ borderRadius: 12, padding: 20 }}
  27. />
  28. <Pressable>
  29. <Text style={styles.text}>忘記密碼</Text>
  30. </Pressable>
  31. <NormalButton
  32. onPress={() => console.log("登入")}
  33. title={<Text style={{ fontWeight: "700", fontSize: 20, color: "#fff" }}>登入</Text>}
  34. />
  35. <Pressable onPress={goToNextPage}>
  36. <Text style={styles.text}>註冊會員</Text>
  37. </Pressable>
  38. </View>
  39. </View>
  40. </>
  41. );
  42. };
  43. const styles = StyleSheet.create({
  44. container: {
  45. flex: 1,
  46. gap: 50,
  47. marginHorizontal: 20,
  48. },
  49. topContainerForLogo: {
  50. flex: 1 / 2,
  51. },
  52. bottomContainer: {
  53. flex: 1,
  54. gap: 10,
  55. },
  56. text: {
  57. color: "#02677D",
  58. fontSize: 16,
  59. paddingVertical: 5,
  60. },
  61. });
  62. export default LoginPage;