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
24 changes: 24 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,33 @@
import "./App.css";
import IdCard from "./components/IdCard.jsx";
import Greetings from "./components/Greetings.jsx";

function App() {
return (
<div className="App">
<h1> LAB | React Training</h1>

<IdCard
lastName='Doe'
firstName='John'
gender='male'
height={178}
birth={new Date("1992-07-14")}
picture="https://randomuser.me/api/portraits/men/44.jpg"
/>

<IdCard
lastName='Delores '
firstName='Obrien'
gender='female'
height={172}
birth={new Date("1988-05-11")}
picture="https://randomuser.me/api/portraits/women/44.jpg"
/>

<Greetings lang="de">Ludwig</Greetings>
<Greetings lang="fr">François</Greetings>

</div>
);
}
Expand Down
15 changes: 15 additions & 0 deletions src/components/BoxColor.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function BoxColor(r,g,b) {

let mini = 0;
let maxi = 255
let r = Math.floor(Math.random() * (maxi - mini) + mini);
let g = Math.floor(Math.random() * (maxi - mini) + mini);
let b = Math.floor(Math.random() * (maxi - mini) + mini);


return (
<div> r={r} g={g} b={b} </div>

)
}
export default BoxColor
22 changes: 22 additions & 0 deletions src/components/Greetings.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function Greetings ({lang, children}) {

let greeting;
if (lang==="de"){
greeting = "Hallo"
}
else if (lang==="en"){
greeting = "Hello"
}
else if (lang==="es"){
greeting = "Hola"
}
else if (lang==="fr"){
greeting = "Bonjour"
}
return (
<div>
{greeting} {children}
</div>)
}

export default Greetings
13 changes: 13 additions & 0 deletions src/components/IdCard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function IdCard({ lastName, firstName, gender, height, birth, picture}) {
return (
<div>
<p>lastName: {lastName}</p>
<p>firstName: {firstName}</p>
<p>gender: {gender} </p>
<p>height: {height}</p>
<p>birth: {birth}</p>
<p>picture: {picture}</p>
</div>
);
}
export default IdCard
Empty file added src/components/Random.jsx
Empty file.
13 changes: 10 additions & 3 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}

.rectangle {
width: 200px;
height: 100px;
background-color: red;
margin-bottom: 10px;
}