Skip to content

Commit d141552

Browse files
committed
💫: refactor code
1 parent 42fb1e7 commit d141552

17 files changed

+8066
-4499
lines changed

‎.eslintrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"extends": "react-app",
3-
"plugins": ["prettier"],
3+
"plugins": [
4+
"prettier"
5+
],
46
"rules": {
57
"prettier/prettier": "error"
68
}

‎.prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"semi": true,
77
"bracketSpacing": true,
88
"endOfLine": "auto"
9-
}
9+
}

‎.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
language: node_js
22

33
node_js:
4-
- '8'
4+
- '8'
55

66
cache:
77
yarn: true
88
directories:
9-
- node_modules
9+
- node_modules
1010

1111
install:
1212
- yarn

‎README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
# algos-web
2+
23
[![Build Status](https://travis-ci.org/iiitv/algos-web.svg?branch=master)](https://travis-ci.org/iiitv/algos-web)
34

45
## Guidelines
5-
* Add tests relevant to a component or service.
6+
7+
- Add tests relevant to a component or service.
68

79
## Useful commands
810

911
### Install the dependencies
12+
1013
```
11-
yarn
14+
yarn
1215
```
1316

1417
### Run
18+
1519
```
1620
yarn start
1721
yarn build
@@ -20,8 +24,8 @@ yarn test
2024

2125
### Deploy
2226

23-
*Requires push access, use carefully.*
27+
_Requires push access, use carefully._
2428

2529
```
2630
yarn deploy
27-
```
31+
```

‎package.json

+26-14
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
"private": true,
55
"homepage": "https://algos-web.netlify.com",
66
"dependencies": {
7-
"axios": "^0.18.1",
8-
"react": "16.7.0-alpha.2",
9-
"react-dom": "^16.5.0",
10-
"react-redux": "^5.0.7",
11-
"react-router-dom": "^4.3.1",
12-
"react-scripts": "1.1.5",
7+
"axios": "^0.20.0",
8+
"react": "^16.13.1",
9+
"react-dom": "^16.13.1",
10+
"react-redux": "^7.2.1",
11+
"react-router-dom": "^5.2.0",
12+
"react-scripts": "3.4.3",
1313
"react-springy-parallax": "^1.3.0",
14-
"redux": "^4.0.0",
15-
"redux-devtools-extension": "^2.13.7",
14+
"redux": "^4.0.5",
15+
"redux-devtools-extension": "^2.13.8",
1616
"redux-thunk": "^2.3.0",
17-
"uikit": "^3.0.0-rc.24"
17+
"uikit": "^3.5.7"
1818
},
1919
"scripts": {
2020
"start": "react-scripts start",
@@ -25,11 +25,23 @@
2525
"deploy": "gh-pages -d build",
2626
"precommit": "pretty-quick --staged"
2727
},
28+
"browserslist": {
29+
"production": [
30+
">0.2%",
31+
"not dead",
32+
"not op_mini all"
33+
],
34+
"development": [
35+
"last 1 chrome version",
36+
"last 1 firefox version",
37+
"last 1 safari version"
38+
]
39+
},
2840
"devDependencies": {
29-
"eslint-plugin-prettier": "^3.0.0",
30-
"gh-pages": "^1.2.0",
31-
"husky": "^1.2.1",
32-
"prettier": "1.15.3",
33-
"pretty-quick": "^1.8.0"
41+
"eslint-plugin-prettier": "^3.1.4",
42+
"gh-pages": "^3.1.0",
43+
"husky": "^4.2.5",
44+
"prettier": "^2.1.1",
45+
"pretty-quick": "^3.0.0"
3446
}
3547
}

‎src/components/App.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import React from 'react';
22
// import { PropTypes } from "prop-types";
33

4-
import Header from "./common/Header";
4+
import Header from './common/Header';
55

66
class App extends React.Component {
7-
8-
render () {
7+
render() {
98
return (
109
<div>
1110
{this.props.children}
12-
<Header/>
11+
<Header />
1312
</div>
1413
);
1514
}

‎src/components/common/Header.js

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
import React, { Component } from "react";
2-
import { BrowserRouter, Link } from "react-router-dom";
1+
import React, { Component } from 'react';
2+
import { BrowserRouter, Link } from 'react-router-dom';
33

44
class Header extends Component {
55
render() {
66
return (
77
<div>
8-
<nav className="uk-navbar-container uk-navbar-transparent" uk-navbar="true">
9-
<div className="uk-navbar-left">
8+
<nav className="uk-navbar-container uk-navbar-transparent" uk-navbar="true">
9+
<div className="uk-navbar-left">
1010
<BrowserRouter>
11-
<ul className="uk-navbar-nav">
12-
<li><Link to="/">Home</Link></li>
13-
<li><Link to="/home">Algos</Link></li>
14-
</ul>
11+
<ul className="uk-navbar-nav">
12+
<li>
13+
<Link to="/">Home</Link>
14+
</li>
15+
<li>
16+
<Link to="/home">Algos</Link>
17+
</li>
18+
</ul>
1519
</BrowserRouter>
16-
</div>
20+
</div>
1721
</nav>
1822
</div>
1923
);

‎src/components/home/HomePage.js

+20-15
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,34 @@ class HomePage extends Component {
55
render() {
66
return (
77
<div className="HomePage">
8-
<div className="uk-grid">
9-
<div className="uk-width-1-5@s" style={{ background: "#0e0b0bb3", color: "white" }}>
10-
<div className="uk-offcanvas-content">
11-
<button className="uk-button uk-button-default uk-margin-small-right" type="button" data-uk-toggle="target: #offcanvas-push">Push</button>
8+
<div className="uk-grid">
9+
<div className="uk-width-1-5@s" style={{ background: '#0e0b0bb3', color: 'white' }}>
10+
<div className="uk-offcanvas-content">
11+
<button
12+
className="uk-button uk-button-default uk-margin-small-right"
13+
type="button"
14+
data-uk-toggle="target: #offcanvas-push"
15+
>
16+
Push
17+
</button>
1218

13-
<div id="offcanvas-push" data-uk-offcanvas="mode: push; overlay: true">
14-
<div className="uk-offcanvas-bar">
19+
<div id="offcanvas-push" data-uk-offcanvas="mode: push; overlay: true">
20+
<div className="uk-offcanvas-bar">
21+
<button className="uk-offcanvas-close" type="button" data-uk-close="true"></button>
1522

16-
<button className="uk-offcanvas-close" type="button" data-uk-close="true"></button>
23+
<h3>Algorithms</h3>
1724

18-
<h3>Algorithms</h3>
19-
20-
<p>Comming soon.</p>
21-
</div>
25+
<p>Comming soon.</p>
2226
</div>
2327
</div>
2428
</div>
25-
<div className="uk-width-4-5@s">
26-
<div style={{ background: "blue" }} className="uk-padding-small">
27-
<p>yomo</p>
28-
</div>
29+
</div>
30+
<div className="uk-width-4-5@s">
31+
<div style={{ background: 'blue' }} className="uk-padding-small">
32+
<p>yomo</p>
2933
</div>
3034
</div>
35+
</div>
3136
</div>
3237
);
3338
}

‎src/components/welcome/Header.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,13 @@ class Header extends Component {
3030
}
3131
}
3232

33-
const mapStateToProps = state => ({
33+
const mapStateToProps = (state) => ({
3434
gh: state.gh,
3535
});
3636

37-
const mapDispatchToProps = dispatch => ({
37+
const mapDispatchToProps = (dispatch) => ({
3838
loading: () => dispatch(loading()),
3939
loaded: () => dispatch(loaded()),
4040
});
4141

42-
export default connect(
43-
mapStateToProps,
44-
mapDispatchToProps
45-
)(withRouter(Header));
42+
export default connect(mapStateToProps, mapDispatchToProps)(withRouter(Header));
+58-70
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,63 @@
11
import React, { Component } from 'react';
2-
import Parallax from 'react-springy-parallax'
3-
import { Link } from 'react-router-dom'
2+
import Parallax from 'react-springy-parallax';
3+
import { Link } from 'react-router-dom';
44

5-
import Header from './Header'
6-
import stars from '../../static/img/Endless-Constellation.svg'
7-
import Coding from '../../static/img/coding.png'
8-
import DryRun from '../../static/img/code.png'
9-
import Screen from '../../static/img/screen.png'
10-
import './HomeComponent.css'
5+
import Header from './Header';
6+
import stars from '../../static/img/Endless-Constellation.svg';
7+
import Coding from '../../static/img/coding.png';
8+
import DryRun from '../../static/img/code.png';
9+
import Screen from '../../static/img/screen.png';
10+
import './HomeComponent.css';
1111

1212
export default class HomeComponent extends Component {
13-
render() {
14-
const styles = {
15-
fontFamily: 'Menlo-Regular, Menlo, monospace',
16-
lineHeight: '10px',
17-
display: 'flex', alignItems: 'center', justifyContent: 'center'
18-
}
19-
20-
return (
21-
<Parallax ref="parallax" pages={3} style={{ backgroundImage: `url(${stars})` }}>
22-
<Parallax.Layer offset={0} speed={1} style={{ backgroundColor: '#243B4A', opacity: '0.5' }} />
23-
<Parallax.Layer offset={1} speed={1} style={{ backgroundColor: '#805E73', opacity: '0.5' }} />
24-
<Parallax.Layer offset={2} speed={1} style={{ backgroundColor: '#87BCDE', opacity: '0.5' }} />
25-
26-
<Parallax.Layer
27-
offset={0}
28-
style={styles}
29-
speed={0.5}
30-
onClick={() => this.refs.parallax.scrollTo(1)}>
31-
<Header />
32-
</Parallax.Layer>
33-
34-
<Parallax.Layer
35-
offset={1.05}
36-
style={{ pointerEvents: 'none' }}
37-
speed={-0.3}>
38-
<img alt="text-editor" className='image-text-editor' src={Coding} />
39-
</Parallax.Layer>
40-
41-
<Parallax.Layer
42-
offset={1}
43-
style={styles}
44-
speed={1}
45-
onClick={() => this.refs.parallax.scrollTo(2)}>
46-
<h2 className='middle-container-heading'>Explore the <br />'Ocean of Data Structures and Algorithms'</h2>
47-
</Parallax.Layer>
48-
49-
<Parallax.Layer
50-
offset={1.75}
51-
speed={1.6}>
52-
<img alt="file_1" src={DryRun} style={{ opacity: '0.4', width: '20%', marginLeft: '10%' }} />
53-
<img alt="file_2" src={DryRun} style={{ opacity: '0.4', width: '20%', marginLeft: '40%' }} />
54-
</Parallax.Layer>
55-
56-
<Parallax.Layer
57-
offset={2.2}
58-
speed={+0.6}>
59-
<img alt="laptop" src={Screen} className='footer-image' />
60-
</Parallax.Layer>
61-
62-
<Parallax.Layer
63-
offset={2}
64-
style={styles}
65-
speed={1}
66-
onClick={() => this.refs.parallax.scrollTo(0)}>
67-
<div>
68-
<h4 className='footer-heading'>Hola Guys!</h4>
69-
<h5 className='footer-link'><Link to='/home'>Visit the Home page</Link></h5>
70-
</div>
71-
</Parallax.Layer>
72-
</Parallax>
73-
)
74-
}
13+
render() {
14+
const styles = {
15+
fontFamily: 'Menlo-Regular, Menlo, monospace',
16+
lineHeight: '10px',
17+
display: 'flex',
18+
alignItems: 'center',
19+
justifyContent: 'center',
20+
};
21+
22+
return (
23+
<Parallax ref="parallax" pages={3} style={{ backgroundImage: `url(${stars})` }}>
24+
<Parallax.Layer offset={0} speed={1} style={{ backgroundColor: '#243B4A', opacity: '0.5' }} />
25+
<Parallax.Layer offset={1} speed={1} style={{ backgroundColor: '#805E73', opacity: '0.5' }} />
26+
<Parallax.Layer offset={2} speed={1} style={{ backgroundColor: '#87BCDE', opacity: '0.5' }} />
27+
28+
<Parallax.Layer offset={0} style={styles} speed={0.5} onClick={() => this.refs.parallax.scrollTo(1)}>
29+
<Header />
30+
</Parallax.Layer>
31+
32+
<Parallax.Layer offset={1.05} style={{ pointerEvents: 'none' }} speed={-0.3}>
33+
<img alt="text-editor" className="image-text-editor" src={Coding} />
34+
</Parallax.Layer>
35+
36+
<Parallax.Layer offset={1} style={styles} speed={1} onClick={() => this.refs.parallax.scrollTo(2)}>
37+
<h2 className="middle-container-heading">
38+
Explore the <br />
39+
'Ocean of Data Structures and Algorithms'
40+
</h2>
41+
</Parallax.Layer>
42+
43+
<Parallax.Layer offset={1.75} speed={1.6}>
44+
<img alt="file_1" src={DryRun} style={{ opacity: '0.4', width: '20%', marginLeft: '10%' }} />
45+
<img alt="file_2" src={DryRun} style={{ opacity: '0.4', width: '20%', marginLeft: '40%' }} />
46+
</Parallax.Layer>
47+
48+
<Parallax.Layer offset={2.2} speed={+0.6}>
49+
<img alt="laptop" src={Screen} className="footer-image" />
50+
</Parallax.Layer>
51+
52+
<Parallax.Layer offset={2} style={styles} speed={1} onClick={() => this.refs.parallax.scrollTo(0)}>
53+
<div>
54+
<h4 className="footer-heading">Hola Guys!</h4>
55+
<h5 className="footer-link">
56+
<Link to="/home">Visit the Home page</Link>
57+
</h5>
58+
</div>
59+
</Parallax.Layer>
60+
</Parallax>
61+
);
62+
}
7563
}

0 commit comments

Comments
 (0)