Skip to content

Commit 77f8096

Browse files
committed
refactor: Dashboard.js, README.md
1 parent de8d1a8 commit 77f8096

File tree

2 files changed

+21
-26
lines changed

2 files changed

+21
-26
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ CoreUI is meant to be the UX game changer. Pure & transparent code is devoid of
1515
* [Versions](#versions)
1616
* [CoreUI Pro](#coreui-pro)
1717
* [Installation](#installation)
18-
* [Usage](#usage)
18+
* [Create React App](#create-react-app)
19+
* [Usage](#basic-usage)
1920
* [What's included](#whats-included)
2021
* [Documentation](#documentation)
2122
* [Contributing](#contributing)
@@ -85,19 +86,19 @@ Within the download you'll find the following directories and files, logically g
8586

8687
```
8788
CoreUI-React#v2.0.0
88-
├── public/ (static files)
89-
│ ├── assets/ (assets)
90-
│ └── index.html (html temlpate)
89+
├── public/ #static files
90+
│ ├── assets/ #assets
91+
│ └── index.html #html temlpate
9192
92-
├── src/ (project root)
93-
│ ├── containers/ (container source)
94-
│ ├── scss/ (scss/css source)
95-
│ ├── views/ (views source)
93+
├── src/ #project root
94+
│ ├── containers/ #container source
95+
│ ├── scss/ #user scss/css source
96+
│ ├── views/ #views source
9697
│ ├── App.js
9798
│ ├── App.test.js
9899
│ ├── index.js
99-
│ ├── _nav.js (sidebar config)
100-
│ └── routes.js (routes config)
100+
│ ├── _nav.js #sidebar config
101+
│ └── routes.js #routes config
101102
102103
└── package.json
103104
```
@@ -121,12 +122,10 @@ See [the Releases section of our project](https://github.com/mrholek/CoreUI-Reac
121122
## Creators
122123

123124
**Łukasz Holeczek**
124-
125125
* <https://twitter.com/lukaszholeczek>
126126
* <https://github.com/mrholek>
127127

128128
**Andrzej Kopański**
129-
130129
* <https://github.com/xidedix>
131130

132131
## Community

src/views/Dashboard/Dashboard.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,11 @@ const sparklineChartOpts = {
336336
// convert Hex to RGBA
337337
function convertHex(hex, opacity) {
338338
hex = hex.replace('#', '');
339-
var r = parseInt(hex.substring(0, 2), 16);
340-
var g = parseInt(hex.substring(2, 4), 16);
341-
var b = parseInt(hex.substring(4, 6), 16);
339+
const r = parseInt(hex.substring(0, 2), 16);
340+
const g = parseInt(hex.substring(2, 4), 16);
341+
const b = parseInt(hex.substring(4, 6), 16);
342342

343-
var result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
343+
const result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')';
344344
return result;
345345
}
346346

@@ -349,12 +349,12 @@ function random(min, max) {
349349
return Math.floor(Math.random() * (max - min + 1) + min);
350350
}
351351

352-
var elements = 27;
352+
const elements = 27;
353353
var data1 = [];
354354
var data2 = [];
355355
var data3 = [];
356356

357-
for (var i = 0; i <= elements; i++) {
357+
for (let i = 0; i <= elements; i++) {
358358
data1.push(random(50, 200));
359359
data2.push(random(80, 100));
360360
data3.push(65);
@@ -457,8 +457,7 @@ class Dashboard extends Component {
457457
<Card className="text-white bg-primary">
458458
<CardBody className="pb-0">
459459
<ButtonGroup className="float-right">
460-
<ButtonDropdown id='card1' isOpen={this.state.card1}
461-
toggle={() => { this.setState({ card1: !this.state.card1 }); }}>
460+
<ButtonDropdown id='card1' isOpen={this.state.card1} toggle={() => { this.setState({ card1: !this.state.card1 }); }}>
462461
<DropdownToggle caret className="p-0" color="transparent">
463462
<i className="icon-settings"></i>
464463
</DropdownToggle>
@@ -483,8 +482,7 @@ class Dashboard extends Component {
483482
<Card className="text-white bg-info">
484483
<CardBody className="pb-0">
485484
<ButtonGroup className="float-right">
486-
<Dropdown id='card2' isOpen={this.state.card2}
487-
toggle={() => { this.setState({ card2: !this.state.card2 }); }}>
485+
<Dropdown id='card2' isOpen={this.state.card2} toggle={() => { this.setState({ card2: !this.state.card2 }); }}>
488486
<DropdownToggle className="p-0" color="transparent">
489487
<i className="icon-___location-pin"></i>
490488
</DropdownToggle>
@@ -508,8 +506,7 @@ class Dashboard extends Component {
508506
<Card className="text-white bg-warning">
509507
<CardBody className="pb-0">
510508
<ButtonGroup className="float-right">
511-
<Dropdown id='card3' isOpen={this.state.card3}
512-
toggle={() => { this.setState({ card3: !this.state.card3 }); }}>
509+
<Dropdown id='card3' isOpen={this.state.card3} toggle={() => { this.setState({ card3: !this.state.card3 }); }}>
513510
<DropdownToggle caret className="p-0" color="transparent">
514511
<i className="icon-settings"></i>
515512
</DropdownToggle>
@@ -533,8 +530,7 @@ class Dashboard extends Component {
533530
<Card className="text-white bg-danger">
534531
<CardBody className="pb-0">
535532
<ButtonGroup className="float-right">
536-
<ButtonDropdown id='card4' isOpen={this.state.card4}
537-
toggle={() => { this.setState({ card4: !this.state.card4 }); }}>
533+
<ButtonDropdown id='card4' isOpen={this.state.card4} toggle={() => { this.setState({ card4: !this.state.card4 }); }}>
538534
<DropdownToggle caret className="p-0" color="transparent">
539535
<i className="icon-settings"></i>
540536
</DropdownToggle>

0 commit comments

Comments
 (0)