diff --git a/src/Components/GoogleLogin.js b/src/Components/GoogleLogin.js index d91190f..9ddfd29 100644 --- a/src/Components/GoogleLogin.js +++ b/src/Components/GoogleLogin.js @@ -90,6 +90,6 @@ const styles = StyleSheet.create({ width: width, marginLeft: 15, marginTop: 180, - resizeMode: "contain", + resizeMode: "contain", } }); diff --git a/src/Components/NaverLogin.js b/src/Components/NaverLogin.js index f8c62fa..4fdad83 100644 --- a/src/Components/NaverLogin.js +++ b/src/Components/NaverLogin.js @@ -29,8 +29,6 @@ export default function NaverLogin({ navigation }) { if (result.type === "success") { const code = result.params.code; state_value = result.params.state; - console.log(result); - console.log(code); //mutate({ // id_token: code, // provider: "NAVER", @@ -42,7 +40,6 @@ export default function NaverLogin({ navigation }) { const requestToken = async (request_code) => { var Access_Token = "none"; var request_token_url = `https://nid.naver.com/oauth2.0/token?`; - console.log("두 번째 함수 시작"); axios({ methos: "post", url: request_token_url, @@ -55,7 +52,6 @@ export default function NaverLogin({ navigation }) { }, }) .then(function (response) { - console.log("토큰 받기 함수 결과: ", response); Access_Token = response.data.access_token; //console.log(Access_Token); requestUserInfo(Access_Token); @@ -66,7 +62,6 @@ export default function NaverLogin({ navigation }) { }; const requestUserInfo = async (Access_Token) => { - console.log("세 번쨰 함수 시작"); axios({ method: "GET", url: "https://openapi.naver.com/v1/nid/me", @@ -75,7 +70,6 @@ export default function NaverLogin({ navigation }) { }, }) .then(async (response) => { - console.log("회원 프로필 조회 결과: ", response); await AsyncStorage.setItem( STORAGE_KEY, JSON.stringify(response.data.response.id) diff --git a/src/Data/data.js b/src/Data/data.js new file mode 100644 index 0000000..1601f9e --- /dev/null +++ b/src/Data/data.js @@ -0,0 +1,16 @@ +import { useState } from "react" + +export const folders = [ + { + id: 1, //각 폴더의 고유 id값 + text: "20230531", //각 폴더의 제목 string값 + }, + { + id: 2, + text: "20230602", + }, + { + id: 3, + text: "20230605", + }, + ] \ No newline at end of file diff --git a/src/Screen/HomePage.js b/src/Screen/HomePage.js index b29a9f7..8608d29 100644 --- a/src/Screen/HomePage.js +++ b/src/Screen/HomePage.js @@ -10,11 +10,16 @@ import { ScrollView, TextInput, FlatList, + Dimensions } from "react-native"; import { NavigationContainer } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { Fontisto, AntDesign } from "@expo/vector-icons"; +import { folders } from "../Data/data"; + +const { height, width } = Dimensions.get("window"); + function Home({ navigation }) { // 폰트 로드 const [isReady, setIsReady] = useState(false); @@ -31,29 +36,22 @@ function Home({ navigation }) { loadFonts(); }, []); +//-------------------------------------------------------------------------- +// Flatlist 정상 작동되는지 확인용 코드 + const [folder, setFolder] = useState(folders) + const [id_num, setId_num] = useState(4) + + function update_Folder(){ + const newfolder = { + id: id_num, + text: "20230707202020", + } + setFolder([...folder, newfolder]) + setId_num(id_num + 1) + } + console.log(folder); +//-------------------------------------------------------------------------- - const folders = [ - { - id: "1", //각 폴더의 고유 id값 - text: "20230531", //각 폴더의 제목 string값 - }, - { - id: "2", - text: "20230602", - }, - { - id: "3", - text: "20230605", - }, - { - id: "4", - text: "20230605", - }, - { - id: "5", - text: "20230605", - }, - ] const folder_components = ({ item }) => ( - + {item.text} @@ -79,12 +77,12 @@ function Home({ navigation }) { 📖오답노트📖 - + 폴더 추가하기 text.id } diff --git a/src/Screen/LoginPage.js b/src/Screen/LoginPage.js index c46d7c6..038259f 100644 --- a/src/Screen/LoginPage.js +++ b/src/Screen/LoginPage.js @@ -32,7 +32,7 @@ function Login({ navigation }) { const useInfo = await AsyncStorage.getItem(STORAGE_KEY); console.log(useInfo); if (useInfo != null) { - //navigation.navigate("Main_Home"); + navigation.navigate("Main_Home"); } };