-
Notifications
You must be signed in to change notification settings - Fork 8
mission 1 complete #7
base: LEE-SOOWAN65
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <html> | ||
|
|
||
| <body> | ||
| <h1>최수민</h1> | ||
| <div>안녕하세요 저는 서강대학교의 컴퓨터공학과에 다니고 있습니다</div>안녕하세요 저는 서강대학교의 컴퓨터공학과에 다니고 있습니다</div> | ||
| <div>올해는 25살인데 내년에는 26이에요</div> | ||
| <div>지금 기분은 행복해요!</div> | ||
| <h2>좋아하는 동물</h2> | ||
| <li>사자</li> | ||
| <li>토끼</li> | ||
| <li>뱀</li> | ||
|
|
||
| <h1>이한길</h1> | ||
| <div>안녕하세요 저는 홍익대학교의 법학고에 다니고 있습니다.</div> | ||
| <div>올해는 29살인데 내년엔 30이에요.</div> | ||
| <div>지금 기분은 불행해요!</div> | ||
| <h2>좋아하는 동물</h2> | ||
| <li>펭귄</li> | ||
|
|
||
| <h1>김서영</h1> | ||
| <div>안녕하세요 저는 이화여자대학교의 사이버보안과에 다니고 있습니다.</div> | ||
| <div>올해는 22살인데 내년에는 23이에요</div> | ||
| <div>지금 기분은 불행해요!</div> | ||
| <h2>좋아하는 동물</h2> | ||
| <li>웜</li> | ||
| <li>트로이목마</li> | ||
|
|
||
| </body> | ||
|
|
||
| </html> | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,9 +1,35 @@ | ||||||
| import React, {Component} from 'react'; | ||||||
| import Profiles from "./Component/Profiles"; | ||||||
|
|
||||||
|
|
||||||
| class App extends Component { | ||||||
| constructor(props){ | ||||||
| super(props); | ||||||
| this.state = { | ||||||
| members : [ | ||||||
| {name:'최수민', school:'서강', major:'컴퓨터공학', | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
근데 이 안에 데이터가 많아지기 시작하면 한 줄에 쓰는 것 보다 줄을 나눠서 쓰는 게 더 보기 좋아요. |
||||||
| age:25, emotion:'행복',animal:['사자','토끼','뱀']}, //최수민 정보 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. age 를 숫자로 👏
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 모든 네이밍은 의도와 역할이 명확히 드러나도록 해주시는게 좋아요! |
||||||
|
|
||||||
| {name:'이한길', school:'홍익', major:'법학', | ||||||
| age:29, emotion:'불행',animal:['펭귄']}, //이한길 정보 | ||||||
|
|
||||||
| {name:'김서영', school:'이화여자', major:'사이버보안학', | ||||||
| age:22, emotion:'불행', animal:['웜','트로이목마']} //김서영 정보 | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| render() { | ||||||
| return <div className="App">Hello React!</div>; | ||||||
|
|
||||||
| return <div className="App"> | ||||||
|
|
||||||
| <Profiles data={this.state.members[0]}></Profiles> | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| <Profiles data={this.state.members[1]}></Profiles> | ||||||
| <Profiles data={this.state.members[2]}></Profiles> | ||||||
|
Comment on lines
+26
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 반복문을 이용해 보는 것은 어떨까요 ? |
||||||
|
|
||||||
| </div>; | ||||||
|
|
||||||
| } | ||||||
| } | ||||||
|
|
||||||
| export default App; | ||||||
| export default App; | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import React, { Component } from 'react'; | ||
|
|
||
| class Profiles extends Component { | ||
| render() { | ||
| var data = this.props.data; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 링크 를 보고 학습에 참고하면 좋을 것 같아요 ! 😁 |
||
| var lists = []; | ||
|
|
||
| var Animals = []; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 변수 네이밍 에 대하여 한번 읽어보세요 ~ |
||
| var i= 0; | ||
| while (i < data.animal.length) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. while 문 말고 for 문으로 바꿔보는 것은 어떨까요? |
||
| Animals.push(<li key={data.animal[i]}>{data.animal[i]}</li>); | ||
| i = i+ 1; | ||
| } | ||
|
|
||
| lists.push( | ||
| <div key={data.name}> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 어차피 1번만 push되기 때문에 굳이 lists 변수에 넣을 필요 없이 이 내용 그대로 return문에 써주시면 되세요! |
||
|
|
||
| <h1>{data.name}</h1> | ||
| <div>{`안녕하세요 저는 ${data.school}대학교의 ${data.major}과에 다니고 있습니다.`}</div> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. text는 p태그로 감싸주세요~ |
||
| <div>{`올해는 ${data.age}살인데 내년엔 ${(data.age)+1}예요.`}</div> | ||
| <div>{`지금 기분은 ${data.emotion}해요!`}</div> | ||
|
|
||
| <h3>좋아하는 동물</h3> | ||
| {Animals} | ||
|
|
||
| </div> | ||
| ); | ||
|
|
||
| return ( | ||
|
|
||
| <article> | ||
| {lists} | ||
| </article> | ||
| ); | ||
|
Comment on lines
+16
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 부분에 줄 바꾸기는 혹시 의도적이신가요? |
||
| } | ||
| } | ||
|
|
||
| export default Profiles; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 파일의 정체는 무엇일까요 ??