File tree Expand file tree Collapse file tree 10 files changed +3754
-100
lines changed Expand file tree Collapse file tree 10 files changed +3754
-100
lines changed Original file line number Diff line number Diff line change
1
+ ## The link for the backend code : https://github.com/Niraj-Kamdar/hackout_backend
2
+
3
+
1
4
This project was bootstrapped with [ Create React App] ( https://github.com/facebook/create-react-app ) .
2
5
3
6
## Available Scripts
Original file line number Diff line number Diff line change 3
3
"version" : " 0.1.0" ,
4
4
"private" : true ,
5
5
"dependencies" : {
6
+ "axios" : " ^0.19.0" ,
6
7
"bootstrap" : " ^4.3.1" ,
8
+ "node-sass" : " ^4.12.0" ,
7
9
"react" : " ^16.10.2" ,
8
10
"react-bootstrap" : " ^1.0.0-beta.14" ,
9
11
"react-dom" : " ^16.10.2" ,
12
+ "react-particles-js" : " ^2.7.0" ,
13
+ "react-rater" : " ^5.1.1" ,
10
14
"react-router-dom" : " ^5.1.2" ,
11
- "react-scripts" : " 3.2.0"
15
+ "react-scripts" : " 3.2.0" ,
16
+ "react-star-ratings" : " ^2.3.0" ,
17
+ "web3" : " ^1.0.0-beta.55" ,
18
+ "web3-eth" : " ^1.2.1"
12
19
},
13
20
"scripts" : {
14
21
"start" : " react-scripts start" ,
Original file line number Diff line number Diff line change 15
15
-->
16
16
< link rel ="manifest " href ="%PUBLIC_URL%/manifest.json " />
17
17
18
+ < script src ="https://cdn.rawgit.com/progers/pathseg/master/pathseg.js "> </ script >
19
+
20
+
18
21
< link
19
22
rel ="stylesheet "
20
23
href ="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css "
Original file line number Diff line number Diff line change 1
- import React from "react" ;
1
+ import React , { Component } from "react" ;
2
+
2
3
import "./App.css" ;
3
4
import { BrowserRouter } from "react-router-dom" ;
4
5
5
6
import "bootstrap/dist/css/bootstrap.min.css" ;
6
7
import IndexRoutes from "./routes" ;
7
8
8
- function App ( ) {
9
- return (
10
- < div className = "App" >
11
- < BrowserRouter >
12
- < IndexRoutes />
13
- </ BrowserRouter >
14
- </ div >
15
- ) ;
9
+ class App extends Component {
10
+ render ( ) {
11
+ return (
12
+ < div className = "App" >
13
+ < BrowserRouter >
14
+ < IndexRoutes />
15
+ </ BrowserRouter >
16
+ </ div >
17
+ ) ;
18
+ }
16
19
}
17
20
18
21
export default App ;
Original file line number Diff line number Diff line change 1
1
import React , { Component } from "react" ;
2
- import Navbar from "../Navbar" ;
3
2
4
- import BookList from "./BookList" ;
3
+ import Particles from "react-particles-js" ;
4
+ //import Bookcase from "../../templates/images/bookcase.jpg";
5
5
6
- class HomePage extends Component {
6
+ export default class HomePage extends Component {
7
7
render ( ) {
8
8
return (
9
- < div >
10
- < div className = "nav-bar" >
11
- < Navbar />
12
- </ div >
13
- < div className = "main-content container" >
14
- < BookList />
9
+ < section
10
+ // style={{
11
+ // backgroundImage: `url(${Bookcase})`,
12
+ // height: "100%",
13
+
14
+ // /* Center and scale the image nicely */
15
+ // backgroundPosition: "center",
16
+ // backgroundRepeat: "no-repeat",
17
+ // backgroundSize: "cover"
18
+ // }}
19
+ >
20
+ < div className = "home-title" >
21
+ < center style = { { marginTop : "20%" } } >
22
+ < h1 > HackOut Book Store</ h1 >
23
+ < h2 >
24
+ < a href = "/books" > Go to Store</ a >
25
+ </ h2 >
26
+ </ center >
15
27
</ div >
16
- </ div >
28
+ < Particles
29
+ style = { {
30
+ width : "100%" ,
31
+ height : "100%" ,
32
+ position : "fixed" ,
33
+ right : "0" ,
34
+ bottom : "0" ,
35
+ left : "0" ,
36
+ zIndex : "-1"
37
+ } }
38
+ params = { {
39
+ particles : {
40
+ number : {
41
+ value : 80 ,
42
+ density : {
43
+ enable : true ,
44
+ value_area : 1803.4120608655228
45
+ }
46
+ } ,
47
+ color : {
48
+ value : "#6C6A6A"
49
+ } ,
50
+ shape : {
51
+ type : "circle" ,
52
+ stroke : {
53
+ width : 2 ,
54
+ color : "#000000"
55
+ } ,
56
+ polygon : {
57
+ nb_sides : 5
58
+ } ,
59
+ image : {
60
+ src : "img/github.svg" ,
61
+ width : 100 ,
62
+ height : 100
63
+ }
64
+ } ,
65
+ opacity : {
66
+ value : 0.4008530152163807 ,
67
+ random : false ,
68
+ anim : {
69
+ enable : false ,
70
+ speed : 1 ,
71
+ opacity_min : 0.1 ,
72
+ sync : false
73
+ }
74
+ } ,
75
+ size : {
76
+ value : 1.5 ,
77
+ random : true ,
78
+ anim : {
79
+ enable : false ,
80
+ speed : 40 ,
81
+ size_min : 0.1 ,
82
+ sync : false
83
+ }
84
+ } ,
85
+ line_linked : {
86
+ enable : true ,
87
+ distance : 300 ,
88
+ color : "#6C6A6A" ,
89
+ opacity : 0.4 ,
90
+ width : 2
91
+ } ,
92
+ move : {
93
+ enable : true ,
94
+ speed : 12 ,
95
+ direction : "none" ,
96
+ random : false ,
97
+ straight : false ,
98
+ out_mode : "out" ,
99
+ bounce : false ,
100
+ attract : {
101
+ enable : false ,
102
+ rotateX : 600 ,
103
+ rotateY : 1200
104
+ }
105
+ }
106
+ } ,
107
+ interactivity : {
108
+ detect_on : "canvas" ,
109
+ events : {
110
+ onhover : {
111
+ enable : false ,
112
+ mode : "repulse"
113
+ } ,
114
+ onclick : {
115
+ enable : true ,
116
+ mode : "push"
117
+ } ,
118
+ resize : true
119
+ } ,
120
+ modes : {
121
+ grab : {
122
+ distance : 400 ,
123
+ line_linked : {
124
+ opacity : 1
125
+ }
126
+ } ,
127
+ bubble : {
128
+ distance : 400 ,
129
+ size : 40 ,
130
+ duration : 2 ,
131
+ opacity : 8 ,
132
+ speed : 3
133
+ } ,
134
+ repulse : {
135
+ distance : 100 ,
136
+ duration : 0.4
137
+ } ,
138
+ push : {
139
+ particles_nb : 5
140
+ } ,
141
+ remove : {
142
+ particles_nb : 2
143
+ }
144
+ }
145
+ } ,
146
+ retina_detect : true
147
+ } }
148
+ />
149
+ </ section >
17
150
) ;
18
151
}
19
152
}
20
- export default HomePage ;
Original file line number Diff line number Diff line change @@ -2,7 +2,26 @@ import React, { Component } from "react";
2
2
3
3
import { Navbar , Nav } from "react-bootstrap" ;
4
4
5
+ import Web3 from "web3" ;
6
+
5
7
export default class Navbar1 extends Component {
8
+ componentWillMount ( ) {
9
+ this . loadBlockchainData ( ) ;
10
+ }
11
+
12
+ async loadBlockchainData ( ) {
13
+ const web3 = new Web3 (
14
+ new Web3 . providers . HttpProvider ( "http://localhost:8545" )
15
+ ) ;
16
+ const accounts = await web3 . eth . getAccounts ( ) ;
17
+ this . setState ( { account : accounts [ 0 ] } ) ;
18
+ }
19
+
20
+ constructor ( props ) {
21
+ super ( props ) ;
22
+ this . state = { account : "" } ;
23
+ }
24
+
6
25
render ( ) {
7
26
return (
8
27
< div >
@@ -11,11 +30,11 @@ export default class Navbar1 extends Component {
11
30
< Navbar . Toggle aria-controls = "responsive-navbar-nav" />
12
31
< Navbar . Collapse id = "responsive-navbar-nav" >
13
32
< Nav className = "mr-auto" >
14
- < Nav . Link href = "/home" > Features </ Nav . Link >
15
- < Nav . Link href = "/pricing" > Pricing </ Nav . Link >
33
+ < Nav . Link href = "/home" > Home </ Nav . Link >
34
+ < Nav . Link href = "/books" > Store </ Nav . Link >
16
35
</ Nav >
17
36
< Nav >
18
- < Nav . Link href = "/User" > User </ Nav . Link >
37
+ < Nav . Link href = "/user" > { this . state . account } </ Nav . Link >
19
38
</ Nav >
20
39
</ Navbar . Collapse >
21
40
</ Navbar >
Original file line number Diff line number Diff line change 1
- import React from ' react' ;
2
- import ReactDOM from ' react-dom' ;
3
- import ' ./index.css' ;
4
- import App from ' ./App' ;
5
- import * as serviceWorker from ' ./serviceWorker' ;
1
+ import React from " react" ;
2
+ import ReactDOM from " react-dom" ;
3
+ import " ./index.css" ;
4
+ import App from " ./App" ;
5
+ import * as serviceWorker from " ./serviceWorker" ;
6
6
7
- ReactDOM . render ( < App /> , document . getElementById ( ' root' ) ) ;
7
+ ReactDOM . render ( < App /> , document . getElementById ( " root" ) ) ;
8
8
9
9
// If you want your app to work offline and load faster, you can change
10
10
// unregister() to register() below. Note this comes with some pitfalls.
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
import { Switch , Route } from "react-router-dom" ;
3
3
4
+
5
+ import BooksPage from "../components/BooksPage" ;
6
+ import Page404 from "../components/Page404" ;
7
+ import BookDetails from "../components/BookDetails" ;
8
+ import AddBook from "../components/BooksPage/AddBook" ;
4
9
import HomePage from "../components/HomePage" ;
10
+ import UserBookList from "../components/UserBookList" ;
5
11
6
12
const IndexRoutes = ( ) => {
7
13
return (
8
14
< Switch >
9
15
< Route path = "/home" component = { HomePage } />
16
+ < Route path = "/books" component = { BooksPage } />
17
+ < Route path = "/book/:id" component = { BookDetails } />
18
+ < Route path = "/add" component = { AddBook } />
19
+ < Route path = "/user" component = { UserBookList } />
20
+ < Route component = { Page404 } />
10
21
</ Switch >
11
22
) ;
12
23
} ;
You can’t perform that action at this time.
0 commit comments