Skip to content

Commit

Permalink
Practice
Browse files Browse the repository at this point in the history
  • Loading branch information
ByeonghoonJeon committed Aug 5, 2021
1 parent fc77e55 commit 84ef140
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
4 changes: 2 additions & 2 deletions react-pr2/public/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ body {
}

.circle-img {
border-radius: 25px;
border-radius: 100%;
border: 7px solid #fff;
width: 250px;
width: 120px;
height: 120px;
}

Expand Down
25 changes: 20 additions & 5 deletions react-pr2/src/components/App.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
import React from "react";
import Card from "./Card";
import contacts from "../contacts";

function App(props) {
function App() {
return (
<div>
<h1 className="heading">My Contacts</h1>
<Card name="Card.name" />
<img src="Card.imgURL" />
<Card phone="Card.phone" />
<Card email="Card.email" />
<Card
name={contacts[0].name}
img={contacts[0].imgURL}
phone={contacts[0].phone}
email={contacts[0].email}
/>
<Card
name={contacts[1].name}
img={contacts[1].imgURL}
phone={contacts[1].phone}
email={contacts[1].email}
/>
<Card
name={contacts[2].name}
img={contacts[2].imgURL}
phone={contacts[2].phone}
email={contacts[2].email}
/>
</div>
);
}
Expand Down
13 changes: 4 additions & 9 deletions react-pr2/src/components/Card.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import React from "react";
import contacts from "../contacts";

function Card(props) {
return (
<div className="card">
<div className="top">
<h2 className="name">{contacts.name}</h2>
<img
className="circle-img"
src="https://pbs.twimg.com/profile_images/625247595825246208/X3XLea04_400x400.jpg"
alt="avatar_img"
/>
<h2 className="name">{props.name}</h2>
<img className="circle-img" src={props.img} alt="avatar_img" />
</div>
<div className="bottom">
<p className="info">{contacts.phone}</p>
<p className="info">{contacts.email}</p>
<p className="info">{props.phone}</p>
<p className="info">{props.email}</p>
</div>
</div>
);
Expand Down

0 comments on commit 84ef140

Please sign in to comment.