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
2 changes: 2 additions & 0 deletions -
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import React from "react";
import "./App.css";
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"foreman": "^2.0.0",
"json-server": "^0.9.4",
"react": "^15.3.2",
"react-dom": "^15.3.2"
"react-dom": "^15.3.2",
"whatwg-fetch": "^2.0.3"
},
"scripts": {
"start": "nf start",
Expand All @@ -24,5 +25,5 @@
"test": "npm run lint && react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy" : "http://localhost:3001"
"proxy": "http://localhost:3001"
}
19 changes: 0 additions & 19 deletions src/App.js

This file was deleted.

22 changes: 22 additions & 0 deletions src/App.css → src/components/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,28 @@
font-size: large;
}

.App-links {
width: 60px;
height: 60px;
margin-top: 10px;
}

.Berlin {
width:100%;
height:600px;
margin-top:10px;
}

.Schloss {
width:100%;
height:600px;
margin-top:10px;
}

button {
margin-left: 8px;
}

@keyframes App-logo-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
Expand Down
33 changes: 33 additions & 0 deletions src/components/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from "react";
import "./App.css";
import Eins from "./Eins";
import Zwei from "./Zwei";
import Drei from "./Drei";
import Vier from "./Vier";
import Funf from "./Funf";
import Oxford from "./Oxford";
import ListOfUsers from "./ListOfUsers";
import UserDetail from "./UserDetail";
import users from "../users";


function App(props) {
return (
<div className="App">
<Eins />
<Zwei />
<Drei />
<Oxford />
<ListOfUsers />
<UserDetail users={users} />
<Vier />
<Funf />
</div>
);
}

// App.propTypes = {
// users: React.PropTypes.node,
// };

export default App;
Binary file added src/components/Brandenburg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/components/Drei.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import "./App.css";


function Drei() {
return (
<a href="mailto:popularwatson@gmail.com">popularwatson@gmail.com</a>
);
}

export default Drei;
17 changes: 17 additions & 0 deletions src/components/Eins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react";
import "./App.css";
// import logo from "./logo.svg";
import Links from "./Links.png";
import Header from "./Header";

function Hund() {
return (
<div className="App-header">
<Header Schild="LINKS" />
<img src={Links} className="App-links" alt="Links" />
<h2>Wie geht es ihnen?</h2>
</div>
);
}

export default Hund;
12 changes: 12 additions & 0 deletions src/components/Funf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";
import "./App.css";
import Schloss from "./Schloss.jpg";


function Funf() {
return (
<img src={Schloss} className="Schloss" alt="Schloss" />
);
}

export default Funf;
19 changes: 19 additions & 0 deletions src/components/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import "./App.css";
import PropTypes from "prop-types";

function Header(props) {
return (
<header>{props.Schild}</header>
);
}

Header.propTypes = {
Schild: PropTypes.string.isRequired
};

// Header.propTypes = {
// Schild: React.PropTypes.node,
// };

export default Header;
Binary file added src/components/Links.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions src/components/ListOfUsers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react";
import "./App.css";
import users from "../users";

class ListOfUsers extends React.Component {
constructor() {
super();
this.state = {
Users: users,
visible: "",
searchText: ""
};
}
searchHandler(event) {
this.setState({
searchText: event.target.value
});
}
render() {
return (
<input
className="searchBox"
name="Search"
type="text"
value={this.state.searchText}
onChange={(event) => this.searchHandler(event)}
/>
);
}
}

export default ListOfUsers;
34 changes: 34 additions & 0 deletions src/components/Oxford.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from "react";
import "./App.css";

class Oxford extends React.Component {
constructor(props) {
super(props);
this.state = {
word: ""
};
}
searchHandler(event) {
this.setState({
word: event.target.value
});
}
render() {
return (
<div>
<input
className="searchBox"
name="Search"
type="text"
value={this.state.word}
onChange={(event) => this.searchHandler(event)}
/>
<p className="App-intro">
Hallo
</p>
</div>
);
}
}

export default Oxford;
Binary file added src/components/Schloss.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions src/components/UserDetail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import React from "react";
import "./App.css";
import PropTypes from "prop-types";

function setUpper(word) {
let firstLetter = word[0];
firstLetter = firstLetter.toUpperCase();
const secondPart = word.slice(1);
const newWord = firstLetter + secondPart;
return newWord;
}

function SearchUser({letter, users}) {
const filteredUsers = [];
users.map((user, index) => {
if (user.last_name[0] === letter) {
const name = (
<div key={index}>
{setUpper(user.last_name) + ", " + setUpper(user.first_name)}
</div>
);
filteredUsers.push(name);
}
});
if (filteredUsers.length === 0) {
filteredUsers.push("No Entry");
}
return (
<div>
## {letter.toUpperCase()}
<br />
{filteredUsers}
</div>
);
}

SearchUser.propTypes = {
letter: PropTypes.string.isRequired,
users: PropTypes.array.isRequired
};

class UserDetail extends React.Component {
constructor(props) {
super(props);
this.state = {
value: "Hide",
hide: false
};
}
handleButton() {
this.setState({
hide: !this.state.hide,
value: this.state.hide ? "Hide" : "Show"
});
}
render() {
const Alphabet = ["a","b","c","d","e","f","g","h","i","j","k",
"l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
const userItems = Alphabet.map((letter, index) => {
return (
<div key={index}>
<SearchUser letter={letter} users={this.props.users} />
</div>
);
});

return (
<div>
{userItems}
</div>
);
}
}

UserDetail.propTypes = {
users: PropTypes.array
};

export default UserDetail;
12 changes: 12 additions & 0 deletions src/components/Vier.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";
import "./App.css";
import Brandenburg from "./Brandenburg.jpg";


function Vier() {
return (
<img src={Brandenburg} className="Berlin" alt="Brandenburg" />
);
}

export default Vier;
13 changes: 13 additions & 0 deletions src/components/Zwei.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import "./App.css";


function Zwei() {
return (
<p className="App-intro">
Es hat mir viel Spass gemacht!!!
</p>
);
}

export default Zwei;
File renamed without changes
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import App from "./components/App";
import "./index.css";
import users from "./users";

// var currentUser;
//
// function selectUser() {
// }

function render() {
ReactDOM.render(
<App />,
<App users={users} />,
document.getElementById("root")
);
}
Expand Down
3 changes: 0 additions & 3 deletions src/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,3 @@ export default [
}

];



Loading