Skip to content

Commit

Permalink
Merge 0a4773f into b05a136
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinndmo committed Apr 8, 2019
2 parents b05a136 + 0a4773f commit 2e8d121
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 42 deletions.
16 changes: 0 additions & 16 deletions src/components/Home.js

This file was deleted.

10 changes: 10 additions & 0 deletions src/components/Home/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.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;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import { shallow } from 'enzyme'
import App from '../Home'
import React from 'react';
import { shallow } from 'enzyme';
import App from './Home';

describe('App', () => {
it('Should render without crashing', function () {
const app = shallow(<App />)
expect(app.length).toBe(1)
})
})
});
});
16 changes: 16 additions & 0 deletions src/components/Home/Home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { Component } from 'react';
import '../../App.css';

class App extends Component {
render() {
return (
<div className="App">
<header className="App-header">
<p>WELCOME TO AUTHORS HAVEN</p>
</header>
</div>
);
}
}

export default App;
13 changes: 0 additions & 13 deletions src/components/Login.js

This file was deleted.

13 changes: 13 additions & 0 deletions src/components/Login/Login.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

export default () => {
return (
<div>
<form>
<input type="text" placeholder="Username" />
<input type="password" placeholder="Password" />
<button>Login</button>
</form>
</div>
);
};
16 changes: 8 additions & 8 deletions src/routers/Approuter.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React, { Component } from 'react'
import Login from '../components/Login'
import Home from '../components/Home'
import { BrowserRouter, Route, Switch } from 'react-router-dom'
import React, { Component } from 'react';
import Login from '../components/Login/Login';
import Home from '../components/Home/Home';
import { BrowserRouter, Route, Switch } from 'react-router-dom';

const Approuter = () => (
<BrowserRouter>
<div>
<Switch>
<Route path='/' component={Home} exact />
<Route path='/login' component={Login} />
<Route path="/" component={Home} exact />
<Route path="/login" component={Login} />
</Switch>
</div>
</BrowserRouter>
)
);

export default Approuter
export default Approuter;

0 comments on commit 2e8d121

Please sign in to comment.