Skip to content

Commit 64be8dc

Browse files
committed
replaced mdi dependency with react-icons
1 parent 208c967 commit 64be8dc

File tree

4 files changed

+10
-28
lines changed

4 files changed

+10
-28
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"flux": "^2.1.1",
3232
"html-webpack-plugin": "2.28.0",
3333
"ignore-styles": "^5.0.1",
34-
"mdi": "^1.8.36",
3534
"mocha": "^2.4.5",
3635
"node-sass": "^3.8.0",
3736
"react": "^15.4.2",
@@ -40,6 +39,7 @@
4039
"react-css-themr": "2.0.0",
4140
"react-dom": "^15.4.2",
4241
"react-hot-loader": "^3.0.0-beta.6",
42+
"react-icons": "^2.2.3",
4343
"react-style-proptype": "^2.0.1",
4444
"resolve-url-loader": "1.6.1",
4545
"sass-loader": "^4.0.0",

src/js/components/JsonObject.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import React from "react";
22
import {toType} from './../helpers/util';
33
import JsonObject from './JsonObject';
44

5+
import CirclePlus from 'react-icons/lib/md/add-circle-outline';
6+
import CircleMinus from 'react-icons/lib/md/remove-circle-outline';
7+
58
const DEPTH_OFFSET = 1
69

710
export default class extends React.Component {
@@ -38,14 +41,13 @@ export default class extends React.Component {
3841
const {depth, src, name, ...rest} = this.props;
3942
const {expanded} = this.state;
4043
const expanded_class = expanded ? "expanded" : "collapsed";
44+
45+
const expanded_icon = expanded ? <CircleMinus /> : <CirclePlus />;
46+
4147
return (<div class="object-key-val">
4248
<div onClick={this.toggleExpanded} class="open-brace brace-row">
4349
<div class={"icon-container " + expanded_class}>
44-
<i class={
45-
"mdi mdi-"
46-
+ (expanded ? 'minus' : 'plus')
47-
+ "-circle-outline"
48-
}></i>
50+
{expanded_icon /*mdi icon*/}
4951
</div>
5052
<div class="object-name">{
5153
(name ? name : '')

src/js/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import JsonObject from './components/JsonObject';
44
//global style
55
//TODO make this theme customizable
66
require('./../style/app-globals.scss');
7-
//material design icons
8-
require("mdi/css/materialdesignicons.min.css");
97

108

119
//forward src through to JsonObject component

src/style/app-globals.scss

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@
1111
display: inline-block;
1212

1313
}
14-
// &:hover {
15-
// .mdi {
16-
// &.mdi-plus-circle-outline {
17-
// color: $magenta;
18-
// }
19-
// &.mdi-minus-circle-outline {
20-
// color: $green;
21-
// }
22-
// }
23-
// }
2414

2515
.icon-container {
2616
-webkit-transition: all 0.2s ease-out;
@@ -30,24 +20,16 @@
3020
transition: all 0.2s ease-out;
3121

3222
&.expanded {
33-
.mdi {
23+
svg {
3424
color: $cyan;
3525
}
3626
}
3727
&.collapsed {
38-
.mdi {
28+
svg {
3929
color: $magenta;
4030
}
4131
}
4232

43-
.mdi {
44-
45-
&.mdi-plus-circle-outline {
46-
}
47-
&.mdi-minus-circle-outline {
48-
}
49-
}
50-
5133
}
5234

5335
.brace {

0 commit comments

Comments
 (0)