|
|
@@ -1,54 +1,18 @@
|
|
|
-import React, { useEffect, useState } from "react";
|
|
|
-import PhoneInput from "../../../component/global/phone_input";
|
|
|
-import NumberInput from "../../../component/global/number_input";
|
|
|
-import DateModal from "../../../component/global/date_input";
|
|
|
-export default function Index() {
|
|
|
- /**********************************狀態管理**********************************/
|
|
|
- /**********************************狀態管理**********************************/
|
|
|
- /**********************************組件初始化**********************************/
|
|
|
- /**********************************組件初始化**********************************/
|
|
|
- /**********************************異步函數**********************************/
|
|
|
- /**********************************異步函數**********************************/
|
|
|
-
|
|
|
- //see if phone input is valid (enter at least 8 digits)
|
|
|
- const [phoneInputValidationStatus, setPhoneInputValidationStatus] = useState(false);
|
|
|
- const handleValidationStatus = (inputValidationStatus: boolean) => {
|
|
|
- setPhoneInputValidationStatus(inputValidationStatus);
|
|
|
- };
|
|
|
-
|
|
|
- //testing to see if parent component receives the value from child component
|
|
|
- const [phoneValue, setPhoneValue] = useState<string>("");
|
|
|
- const updateParentPhoneValue = (value: string) => {
|
|
|
- setPhoneValue(value);
|
|
|
- };
|
|
|
- const [numberValue, setNumberValue] = useState<string>("");
|
|
|
- const updateParentNumberValue = (value: string) => {
|
|
|
- setNumberValue(value);
|
|
|
- };
|
|
|
+import React from "react";
|
|
|
+import { Text } from "react-native";
|
|
|
|
|
|
- const [dateValue, setDateValue] = useState<string>("");
|
|
|
- const updateParentDateValue = (date: string) => {
|
|
|
- setDateValue(date);
|
|
|
- };
|
|
|
-
|
|
|
- //console loggin to see if parent component receives the value from child component
|
|
|
- useEffect(() => {
|
|
|
- console.log(`Received inputValidationStatus value: ${phoneInputValidationStatus}`);
|
|
|
- console.log(`Received phone value: ${phoneValue}`);
|
|
|
- console.log(`Received number value :${numberValue}`);
|
|
|
- console.log(`Received date value :${dateValue}`);
|
|
|
- }, [phoneValue, numberValue, dateValue]);
|
|
|
+export default function Index() {
|
|
|
+ /**********************************狀態管理**********************************/
|
|
|
+ /**********************************狀態管理**********************************/
|
|
|
+ /**********************************組件初始化**********************************/
|
|
|
+ /**********************************組件初始化**********************************/
|
|
|
+ /**********************************異步函數**********************************/
|
|
|
+ /**********************************異步函數**********************************/
|
|
|
|
|
|
- return (
|
|
|
- ////testing component here
|
|
|
- <>
|
|
|
- <PhoneInput
|
|
|
- placeholder="電話號碼"
|
|
|
- onChangeText={updateParentPhoneValue}
|
|
|
- onValidationStatusChange={handleValidationStatus}
|
|
|
- />
|
|
|
- <NumberInput placeholder="OTP驗證碼" onChangeText={updateParentNumberValue} />
|
|
|
- <DateModal onDateChange={updateParentDateValue} />
|
|
|
- </>
|
|
|
- );
|
|
|
+ return (
|
|
|
+ ////testing component here
|
|
|
+ <>
|
|
|
+ <Text>Test Here</Text>
|
|
|
+ </>
|
|
|
+ );
|
|
|
}
|