From 66f2175ec9b3106961aaccf1302723adc0478320 Mon Sep 17 00:00:00 2001 From: Siranush Date: Thu, 23 Aug 2018 14:12:47 +0400 Subject: [PATCH 01/10] Siranush's commit --- .idea/codeStyles/Project.xml | 9 + .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/inspectionProfiles/Project_Default.xml | 6 + .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/react-starter.iml | 12 + .idea/vcs.xml | 6 + .idea/workspace.xml | 318 +++++++++++++++++++ README.md | 145 +-------- package-lock.json | 109 ++++++- package.json | 6 +- src/components/App.js | 12 +- src/components/Navigation.js | 74 +++++ src/index.js | 5 +- src/styles/_base.scss | 23 -- 15 files changed, 562 insertions(+), 182 deletions(-) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/react-starter.iml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 src/components/Navigation.js diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..aa4f55f --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..c6cc8c8 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..24eb271 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ab3f0eb --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/react-starter.iml b/.idea/react-starter.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/react-starter.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..fabc741 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -190,10 +219,13 @@ - + + - + + + @@ -222,21 +254,23 @@ 1534943067839 + - + - + - + @@ -281,38 +315,54 @@ - - - - - - + + + + + + + + - - + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/App.js b/src/components/App.js index bf05f47..a12c1ee 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -13,6 +13,7 @@ export default class App extends Component {
+
); diff --git a/src/components/BookList.js b/src/components/BookList.js new file mode 100644 index 0000000..32fdb88 --- /dev/null +++ b/src/components/BookList.js @@ -0,0 +1,56 @@ +import React, {Component} from 'react'; + + +export default class BookList extends Component { + constructor(props) { + super(props); + this.state = { + books: [] + }; + } + + componentDidMount() { + this.setState({ + books: [ + { + id: 1, + category: 'Mystery', + name: 'Angels and Demons', + author: 'Dan Brown' + }, + + { + id: 2, + category: 'Mystery', + name: 'The Woman in White', + author: 'Wilkie Collins' + }, + + { + id: 3, + category: 'Mystery', + name: 'Code Da Vinchi', + author: 'Dan Brown' + } + ] + }); + } + + + + render() { + let filter = this.state.books.filter(item => { + return item.name.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1; + }); + return ( + + ); + } + +} + diff --git a/src/components/Navigation.js b/src/components/Navigation.js index 0128c84..55b4bff 100644 --- a/src/components/Navigation.js +++ b/src/components/Navigation.js @@ -1,4 +1,5 @@ import React, {Component} from 'react'; +import BookList from './BookList'; import { Collapse, Navbar, @@ -19,7 +20,8 @@ export default class Navigation extends Component { this.toggle = this.toggle.bind(this); this.state = { - isOpen: false + isOpen: false, + search: '', }; } @@ -29,44 +31,59 @@ export default class Navigation extends Component { }); } - render() { - return ( - - books - - - - - + render() { + return ( +
+ + books + + + + + + +
); } diff --git a/src/index.js b/src/index.js index 0d9e8f1..f4f2c9d 100644 --- a/src/index.js +++ b/src/index.js @@ -10,5 +10,4 @@ import App from './components/App'; import 'bootstrap/dist/css/bootstrap.min.css'; - ReactDOM.render(, document.getElementById('app')); \ No newline at end of file From e7da57f5fecc0b11786e3486dfd5809a6771a41e Mon Sep 17 00:00:00 2001 From: Siranush Date: Fri, 24 Aug 2018 18:39:35 +0400 Subject: [PATCH 03/10] book component add --- .gitignore | 1 + .idea/workspace.xml | 169 ++++++++++++++++++++++++----------- src/components/App.js | 3 +- src/components/BookCard.js | 31 +++++++ src/components/BookList.js | 84 +++++++++-------- src/components/Navigation.js | 8 +- src/index.js | 2 + src/styles/_base.scss | 7 ++ 8 files changed, 205 insertions(+), 100 deletions(-) create mode 100644 src/components/BookCard.js diff --git a/.gitignore b/.gitignore index fcd188e..da75f8a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +.idea \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7c67841..37355b2 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,11 +2,14 @@ - + + + + @@ -62,6 +65,7 @@ + @@ -73,22 +77,30 @@ - + + + - + + + - + + + - + + + @@ -98,8 +110,8 @@ - - + + @@ -110,8 +122,8 @@ - - + + @@ -120,10 +132,22 @@ - + + + + + + + + + + + + + - - + + @@ -131,8 +155,20 @@ - - + + + + + + + + + + + + + + @@ -155,12 +191,14 @@ @@ -211,6 +249,12 @@ + + + + + + - + aria-label="Search" value={this.state.search} + onChange={this.updateSearch.bind(this)}/> - ); } diff --git a/src/index.js b/src/index.js index f4f2c9d..adc3feb 100644 --- a/src/index.js +++ b/src/index.js @@ -8,6 +8,8 @@ import App from './components/App'; // STYLES import 'bootstrap/dist/css/bootstrap.min.css'; +import 'normalize.css'; +import './styles/app.scss'; ReactDOM.render(, document.getElementById('app')); \ No newline at end of file diff --git a/src/styles/_base.scss b/src/styles/_base.scss index e69de29..fd9bab2 100644 --- a/src/styles/_base.scss +++ b/src/styles/_base.scss @@ -0,0 +1,7 @@ +.card{ + flex-direction: row; +} + +.card-img{ + width: inherit; +} \ No newline at end of file From bcd26bb0e87696271e099c2f1dcb1e821b88188e Mon Sep 17 00:00:00 2001 From: Siranush Date: Thu, 6 Sep 2018 13:19:52 +0400 Subject: [PATCH 04/10] Book component --- .gitignore | 2 +- .idea/workspace.xml | 149 ++++++++++++++++++++++--------------- src/components/Book.js | 44 +++++++++++ src/components/BookCard.js | 8 +- src/components/BookList.js | 58 +++++++-------- src/styles/_base.scss | 2 +- 6 files changed, 168 insertions(+), 95 deletions(-) create mode 100644 src/components/Book.js diff --git a/.gitignore b/.gitignore index da75f8a..82a517a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -.idea \ No newline at end of file +.idea/ diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 37355b2..2081cb6 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,13 +2,11 @@ - + - + - - @@ -65,41 +63,48 @@ - + - + + + + - + - - - + + + + - - - + + + + - - + + + - - + + + @@ -110,7 +115,7 @@ - + @@ -122,8 +127,8 @@ - - + + @@ -132,10 +137,19 @@ + + + + + + + + + - - + + @@ -146,8 +160,8 @@ - - + + @@ -155,7 +169,7 @@ - + @@ -167,8 +181,8 @@ - - + + @@ -191,14 +205,15 @@ @@ -299,14 +314,21 @@ + + + + + + - + @@ -364,72 +386,83 @@ - - - - - + + - + - - + + - + - - + + - + - - + + - + - + - - + + + + + + + + + - + - + - - + + - + - - + + - + + + + + + + + \ No newline at end of file diff --git a/src/components/Book.js b/src/components/Book.js new file mode 100644 index 0000000..3257f5a --- /dev/null +++ b/src/components/Book.js @@ -0,0 +1,44 @@ +import React,{Component} from 'react'; +import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; + + +export default class BookItem extends Component { + constructor(props){ + super(props); + this.state = { + modal: false, + }; + + this.toggle = this.toggle.bind(this); + } + toggle() { + this.setState({ + modal: !this.state.modal + }); + } + + render() { + + return ( +
+ + + + + + + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt + ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco + laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in + voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat + non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. + + + {' '} + + + +
+ ); + } +} \ No newline at end of file diff --git a/src/components/BookCard.js b/src/components/BookCard.js index 95cb9f7..33064ef 100644 --- a/src/components/BookCard.js +++ b/src/components/BookCard.js @@ -1,5 +1,6 @@ import React,{Component} from 'react'; -import { Card, CardHeader, CardImg, CardBody, CardGroup} from 'reactstrap'; +import BookItem from './Book'; +import { Card, CardHeader, CardImg, CardBody} from 'reactstrap'; @@ -11,14 +12,15 @@ export default class BookCard extends Component{ let bookItems = this.props.item.map(book => - + -

title: {book.name}

+

title: {book.title}

Author: {book.author}

Category: {book.category}

Description

{book.description}

+ More...
diff --git a/src/components/BookList.js b/src/components/BookList.js index ea23653..56b1e07 100644 --- a/src/components/BookList.js +++ b/src/components/BookList.js @@ -3,52 +3,46 @@ import BookCard from './BookCard'; const bookList = [ { - id: 1, - category: 'Mystery', - name: 'Angels and Demons', - author: 'Dan Brown', - img:'https://cdn2.mhpbooks.com/2017/07/Screen-Shot-2017-07-26-at-4.02.01-PM-200x300.png', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sit amet fermentum justo. ' + - 'Donec sagittis, tellus nec pharetra commodo, leo tortor ultrices mi, eget mattis justo lectus eget nibh.' + - ' Vestibulum orci nisl, porta id tortor ac, pretium mollis lorem. Fusce vestibulum ligula aliquam, pharetra ' + - 'ex nec, feugiat ipsum. Pellentesque eget euismod quam, id malesuada nibh. Sed feugiat ultricies turpis sodales rutrum. ' + id: 0, + title: 'Before She was Harriet', + author: 'Lesa Cline-Ransome', + imgurl: 'https://www.bookish.com/wp-content/uploads/9780823420476_d2861-1.jpg', + category: 'History', + description: 'A lush and lyrical biography of Harriet Tubman, written in verse and illustrated by an award-winning artist.We know her today as Harriet Tubman, but in her lifetime she was called by many names. As General Tubman she was a Union spy. As Moses she led hundreds to freedom on the Underground Railroad. As Minty she was a slave whose spirit could not be broken. An evocative poem and opulent watercolors come together to honor a woman of humble origins whose courage and compassion make her larger than life.', + date: new Date().toLocaleTimeString(), + uploadedBy: 'Admin' }, - { - id: 2, - category: 'Mystery', - name: 'The Woman in White', - author: 'Wilkie Collins', - img:'http://itsreally10months.com/wp-content/uploads/2015/09/Its-Really-10-Months-Special-Delivery.-Best-Pregnancy-Book-200x300.png', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sit amet fermentum justo. ' + - 'Donec sagittis, tellus nec pharetra commodo, leo tortor ultrices mi, eget mattis justo lectus eget nibh.' + - ' Vestibulum orci nisl, porta id tortor ac, pretium mollis lorem. Fusce vestibulum ligula aliquam, pharetra ' + - 'ex nec, feugiat ipsum. Pellentesque eget euismod quam, id malesuada nibh. Sed feugiat ultricies turpis sodales rutrum. ' + id: 1, + title: 'Fred the Lonely Monster', + author: 'Anne Lowensky', + imgurl: 'https://about.canva.com/wp-content/uploads/sites/3/2015/01/children_bookcover.png', + category: 'Comedy', + description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.', + date: new Date().toLocaleTimeString(), + uploadedBy: 'Admin' }, - { - id: 3, - category: 'Mystery', - name: 'Code Da Vinchi', - author: 'Dan Brown', - img:'https://upload.wikimedia.org/wikipedia/commons/d/d4/Tyrant_Books_logo.png', - description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sit amet fermentum justo. ' + - 'Donec sagittis, tellus nec pharetra commodo, leo tortor ultrices mi, eget mattis justo lectus eget nibh.' + - ' Vestibulum orci nisl, porta id tortor ac, pretium mollis lorem. Fusce vestibulum ligula aliquam, pharetra ' + - 'ex nec, feugiat ipsum. Pellentesque eget euismod quam, id malesuada nibh. Sed feugiat ultricies turpis sodales rutrum. ' + id: 2, + title: 'The Man in the High Castle', + author: 'Philip K. Dick', + imgurl: 'https://res.cloudinary.com/bookbub/image/upload/c_scale,w_405/v1488624290/pro_pbid_395450.jpg', + category: 'Alternate History', + description: 't’s America in 1962. Slavery is legal once again. The few Jews who still survive hide under assumed names. In San Francisco, the I Ching is as common as the Yellow Pages. All because some twenty years earlier the United States lost a war—and is now occupied by Nazi Germany and Japan.', + date: new Date().toLocaleTimeString(), + uploadedBy: 'Admin' } ]; -export default class BookList extends Component{ +export default class BookList extends Component { constructor(props) { super(props); } render() { return ( - + ); } } - diff --git a/src/styles/_base.scss b/src/styles/_base.scss index fd9bab2..f4e32c6 100644 --- a/src/styles/_base.scss +++ b/src/styles/_base.scss @@ -3,5 +3,5 @@ } .card-img{ - width: inherit; + width: 100%; } \ No newline at end of file From 216685e39fe4e0afaa6fee0d0698b3c5d19a94e4 Mon Sep 17 00:00:00 2001 From: Siranush Date: Fri, 7 Sep 2018 04:02:26 +0400 Subject: [PATCH 05/10] book component --- .gitignore | 2 +- .idea/workspace.xml | 103 ++++++++++++++++++++----------------- src/components/Book.js | 26 ++++++---- src/components/BookCard.js | 2 +- src/styles/_base.scss | 12 ++++- 5 files changed, 85 insertions(+), 60 deletions(-) diff --git a/.gitignore b/.gitignore index 82a517a..c90a5c1 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -.idea/ +**.idea/** diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2081cb6..7202f63 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,11 +2,10 @@ - + - @@ -63,46 +62,48 @@ - + + - + + - + - - + + - + - - - + + + - + - + @@ -136,11 +137,14 @@
- + - - + + + + + @@ -149,7 +153,7 @@ - + @@ -157,11 +161,11 @@ - + - - + + @@ -169,7 +173,7 @@ - + @@ -181,8 +185,8 @@ - - + + @@ -208,12 +212,12 @@
@@ -245,7 +249,6 @@ - @@ -274,6 +277,7 @@