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
43 changes: 38 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,50 @@
import React, { Component } from 'react';
import IdCard from './components/IdCard';
import Greeting from './components/Greeting';

class App extends Component {
render() {
return (
<div className="App">
<h1>IdCard</h1>
{/* TODO: Use the IdCard component */}
<h1>IDCARD</h1>

<h1>Greetings</h1>
{/* TODO: Use the Greetings component */}
<IdCard
lastName="Doe"
firstName="John"
gender="male"
height={178}
birth={new Date('1992-07-14').toDateString()}
picture="https://randomuser.me/api/portraits/men/44.jpg"
/>
<IdCard
lastName="Delores "
firstName="Obrien"
gender="female"
height={172}
birth={new Date('1988-05-11').toDateString()}
picture="https://randomuser.me/api/portraits/women/44.jpg"
/>

<h1>GREETING</h1>

<Greeting lang="de">
Ludwig
</Greeting>
<Greeting lang="es">
José
</Greeting>
<Greeting lang="fr">
Francoise
</Greeting>
<Greeting lang="en">
John
</Greeting>
<Greeting lang="">
Hirashi
</Greeting>
</div>
);
}
}
}

export default App;
10 changes: 10 additions & 0 deletions src/components/BoxColor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React, { Component } from 'react';
import './css/BoxColor.css';

class BoxColor extends Component {
render() {
return <div className=""></div>;
}
}

export default BoxColor;
10 changes: 10 additions & 0 deletions src/components/CreditCards.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React, { Component } from 'react';
import './css/CreditCard.css';

class CreditCard extends Component {
render() {
return <div className=""></div>;
}
}

export default CreditCard;
35 changes: 35 additions & 0 deletions src/components/Greeting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { Component } from 'react';
import './css/Greeting.css';

class Greeting extends Component {
render() {
let greet = '';
const { lang, children } = this.props;
switch (lang) {
case 'es':
greet = 'Hola';
break;
case 'fr':
greet = 'Bonjour';
break;
case 'de':
greet = 'Hallo';
break;
case 'en':
greet = 'Hello';
break;
default:
greet = 'Yep';
break;
}
return (
<div className="App-Boxed">
<h2>
{greet} {children}
</h2>
</div>
);
}
}

export default Greeting;
34 changes: 34 additions & 0 deletions src/components/IdCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React, { Component } from 'react';
import './css/IdCard.css';


class IdCard extends Component {
render() {
const { firstName, lastName, gender, height, birth, picture } = this.props;

return (
<div className="App-IdCard">
<img src={picture} alt="Photography" />
<div className="App-IdCard-text">
<p>
<span>First Name:</span> {firstName}{' '}
</p>
<p>
<span>Last name:</span> {lastName}{' '}
</p>
<p>
<span>Gender:</span> {gender}{' '}
</p>
<p>
<span>Height:</span> {height} cm{' '}
</p>
<p>
<span>Birth:</span> {birth}{' '}
</p>
</div>
</div>
);
}
}

export default IdCard;
12 changes: 12 additions & 0 deletions src/components/Random.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React, { Component } from 'react';
import './css/Random.css';

class Random extends Component {
render() {
return (
<div className=""></div>
);
}
}

export default Random;
Empty file added src/components/css/BoxColor.css
Empty file.
Empty file.
7 changes: 7 additions & 0 deletions src/components/css/Greeting.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.App-Boxed {
width: 30%;
border: 1px deeppink solid;
box-shadow: 2px 2px 2px 0 grey;
margin: 20px 0;
padding-left: 20px;
}
22 changes: 22 additions & 0 deletions src/components/css/IdCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.App-IdCard {
display: flex;
flex-direction: row;
width: 50%;
border: 2px solid black;
margin-bottom: 20px;
align-items: center;
}

.App-IdCard img {
width: 128px;
height: 128px;
margin: 5px;
}

.App-IdCard-text {
margin-left: 20px;
}

.App-IdCard-text span {
font-weight: bolder;
}
Empty file added src/components/css/Random.css
Empty file.
10 changes: 9 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
body {
margin: 0;
margin-top: 0;
margin-right: 20px;
margin-bottom: 0;
margin-left: 20px;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
Expand All @@ -12,3 +15,8 @@ code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}

h1 {
font-weight: lighter;
text-shadow: 2px 2px 5px grey;
}