신승민

Detail Update

......@@ -3,11 +3,15 @@ import { StyleSheet, Text, View } from "react-native";
import { createAppContainer } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
import MainScreen from "./Components/MainScreen";
import Detail from "./Components/AppTabNavigator/Detail"
// import MovieInfo from "./Components/MovieInfo";
const AppStackNavigator = createStackNavigator({
Main: {
screen: MainScreen // MainScreen 컴포넌트를 네비게이터에 등록
screen: MainScreen // MainScreen 컴포넌트를 네비게이터에 등록
},
Datail:{
screen: Detail
}
});
......
import React, { Component } from 'react';
import { View, Text, StyleSheet, Button } from 'react-native';
import { Icon } from 'native-base';
import { NavigationActions, createStackNavigator, withNavigation } from 'react-navigation';
import MovieRankingTab from './MovieRankingTab'
getDB = async search => {
axios
.get(
`https://api.themoviedb.org/3/search/movie?api_key=840724c8aa8b3b7c4ab68db53310cc9f&query=${search}&language=ko-KR&page=1`
)
.then(response => {
this.setState({ results: response.data.results });
console.log(response.data.results);
});
};
getNaverApi = async search => {
fetch(`https://openapi.naver.com/v1/search/movie.json?query="${search}"`, {
headers: {
"X-Naver-Client-Id": NAVER_CLIENT_ID,
"X-Naver-Client-Secret": NAVER_CLIENT_SECRET
}
})
.then(response => response.json())
.then(json => this.setState({ items: json.items }));
};
searching = typing => {
this.setState({
keyword: typing,
typing: ""
});
this.getDB(typing);
};
export default class Detail extends Component {
static navigationOptions = {
tabBarIcon: ({ tintColor }) => (
<Icon name="ios-albums" style={{ color: tintColor }} />
)
};
render() {
const { navigation } = this.props;
return (
<View style={style.container}>
<Text>
{navigation.getParam("name")}
</Text>
</View>
);
}
}
const style = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}
});
//export default withNavigation(Detail);
\ No newline at end of file
......@@ -12,12 +12,18 @@ import {
import { Icon } from "native-base";
import { AsyncStorage } from "react-native";
import axios from "axios";
import WantToWatchTab from "./WantToWatchTab";
const API_KEY = "2bf00f660b1a6a3ffeb6e06ac270cce3";
const NAVER_CLIENT_ID = "KqPsntd1hcPJ8FUPBGqN";
const NAVER_CLIENT_SECRET = "0GRb3uya1U";
//List 전역변수 선언하기
//list = "";
export default class MovieRankingTab extends Component {
state = {
list: "", //Add하고 싶은 정보 list
flag: false, //WantToWatchTab을 새로고침 할지 말지 여부
isLoading: true,
info: [],
date: "",
......@@ -195,6 +201,11 @@ export default class MovieRankingTab extends Component {
console.log(error);
});
};
printData = async (key) => {
value = await AsyncStorage.getItem(key);
console.log(value)
}
componentDidMount() {
var day = new Date().getDate() - 1; // 어제 날짜
if (day == 1) {
......@@ -206,15 +217,20 @@ export default class MovieRankingTab extends Component {
var year = new Date().getFullYear(); //Current Year
var date = year + "" + month + day;
this.getMovieList(date);
//this.printData('쥬만지: 넥스트 레벨')
}
//눌렀을 때 저장함수
_onPressButton(temp) {
//this.state.list = ""; //초기화(On Off 기능으로 짜놨습니당, 누적되는거 보고싶으면 이부분 주석달면 돼여)
Alert.alert(temp);//메시지 띄우고
this.state.list = this.state.list + '\n' + temp; //list 누적해준다(endl으로 구분)
console.log(this.state.list);//콘솔에 log 띄운다
AsyncStorage.setItem('MovieLists', this.state.list); //DB에 저장한다
Alert.alert(temp); //메시지 띄우고
AsyncStorage.setItem(temp, temp); //DB에 저장한다
//WantToWatchTab.render(); //새로고침
this.props.navigation.navigate('Detail', { name : temp})
}
render() {
......@@ -623,4 +639,4 @@ const style = StyleSheet.create({
fontSize: 14,
color: "white"
}
});
});
\ No newline at end of file
......
import React, { Component } from "react";
import { View, Text, StyleSheet } from "react-native";
import { View, Text, StyleSheet, Button } from "react-native";
import { Icon } from "native-base";
import { withNavigation } from 'react-navigation';
import { navigation, StackActions, NavigationActions } from 'react-navigation';
import 'react-native-gesture-handler'
import Detail from './Detail'
export default class SeenMovieTab extends Component {
static navigationOptions = {
......@@ -8,15 +12,18 @@ export default class SeenMovieTab extends Component {
<Icon name="ios-albums" style={{ color: tintColor }} />
)
};
render() {
return (
<View style={style.container}>
<Text>SeenMovieTab</Text>
<Button title = 'hi' onPress = { () => this.props.navigation.navigate('Detail')} />
</View>
);
}
}
const style = StyleSheet.create({
container: {
backgroundColor: "black",
......
import React from "react";
import { StyleSheet, Text, View, StatusBar } from "react-native";
export default function Loading() {
return (
<View style={styles.container}>
<StatusBar barStyle="dark-content" />
<Text style={styles.text}>Getting the current weather</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "flex-end",
paddingHorizontal: 30,
paddingVertical: 100,
backgroundColor: "#FDF6AA"
},
text: {
color: "#2c2c2c",
fontSize: 30
}
});
import React, { Component } from "react";
import { StyleSheet, Text, View, Button } from "react-native";
import { Icon } from "native-base"; // 추가된 코드
import { createAppContainer } from "react-navigation";
import { createStackNavigator } from "react-navigation-stack";
import { createMaterialTopTabNavigator } from "react-navigation-tabs";
......@@ -8,18 +7,27 @@ import SeenMovieTab from "./AppTabNavigator/MovieRankingTab";
import MovieRankingTab from "./AppTabNavigator/WantToWatchTab";
import WantToWatchTab from "./AppTabNavigator/SeenMovieTab";
import Search from ".//AppTabNavigator/Search";
import Detail from "./AppTabNavigator/Detail"
import { Platform } from "react-native";
import { black } from "ansi-colors";
import { colors } from "react-native-elements";
//import { Ionicons } from '@expo/vector-icons';
import { setRecoveryProps } from "expo/build/ErrorRecovery/ErrorRecovery";
state = {
hi:""
}
props = {
bye : ""
}
const AppTabNavigator = createMaterialTopTabNavigator(
{
SeenMovieTab: { screen: SeenMovieTab },
MovieRankingTab: { screen: MovieRankingTab },
WantToWatchTab: { screen: WantToWatchTab },
Search: { screen: Search }
SeenMovieTab:{ screen: SeenMovieTab },
MovieRankingTab:{ screen: MovieRankingTab },
WantToWatchTab:{ screen: WantToWatchTab },
Search: { screen: Search },
Detail: { screen: Detail }
},
{
animationEnabled: true,
swipeEnabled: true,
......@@ -44,6 +52,7 @@ const AppTabNavigator = createMaterialTopTabNavigator(
const AppTabContainet = createAppContainer(AppTabNavigator);
export default class MainScreen extends Component {
// navigationOptions 코드 추가
static navigationOptions = {
......@@ -69,4 +78,4 @@ const styles = StyleSheet.create({
alignItems: "center",
justifyContent: "center"
}
});
});
\ No newline at end of file
......
import React, { Component } from "react";
import { StyleSheet, Text, View, StatusBar } from "react-native";
export default class MovieRankingTab extends Component {
return() {
<View style={styles.container}>
<StatusBar barStyle="dark-content" />
<Text style={styles.text}>Getting the current weather</Text>
</View>;
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "flex-end",
paddingHorizontal: 30,
paddingVertical: 100,
backgroundColor: "#FDF6AA"
},
text: {
color: "#2c2c2c",
fontSize: 30
}
});
Arguments:
C:\Program Files\nodejs\node.exe C:\Users\1004n\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js add ract-navigation-stack --save
C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\yarn\bin\yarn.js add react-native-gesture-handler
PATH:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Git\cmd;C:\TmaxData\tibero6\bin;C:\TmaxData\tibero6\client\bin;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\sqlite;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\1004n\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Bandizip\;C:\Users\1004n\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\1004n\AppData\Roaming\npm;C:\TRV-Mars\flutter\bin;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.2\bin;C:\Users\1004n\AppData\Local\Android\Sdk\emulator;C:\Users\1004n\AppData\Local\Android\Sdk\platform-tools;C:\Users\1004n\AppData\Local\Android\Sdk\tools\bin;C:\Program Files\Java\jre1.8.0_231\bin;C:\Users\1004n\.android\avd;C:\Users\1004n\AppData\Local\atom\bin
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Samsung\SamsungLink\AllShare Framework DMS\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\TmaxData\tibero6\bin;C:\TmaxData\tibero6\client\bin;C:\Program Files\PuTTY\;C:\Users\SSM\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\SSM\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\SSM\AppData\Local\Programs\Python\Python37\;C:\Users\SSM\AppData\Local\Microsoft\WindowsApps;C:\intelFPGA\18.1\modelsim_ase\win32aloem;C:\Users\SSM\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\SSM\AppData\Roaming\npm;C:\Users\SSM\AppData\Roaming\nvm;C:\Program Files\nodejs
Yarn version:
1.21.0
1.19.2
Node version:
10.16.0
12.9.0
Platform:
win32 x64
Trace:
Error: https://registry.yarnpkg.com/ract-navigation-stack: Not found
at Request.params.callback [as _callback] (C:\Users\1004n\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:66938:18)
at Request.self.callback (C:\Users\1004n\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:140622:22)
at Request.emit (events.js:198:13)
at Request.<anonymous> (C:\Users\1004n\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:141594:10)
at Request.emit (events.js:198:13)
at IncomingMessage.<anonymous> (C:\Users\1004n\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:141516:12)
at Object.onceWrapper (events.js:286:20)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1129:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Error: EPERM: operation not permitted, unlink 'C:\Users\SSM\Desktop\open_proj\khuhub\pocketMovie\node_modules\@emotion\is-prop-valid\dist'
npm manifest:
{
"main": "node_modules/expo/AppEntry.js",
"rnpm": {
"assets": [
"./assets/fonts"
]
},
"scripts": {
"start": "expo start",
"android": "expo start --android",
......@@ -39,13 +34,14 @@ npm manifest:
"dependencies": {
"axios": "^0.19.0",
"expo": "^35.0.0",
"expo-font": "~7.0.0",
"native-base": "^2.13.8",
"react": "16.8.3",
"react-dom": "16.8.3",
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
"react-native-axios": "^0.17.1",
"react-native-elements": "^1.2.7",
"react-native-gesture-handler": "~1.3.0",
"react-native-gesture-handler": "^1.5.2",
"react-native-reanimated": "~1.2.0",
"react-native-screens": "~1.0.0-alpha.23",
"react-native-stack": "^1.0.0-alpha11",
......@@ -58,7 +54,8 @@ npm manifest:
"devDependencies": {
"babel-preset-expo": "^7.1.0"
},
"private": true
"private": true,
"version": "0.0.0"
}
yarn manifest:
......@@ -2793,6 +2790,11 @@ Lockfile:
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=
hammerjs@^2.0.8:
version "2.0.8"
resolved "https://registry.yarnpkg.com/hammerjs/-/hammerjs-2.0.8.tgz#04ef77862cff2bb79d30f7692095930222bf60f1"
integrity sha1-BO93hiz/K7edMPdpIJWTAiK/YPE=
har-schema@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
......@@ -4778,14 +4780,15 @@ Lockfile:
react-native-ratings "^6.3.0"
react-native-status-bar-height "^2.2.0"
react-native-gesture-handler@~1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.3.0.tgz#d0386f565928ccc1849537f03f2e37fd5f6ad43f"
integrity sha512-ASRFIXBuKRvqlmwkWJhV8yP2dTpvcqVrLNpd7FKVBFHYWr6SAxjGyO9Ik8w1lAxDhMlRP2IcJ9p9eq5X2WWeLQ==
react-native-gesture-handler@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.5.2.tgz#281111550bf1eee10b7feba5278d142169892731"
integrity sha512-Xp03dq4XYVTD0xmWx4DW4eX+ox1NQLjHmbykspTdS5FCNIVIOekVXRLFCw1698/v8dYUHApNo6K3s3BCD8fqPA==
dependencies:
hammerjs "^2.0.8"
hoist-non-react-statics "^2.3.1"
invariant "^2.2.2"
prop-types "^15.5.10"
invariant "^2.2.4"
prop-types "^15.7.2"
react-native-iphone-x-helper@^1.0.3:
version "1.2.1"
......