Skip to content

Commit

Permalink
Merge pull request netlify#2 from andrewsjkang/master
Browse files Browse the repository at this point in the history
Removed unnecessary css files
  • Loading branch information
stphnchoe authored Mar 25, 2018
2 parents c379cd4 + 08d94b4 commit 67d9b91
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 81 deletions.
Binary file removed public/favicon.ico
Binary file not shown.
28 changes: 0 additions & 28 deletions src/App.css

This file was deleted.

46 changes: 14 additions & 32 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,29 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Classroom from './components/classroom/Classroom';

class LambdaDemo extends Component {
class App extends Component {
constructor(props) {
super(props);
this.state = {loading: false, msg: null};
this.state = {
currentView: 'room'
}
}

handleClick = (e) => {
e.preventDefault();
switchView() {
var currentView = this.state.currentView;

this.setState({loading: true});
fetch('/.netlify/functions/hello')
.then(response => response.json())
.then(json => this.setState({loading: false, msg: json.msg}));
if (currentView === 'room') {
return <Classroom />
}
}

render() {
const {loading, msg} = this.state;

return <p>
<button onClick={this.handleClick}>{loading ? 'Loading...' : 'Call Lambda'}</button><br/>
<span>{msg}</span>
</p>
}
}

class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
<LambdaDemo/>
<div>
{ this.switchView() }
</div>
);
)
}
}

export default App;
export default App;
8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

47 changes: 47 additions & 0 deletions src/App_Sample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';

class LambdaDemo extends Component {
constructor(props) {
super(props);
this.state = {loading: false, msg: null};
}

handleClick = (e) => {
e.preventDefault();

this.setState({loading: true});
fetch('/.netlify/functions/hello')
.then(response => response.json())
.then(json => this.setState({loading: false, msg: json.msg}));
}

render() {
const {loading, msg} = this.state;

return <p>
<button onClick={this.handleClick}>{loading ? 'Loading...' : 'Call Lambda'}</button><br/>
<span>{msg}</span>
</p>
}
}

class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
<LambdaDemo/>
</div>
);
}
}

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

class Classroom extends Component {
render() {
return(
<div>
This is the Classroom!
</div>
)
}
}

export default Classroom
5 changes: 0 additions & 5 deletions src/index.css

This file was deleted.

1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

Expand Down
7 changes: 0 additions & 7 deletions src/logo.svg

This file was deleted.

0 comments on commit 67d9b91

Please sign in to comment.