Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions .idea/awesome-react-student.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 126 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 30 additions & 11 deletions 3week/class/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion 3week/class/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ 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 Search from "./container/Search.js";
import Game from "./container/Game.js"
import ContentView from './component/contentView/ContentView.js';
import {Switch, Route } from 'react-router-dom'//router를 사용하기 위해서 react router dom 불러옵니다.


//router를 감싸고 있는 함수형 컴포넌트
const Main =()=>(//라우팅할때 url이 중복되는것을 막기 위해서 switch 사용
<Switch>
Expand All @@ -21,7 +24,8 @@ const Main =()=>(//라우팅할때 url이 중복되는것을 막기 위해서 sw
":이름"" 이렇게 설정하면 url을 /view/123, /view/555 라고 해도 ContetnView 컴포넌트를 렌더링하게됩니다.
*/}
<Route path="/view/:id" component={ContentView}></Route>

<Route path="/search" component={Search}></Route>
<Route path="/game" component={Game}></Route>
</Switch>
)

Expand Down
2 changes: 1 addition & 1 deletion 3week/class/src/component/contentList/ContentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ContentList extends Component {

//한줄에 4개의 콘텐츠를 출력 하기 위해서 컴포넌트를 구성해주는 함수
listRender() {
console.log(this.props.contents)
// console.log(this.props.contents)
var count = Math.ceil(this.props.contents.length/4)//현재 콘텐츠를 한줄에 4개씩 보여주면 몇줄이 나오는지를 구함
let component = [] //컴포넌트를 담을 배열 선언
for(let i =0;i<count;i++) {//반복문을 이용해서 한줄씩 컴포넌트를 만들어줌
Expand Down
22 changes: 17 additions & 5 deletions 3week/class/src/component/navbar/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,24 @@ class Navbar extends Component {

<div className="collapse navbar-collapse" id="navbarSupportedContent">
<ul className="navbar-nav mr-auto">
<li className="nav-item active">
{/*
Link 컴포넌트를 이용해 url을 "/"로 변경하고 홈 화면을 렌더링
*/}
<li className="nav-item active">
{/*
Link 컴포넌트를 이용해 url을 "/"로 변경하고 홈 화면을 렌더링
*/}
<Link className="nav-link" to="/">Home</Link>
</li>
</li>
<li className="nav-item active">
{/*
Link 컴포넌트를 이용해 url을 "/"로 변경하고 홈 화면을 렌더링
*/}
<Link className="nav-link" to="/search">Search</Link>
</li>
<li className="nav-item active">
{/*
Link 컴포넌트를 이용해 url을 "/"로 변경하고 홈 화면을 렌더링
*/}
<Link className="nav-link" to="/game">Game</Link>
</li>
</ul>
</div>
</nav>
Expand Down
Loading