diff --git a/.gitignore b/.gitignore index a8c3a9efb..49ced0b5a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # README.md # /assets # */node_modules +node_modules/ # dependencies diff --git a/4week/class/src/App.css b/4week/class/src/App.css old mode 100644 new mode 100755 index 92f956e80..c9fe3d57a --- a/4week/class/src/App.css +++ b/4week/class/src/App.css @@ -1,32 +1,22 @@ -.App { - text-align: center; -} - -.App-logo { - animation: App-logo-spin infinite 20s linear; - height: 40vmin; -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} +.App { + text-align: center; +} + +.App-logo { + height: 40vmin; +} + +.App-header { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; +} + +.App-link { + color: #09d3ac; +} diff --git a/4week/class/src/App.js b/4week/class/src/App.js old mode 100644 new mode 100755 index e3694889d..6515862c4 --- a/4week/class/src/App.js +++ b/4week/class/src/App.js @@ -1,42 +1,32 @@ -import React, { Component } from 'react'; -import logo from './logo.svg'; -import './App.css'; -import 'bootstrap/dist/css/bootstrap.min.css';//bootstrap css를 사용하기 위해서 불러옵니다. -import Navbar from './component/navbar/Navbar.js'; -import MainView from './container/MainView.js'; -import ContentView from './component/contentView/ContentView.js'; -import {Switch, Route } from 'react-router-dom'//router를 사용하기 위해서 react router dom 불러옵니다. -import Search from "./container/Search.js"; - -//router를 감싸고 있는 함수형 컴포넌트 -const Main =()=>(//라우팅할때 url이 중복되는것을 막기 위해서 switch 사용 - - {/* - "/" 을 가지는 /serach, /view/:id로 이동을 하면 "/"이 포함되어있기 때문에 MainView또한 렌더링이 됩니다. - 이것을 막기 위해서 exact속성을 추가 합니다. - */} - - {/* - "/view/:id"에 url이 이동했을때 ContentView 컴포넌트를 렌더링합니다. - 여기에서 ":id" 이 부분은 url에 변화가 필요할때 사용하는 방식 입니다. - ":이름"" 이렇게 설정하면 url을 /view/123, /view/555 라고 해도 ContetnView 컴포넌트를 렌더링하게됩니다. - */} - - - - ) - -class App extends Component { - render() { - return ( -
- {/* 네이게이션바 컴포넌트*/} - - {/* 라우터를 가지고 있는 컴포넌트*/} -
-
- ); - } -} - -export default App; +import React, { Component } from "react"; +import AddTodo from "./containers/AddTodo"; +import TodoList from "./containers/TodoList"; +import { connect } from "react-redux"; +import { addTodo } from "./modules/actions"; + +class App extends Component { + + render() { + return ( +
+ + +
+ ); + } +} +const mapDispatchToProps = dispatch => { + return { + addTodo: (todo,todos) => { + dispatch(addTodo(todo,todos)); + } + }; +}; + +const mapStateToProps = state => { + return { todos: state.todos }; +}; +export default connect( + mapStateToProps, + mapDispatchToProps +)(App); \ No newline at end of file diff --git a/4week/class/src/App.test.js b/4week/class/src/App.test.js old mode 100644 new mode 100755 index a754b201b..821c6d3f6 --- a/4week/class/src/App.test.js +++ b/4week/class/src/App.test.js @@ -1,9 +1,9 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; - -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); - ReactDOM.unmountComponentAtNode(div); -}); +import React from 'react'; +import ReactDOM from 'react-dom'; +import App from './App'; + +it('renders without crashing', () => { + const div = document.createElement('div'); + ReactDOM.render(, div); + ReactDOM.unmountComponentAtNode(div); +}); diff --git a/4week/class/src/component/content/Content.css b/4week/class/src/component/content/Content.css deleted file mode 100644 index 1f3a74fcd..000000000 --- a/4week/class/src/component/content/Content.css +++ /dev/null @@ -1,25 +0,0 @@ -.content { - position: relative; - z-index:111; - width:100%; -} - -.content:hover .thumbnail { - opacity: 0.3; -} - -.thumbnail { - width:100%; -} - -.middle { - position: absolute; - top: 35%; - left: 0; - z-index:10; -} - -.text { - color:white; - font-size:16px; -} \ No newline at end of file diff --git a/4week/class/src/component/content/Content.js b/4week/class/src/component/content/Content.js deleted file mode 100644 index 08014f4ed..000000000 --- a/4week/class/src/component/content/Content.js +++ /dev/null @@ -1,63 +0,0 @@ -import React, { Component } from 'react'; -import { NavLink } from 'react-router-dom'; -import "./Content.css"; -import PropTypes from "prop-types"; - -const ContentView = (props) => { - let url = "/view/"+props.id - return ( - {props.children} - ) - } - -const FullContentLink = (props) => { - return ( - {props.children} - ) - } - -class Content extends Component { - constructor(props) { - super(props); - - this.state = { - isShow: false - }; - } - - onHover = () => { - this.setState({isShow:true}) - } - - onUnHover = () => { - this.setState({isShow:false}) - } - - onChangeFullContent = () => { - this.props.onClick(this.props.content) - } - - displayImg = () => { - let imgSrc = "https://img.youtube.com/vi/"+this.props.content.id+"/0.jpg" - let imgComponent = (
{this.state.isShow?(
{this.props.content.name}
):""}
); - - return imgComponent - } - - - render() { - return ( -
this.onHover()} onMouseLeave={() => this.onUnHover()}> - {this.props.onClick? - ({this.displayImg()}): - ({this.displayImg()})} -
- ); - } -} -Content.propTypes = { - onClick : PropTypes.func, - content: PropTypes.object -} - -export default Content; diff --git a/4week/class/src/component/contentList/ContentList.css b/4week/class/src/component/contentList/ContentList.css deleted file mode 100644 index ba6aaf482..000000000 --- a/4week/class/src/component/contentList/ContentList.css +++ /dev/null @@ -1,16 +0,0 @@ -/*.col-md-3 { - flex :0 0 23% !important; - max-width: 23% !important; -} -*/ -.contentList { - margin-top:20px; - width:100%; - margin-right:0px; - margin-left:0px; -} - -.row { - margin-right:0px; - margin-left:0px; -} \ No newline at end of file diff --git a/4week/class/src/component/contentList/ContentList.js b/4week/class/src/component/contentList/ContentList.js deleted file mode 100644 index 58e796c2d..000000000 --- a/4week/class/src/component/contentList/ContentList.js +++ /dev/null @@ -1,68 +0,0 @@ -import React, { Component } from 'react'; -import './ContentList.css'; -import Content from "../content/Content.js" -import PropTypes from "prop-types"; - -//콘텐츠의 리스트를 보여주는 컴포넌트 -class ContentList extends Component { - - //한줄에 4개의 콘텐츠를 출력 하기 위해서 컴포넌트를 구성해주는 함수 - listRender() { - console.log(this.props.contents) - var count = Math.ceil(this.props.contents.length/4)//현재 콘텐츠를 한줄에 4개씩 보여주면 몇줄이 나오는지를 구함 - let component = [] //컴포넌트를 담을 배열 선언 - - for(let i =0;i - { - //위에서 4개의 데이터를 뽑아서 저장해 가지고 있던 배열을 map을 이용해서 4개의 콘텐츠를 그려준다. - dataPerRow.map((item,index) => { - return ( - // 반복문 안에서 jsx를 사용할때는 반드시 key를 써줘야 한다. - // col-md-3은 한 줄을 12등분 했을때 3칸만큼을 차지 하겠다는 의미이다. -
- {/* - 콘텐츠를 표현해주는 content component를 선언하는데 이때 onClick이벤트를 props로 넘겨준다. - 이 이벤트는 콘텐츠를 눌렀을때 상단의 실행되는 플레이어를 변경하는 이벤트 이다. - */} - -
- ) - }) - } - - ) - } - - return component - } - render() { - - - return ( -
- {/* - 리스트를 렌더링해주는 함수를 실행 시킨다. - */} - {this.listRender()} -
- ); - } -} - -ContentList.propTypes = { - contents: PropTypes.array, - onClick: PropTypes.func -} - -export default ContentList; diff --git a/4week/class/src/component/contentView/ContentView.css b/4week/class/src/component/contentView/ContentView.css deleted file mode 100644 index 16cfcd367..000000000 --- a/4week/class/src/component/contentView/ContentView.css +++ /dev/null @@ -1 +0,0 @@ -.content-view-iframe { height:55vw; } \ No newline at end of file diff --git a/4week/class/src/component/contentView/ContentView.js b/4week/class/src/component/contentView/ContentView.js deleted file mode 100644 index 97050ec30..000000000 --- a/4week/class/src/component/contentView/ContentView.js +++ /dev/null @@ -1,27 +0,0 @@ -import React, { Component } from 'react'; -import "./ContentView.css"; - -//영상 리스트를 눌렀을때 플레이어 화면만 보여주고 싶을때 사용하는 컴포넌트 -class ContentView extends Component { - render() { - - return ( -
- {/* - 유튜브를 실행 시키기 위해서는 iframe을 사용해야 하는데, 유튜브 api로 실행 시킬 주소를 받아와서 - iframe으로 실행 시킨다. - */} -