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 485a354 commit fc77e55
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
17 changes: 6 additions & 11 deletions react-pr2/src/components/App.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import React from "react";
import Contacts from "contacts";
import Card from "./Card";

function App(props) {
return (
<div>
<h1 className="heading">My Contacts</h1>
<div className="card">
<div className="top">
<h2 className="name">{Contacts.name}</h2>
<img className="circle-img" src={Contacts.imgURL} alt="avatar_img" />
</div>
<div className="bottom">
<p className="info">{Contacts.phone}</p>
<p className="info">{Contacts.email}</p>
</div>
</div>
<Card name="Card.name" />
<img src="Card.imgURL" />
<Card phone="Card.phone" />
<Card email="Card.email" />
</div>
);
}
Expand Down
23 changes: 23 additions & 0 deletions react-pr2/src/components/Card.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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"
/>
</div>
<div className="bottom">
<p className="info">{contacts.phone}</p>
<p className="info">{contacts.email}</p>
</div>
</div>
);
}

export default Card;
2 changes: 1 addition & 1 deletion react-pr2/src/contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ const contacts = [
},
];

export default Contacts;
export default contacts;

0 comments on commit fc77e55

Please sign in to comment.