Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이혜연
/
Make_your_own_ chatbot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hyeyeon-sun
2020-06-13 21:05:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1ac285e81d097a3c2b8536b75c5e1cb580c9be73
1ac285e8
1 parent
2a0748f4
customer component structured
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
12 deletions
management/src/App.js
management/src/components/Customer.js
management/src/App.js
View file @
1ac285e
...
...
@@ -2,22 +2,44 @@ import React, { Component } from 'react';
import
'./App.css'
;
import
Customer
from
'./components/Customer'
const
customer
=
{
const
customers
=
[
{
'id'
:
1
,
'image'
:
'https://placeimg.com/64/64/any'
,
'name'
:
'이혜연'
,
'birthday'
:
'000416'
,
'gender'
:
'여자'
,
'job'
:
'대학생'
}
},
{
'id'
:
2
,
'image'
:
'https://placeimg.com/64/64/2'
,
'name'
:
'김다은'
,
'birthday'
:
'000101'
,
'gender'
:
'여자'
,
'job'
:
'재수생'
},
{
'id'
:
3
,
'image'
:
'https://placeimg.com/64/64/3'
,
'name'
:
'김석희'
,
'birthday'
:
'900103'
,
'gender'
:
'남자'
,
'job'
:
'회사원'
},
]
class
App
extends
Component
{
render
()
{
return
(
<
Customer
name
=
{
customer
.
name
}
birthday
=
{
customer
.
birthday
}
gender
=
{
customer
.
gender
}
job
=
{
customer
.
job
}
/
>
<
div
>
{
customers
.
map
(
c
=>
{
return
(
<
Customer
key
=
{
c
.
id
}
id
=
{
c
.
id
}
image
=
{
c
.
image
}
name
=
{
c
.
name
}
birthday
=
{
c
.
birthday
}
gender
=
{
c
.
gender
}
job
=
{
c
.
job
}
/
>
)
})
}
<
/div
>
);
}
}
...
...
management/src/components/Customer.js
View file @
1ac285e
...
...
@@ -3,14 +3,36 @@ import React from 'react';
class
Customer
extends
React
.
Component
{
render
(){
return
(
<
div
>
<
CustomerProfile
id
=
{
this
.
props
.
id
}
image
=
{
this
.
props
.
image
}
name
=
{
this
.
props
.
name
}
/
>
<
CustomerInfo
birthday
=
{
this
.
props
.
birthday
}
gender
=
{
this
.
props
.
gender
}
job
=
{
this
.
props
.
job
}
/
>
<
/div
>
);
}
}
class
CustomerProfile
extends
React
.
Component
{
render
(){
return
(
<
div
>
<
h2
>
{
this
.
props
.
name
}
<
/h2
>
<
p
>
{
this
.
props
.
birthday
}
<
/p
>
<
p
>
{
this
.
props
.
gender
}
<
/p
>
<
p
>
{
this
.
props
.
job
}
<
/p
>
<
img
src
=
{
this
.
props
.
image
}
alt
=
"profile"
/>
<
h2
>
{
this
.
props
.
name
}({
this
.
props
.
id
})
<
/h2
>
<
/div
>
);
}
}
class
CustomerInfo
extends
React
.
Component
{
render
()
{
return
(
<
div
>
<
p
>
{
this
.
props
.
birthday
}
<
/p
>
<
p
>
{
this
.
props
.
gender
}
<
/p
>
<
p
>
{
this
.
props
.
job
}
<
/p
>
<
/div
>
)
}
}
...
...
Please
register
or
login
to post a comment