Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 69 additions & 32 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,75 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
*{
font-family: sans-serif;
}
thead{
font-size: 25px;
}
tr{
text-align: center;
}
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
pointer-events: none;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
to {
transform: rotate(360deg);

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
tr img{
width:100px;
height:100px;
border-radius: 20px;
}
div > button{
padding:10px 15px;
background-color:teal;
border-radius:10px;
color:white;
font-size: 20px;
margin: 10px;
border: none;
}

.App-link {
color: #61dafb;}
div > button:hover{
background-color: tomato;
}
td button{
padding:8px 10px;
border: 2px solid cornflowerblue;
border-radius: 10px;
}
td button:hover{
background-color: cornflowerblue;
color: white;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}}
tr:hover{
background-color:rgb(248, 228, 131);
}
table{
margin: 20px auto;
}
}
80 changes: 76 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
import logo from './logo.svg';
// import logo from './logo.svg';
import './App.css';
import contacts from "./contacts.json";
import React, { useState } from 'react';



function contacts () => {
const [contacts, setContacts] = useState([
{
"name": "Idris Elba",
"pictureUrl": "https://image.tmdb.org/t/p/w500/d9NkfCwczP0TjgrjpF94jF67SK8.jpg",
"popularity": 11.622713,
"id": "11731993-0604-4bee-80d5-67ad845d0a38",
"wonOscar": false,
"wonEmmy": false
}
{
"name": "Johnny Depp",
"pictureUrl": "https://image.tmdb.org/t/p/w500/kbWValANhZI8rbWZXximXuMN4UN.jpg",
"popularity": 15.656534,
"id": "7dad00f7-3949-477d-a7e2-1467fd2cfc06",
"wonOscar": false,
"wonEmmy": false
}
{
"name": "Monica Bellucci",
"pictureUrl": "https://image.tmdb.org/t/p/w500/qlT4904d8oi2NIs28RrgnIZDFZB.jpg",
"popularity": 16.096436,
"id": "0ad5e441-3084-47a1-9e9b-b917539bba71",
"wonOscar": false,
"wonEmmy": false
}
{
"name": "Gal Gadot",
"pictureUrl": "https://image.tmdb.org/t/p/w500/34kHAyBaBhq2kUrmhM15paEBuuI.jpg",
"popularity": 10.049256,
"id": "b497e3c4-50bb-4ae2-912f-eb36802c5bc2",
"wonOscar": false,
"wonEmmy": false
}
{
"name": "Ian McKellen",
"pictureUrl": "https://image.tmdb.org/t/p/w500/coWjgMEYJjk2OrNddlXCBm8EIr3.jpg",
"popularity": 10.070132,
"id": "0067ae32-97b6-4431-898e-eb1c10150abb",
"wonOscar": false,
"wonEmmy": false
}
]);
}


function App() {
return (
Expand All @@ -16,10 +66,32 @@ function App() {
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</a>
</header>
</div>
<div>
<h2>Contact List</h2>
<table>
<thead>
<tr>
<th>Picture</th>
<th>Name</th>
<th>Popularity</th>
</tr>
</thead>
<tbody>
{contacts.map(contact => (
<tr key={contact.id}>
<td>
<img src={contact.picture} alt={contact.name} style={{ width: '50px', height: '50px' }} />
</td>
<td>{contact.name}</td>
<td>{contact.popularity}</td>
</tr>
))}
</tbody>
</table>
</div>
);
}

export default App;