Skip to content

Commit 286274b

Browse files
committed
final commit
1 parent fc3a797 commit 286274b

File tree

10 files changed

+3754
-100
lines changed

10 files changed

+3754
-100
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## The link for the backend code : https://github.com/Niraj-Kamdar/hackout_backend
2+
3+
14
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
25

36
## Available Scripts

package-lock.json

Lines changed: 2248 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"axios": "^0.19.0",
67
"bootstrap": "^4.3.1",
8+
"node-sass": "^4.12.0",
79
"react": "^16.10.2",
810
"react-bootstrap": "^1.0.0-beta.14",
911
"react-dom": "^16.10.2",
12+
"react-particles-js": "^2.7.0",
13+
"react-rater": "^5.1.1",
1014
"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"
1219
},
1320
"scripts": {
1421
"start": "react-scripts start",

public/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
-->
1616
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
1717

18+
<script src="https://cdn.rawgit.com/progers/pathseg/master/pathseg.js"></script>
19+
20+
1821
<link
1922
rel="stylesheet"
2023
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"

src/App.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
import React from "react";
1+
import React, { Component } from "react";
2+
23
import "./App.css";
34
import { BrowserRouter } from "react-router-dom";
45

56
import "bootstrap/dist/css/bootstrap.min.css";
67
import IndexRoutes from "./routes";
78

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+
}
1619
}
1720

1821
export default App;

src/components/HomePage/index.js

Lines changed: 143 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,152 @@
11
import React, { Component } from "react";
2-
import Navbar from "../Navbar";
32

4-
import BookList from "./BookList";
3+
import Particles from "react-particles-js";
4+
//import Bookcase from "../../templates/images/bookcase.jpg";
55

6-
class HomePage extends Component {
6+
export default class HomePage extends Component {
77
render() {
88
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>
1527
</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>
17150
);
18151
}
19152
}
20-
export default HomePage;

src/components/Navbar/index.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,26 @@ import React, { Component } from "react";
22

33
import { Navbar, Nav } from "react-bootstrap";
44

5+
import Web3 from "web3";
6+
57
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+
625
render() {
726
return (
827
<div>
@@ -11,11 +30,11 @@ export default class Navbar1 extends Component {
1130
<Navbar.Toggle aria-controls="responsive-navbar-nav" />
1231
<Navbar.Collapse id="responsive-navbar-nav">
1332
<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>
1635
</Nav>
1736
<Nav>
18-
<Nav.Link href="/User">User</Nav.Link>
37+
<Nav.Link href="/user">{this.state.account}</Nav.Link>
1938
</Nav>
2039
</Navbar.Collapse>
2140
</Navbar>

src/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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";
66

7-
ReactDOM.render(<App />, document.getElementById('root'));
7+
ReactDOM.render(<App />, document.getElementById("root"));
88

99
// If you want your app to work offline and load faster, you can change
1010
// unregister() to register() below. Note this comes with some pitfalls.

src/routes/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
import React from "react";
22
import { Switch, Route } from "react-router-dom";
33

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";
49
import HomePage from "../components/HomePage";
10+
import UserBookList from "../components/UserBookList";
511

612
const IndexRoutes = () => {
713
return (
814
<Switch>
915
<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} />
1021
</Switch>
1122
);
1223
};

0 commit comments

Comments
 (0)