Skip to content

Commit

Permalink
chore(Re-installed Es-lint): Refactored Eslint to get rid of annoying…
Browse files Browse the repository at this point in the history
… parsing error
  • Loading branch information
Benny Ogidan authored and Benny Ogidan committed Oct 30, 2017
1 parent 715f78b commit e053f5b
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 277 deletions.
7 changes: 6 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"root": true,
"extends": "airbnb-base",
"extends": "airbnb",
"plugins": [
"import",
"react",
"jsx-a11y"
],
"env": {
"browser": true,
"jquery": true,
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.enable": true
}
76 changes: 76 additions & 0 deletions client/src/app/components/container/LandingPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import React from 'react'
import {Row} from 'react-materialize'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { fetchBooksforDashboard } from '../../actions/fetchbooks';

import {Book} from '../presentation/common/Book/DisplayBook';



/*
eslint-disable
*/
class LandingPage extends React.Component{
constructor(props) {
super(props);
this.state = {
limit: 8,
offset: 0
};
}
componentWillMount() {
this
.props
.fetchBooksforDashboard(this.state.offset, this.state.limit)
}



render() {
if (!this.props.books) {
return <h5>Loading....</h5>
}
const getAllBooks = this
.props
.books
.map((book) => {
return (<Book
key={book.id}
title={book.title}
author
={book.author}
category={book.category}
description={book.description}
image={book.bookimage}/>);
});
return (
<Row>
<div className='body-wrapper'>
<div className='overlay-main'>
<Row>
<div className='overlay'>
<h3>Latest Books Available: </h3>
<hr/>
<h5> To Loan Login </h5>

<p>Click a book for a look at the description</p>
{[...getAllBooks]}

</div>
</Row>
</div>
</div>
</Row>
);
}
}

const mapStateToProps = (state) => {
return {
books: state.bookReducer.books.books,
pagination: state.bookReducer.books.pagination
};
};

export default connect (mapStateToProps,{ fetchBooksforDashboard })(LandingPage);
52 changes: 0 additions & 52 deletions client/src/app/components/container/Login.js

This file was deleted.

51 changes: 0 additions & 51 deletions client/src/app/components/container/Register.js

This file was deleted.

36 changes: 0 additions & 36 deletions client/src/app/components/container/forgetPasswordForm.js

This file was deleted.

30 changes: 0 additions & 30 deletions client/src/app/components/container/staticBooks.js

This file was deleted.

79 changes: 0 additions & 79 deletions client/src/app/components/presentation/LandingPage.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,10 @@ export const Book = (books) =>{
<p>Title: {books.title}</p>
<p>Category: {books.category}</p>
<p>Author: {books.author}</p>

</div>


</div>

</div>


// <div>

// <Col m={7} s={12} l={5}>
// <Card className ='transparent'
// horizontal header={<CardTitle image={books.image}></CardTitle>}
// actions={[<a href='#'>More Information</a>]}>
// <p>Title: {books.title}</p>
// <p>Category: {books.category}</p>
// <p>Author: {books.author}</p>
// <p >Quantity: {books.quantity}</p>
// <Modal header={`${books.title}`} fixedFooter
// trigger={<Button>Loan</Button>} actions={[<a href='#'>Loan Book &nbsp;</a>]}>
// <p>Description: {books.description}</p>
// </Modal>
// </Card>
// </Col>


// </div>

)

}
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/mainRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {Component} from 'react'
import {render} from 'react-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import {Root} from './components/Root'
import LandingPage from './components/presentation/LandingPage'
import LandingPage from './components/container/LandingPage'
//import Login from '../app/components/container/Login'
// import Register from './containers/Register'
// import Profile from './components/Profile'
Expand Down
Loading

0 comments on commit e053f5b

Please sign in to comment.