Skip to content
This repository was archived by the owner on Sep 19, 2021. It is now read-only.

mission 1 complete#7

Open
LEE-SOOWAN65 wants to merge 1 commit intoCEOS-Developers:LEE-SOOWAN65from
LEE-SOOWAN65:soowan
Open

mission 1 complete#7
LEE-SOOWAN65 wants to merge 1 commit intoCEOS-Developers:LEE-SOOWAN65from
LEE-SOOWAN65:soowan

Conversation

@LEE-SOOWAN65
Copy link
Copy Markdown

No description provided.

@MrKwon MrKwon self-assigned this Oct 5, 2019
@MrKwon MrKwon changed the base branch from master to LEE-SOOWAN65 October 5, 2019 14:41
Copy link
Copy Markdown

@MrKwon MrKwon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 수완님, 리뷰어 민철입니다 🤠
리뷰가 조금 늦었네요. 😂
전체적으로 미션 잘 구현해주셨습니다.
추가적으로 필요한 부분에 대하여 코멘트 남겨두었으니 확인해주세요.
내일 스터디에서 보아요~

Comment thread public/pureprofile.html
@@ -0,0 +1,30 @@
<html>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 파일의 정체는 무엇일까요 ??

Comment thread src/App.js
super(props);
this.state = {
members : [
{name:'최수민', school:'서강', major:'컴퓨터공학',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ key: value } 형식으로 만든 객체를 JSON(JavaScript Object Notation) 이라고 해요.
JSON 위키 백과 링크인데 학습에 참고하시면 좋을 것 같아요.

근데 이 안에 데이터가 많아지기 시작하면 한 줄에 쓰는 것 보다 줄을 나눠서 쓰는 게 더 보기 좋아요.
자바스크립트 스타일 가이드 인데 여기 중간에 보시면 Object Rules 라는 소제목 부분을 보면 짧은 객체들은 한 줄로 압축해서 표현해도 되지만 길어지면 줄을 나눠서 표기하는 것을 추천(?)하고 있네요 😂

Comment thread src/App.js
this.state = {
members : [
{name:'최수민', school:'서강', major:'컴퓨터공학',
age:25, emotion:'행복',animal:['사자','토끼','뱀']}, //최수민 정보
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

age 를 숫자로 👏

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모든 네이밍은 의도와 역할이 명확히 드러나도록 해주시는게 좋아요!
ex) animal -> favoriteAnimalList

Comment thread src/App.js
Comment on lines +26 to +28
<Profiles data={this.state.members[0]}></Profiles>
<Profiles data={this.state.members[1]}></Profiles>
<Profiles data={this.state.members[2]}></Profiles>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반복문을 이용해 보는 것은 어떨까요 ?

Comment thread src/Component/Profiles.js

class Profiles extends Component {
render() {
var data = this.props.data;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

링크 를 보고 학습에 참고하면 좋을 것 같아요 ! 😁

Comment thread src/Component/Profiles.js
var data = this.props.data;
var lists = [];

var Animals = [];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변수 네이밍 에 대하여 한번 읽어보세요 ~

Comment thread src/Component/Profiles.js

var Animals = [];
var i= 0;
while (i < data.animal.length) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while 문 말고 for 문으로 바꿔보는 것은 어떨까요?

Comment thread src/Component/Profiles.js
Comment on lines +16 to +34
<div key={data.name}>

<h1>{data.name}</h1>
<div>{`안녕하세요 저는 ${data.school}대학교의 ${data.major}과에 다니고 있습니다.`}</div>
<div>{`올해는 ${data.age}살인데 내년엔 ${(data.age)+1}예요.`}</div>
<div>{`지금 기분은 ${data.emotion}해요!`}</div>

<h3>좋아하는 동물</h3>
{Animals}

</div>
);

return (

<article>
{lists}
</article>
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분에 줄 바꾸기는 혹시 의도적이신가요?
불필요한 줄 바꿈을 없애서 조금 더 보기 좋게 만들어 볼까요?

Copy link
Copy Markdown
Member

@greatSumini greatSumini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생 많으셨습니다. 또 첫 PR 축하해요! 다음부턴 PR템플릿을 지켜주세요 😂
리뷰 반영 후 커밋부탁드립니다 :)

Comment thread src/App.js

return <div className="App">

<Profiles data={this.state.members[0]}></Profiles>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Profiles data={this.state.members[0]}></Profiles>
<Profile data={this.state.members[0]}/>
  1. 1명에 대한 정보만 담고있으니 Profile이라는 네이밍이 더 적절할 것 같아요!
  2. children이 없는 경우 self closing으로 작성해주세요~ 참고

Comment thread src/App.js
this.state = {
members : [
{name:'최수민', school:'서강', major:'컴퓨터공학',
age:25, emotion:'행복',animal:['사자','토끼','뱀']}, //최수민 정보
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모든 네이밍은 의도와 역할이 명확히 드러나도록 해주시는게 좋아요!
ex) animal -> favoriteAnimalList

Comment thread src/Component/Profiles.js
}

lists.push(
<div key={data.name}>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어차피 1번만 push되기 때문에 굳이 lists 변수에 넣을 필요 없이 이 내용 그대로 return문에 써주시면 되세요!

Comment thread src/Component/Profiles.js
<div key={data.name}>

<h1>{data.name}</h1>
<div>{`안녕하세요 저는 ${data.school}대학교의 ${data.major}과에 다니고 있습니다.`}</div>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text는 p태그로 감싸주세요~

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants