Skip to content

Commit 833a165

Browse files
committed
fix: icons and style
1 parent 51204ae commit 833a165

File tree

6 files changed

+39
-36
lines changed

6 files changed

+39
-36
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ npm install --save mobx-react-form-devtools
2424
## Usage
2525

2626
```javascript
27-
import MobxReactFormDevTools from './mobx-react-form-devtools';
27+
import MobxReactFormDevTools from 'mobx-react-form-devtools';
28+
import 'mobx-react-form-devtools/style/devtools.css';';
2829
2930
// register forms
3031
MobxReactFormDevTools.register({
@@ -37,6 +38,13 @@ MobxReactFormDevTools.register({
3738
MobxReactFormDevTools.select('registerForm');
3839
```
3940
41+
## Link DevTools to Demo
42+
43+
```bash
44+
❯ git clone -b master [email protected]:foxhound87/mobx-react-form-devtools.git mobx-react-form-devtools--master
45+
❯ ln -s ../mobx-react-form-devtools--master ./mobx-react-form--demo/devtools
46+
```
47+
4048
## Contributing
4149
4250
If you want to contribute to the development, do not hesitate to fork the repo and send pull requests.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"devtools"
3737
],
3838
"files": [
39+
"style",
3940
"es6",
4041
"lib",
4142
"umd"
@@ -57,6 +58,7 @@
5758
"mobx-react": "^3.5.8",
5859
"react-dock": "0.2.3",
5960
"react-draggable": "^2.2.2",
61+
"react-icons": "2.2.1",
6062
"react-json-tree": "^0.10.0",
6163
"react-tooltip": "^3.2.1"
6264
},
@@ -73,8 +75,8 @@
7375
"babel-plugin-transform-class-properties": "6.16.0",
7476
"babel-plugin-transform-decorators-legacy": "1.3.4",
7577
"babel-preset-es2015": "6.16.0",
76-
"babel-preset-stage-0": "6.16.0",
7778
"babel-preset-react": "6.16.0",
79+
"babel-preset-stage-0": "6.16.0",
7880
"babel-register": "6.16.3",
7981
"chai": "3.5.0",
8082
"codecov": "1.0.1",
@@ -86,7 +88,6 @@
8688
"eslint-plugin-import": "1.16.0",
8789
"eslint-plugin-jsx-a11y": "2.2.3",
8890
"eslint-plugin-react": "6.4.1",
89-
"file-loader": "^0.9.0",
9091
"ghooks": "1.3.2",
9192
"mobx": "2.6.0",
9293
"mocha": "3.1.2",
@@ -98,9 +99,8 @@
9899
"react": "15.3.2",
99100
"react-dom": "15.3.2",
100101
"rimraf": "2.5.4",
101-
"semantic-release": "^4.3.5",
102-
"style-loader": "^0.13.1",
103-
"url-loader": "^0.5.7",
102+
"semantic-release": "4.3.5",
103+
"style-loader": "0.13.1",
104104
"webpack": "1.13.2"
105105
}
106106
}

src/Debug.jsx

+19-10
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,17 @@ import ReactTooltip from 'react-tooltip';
77
import JSONTree from 'react-json-tree';
88
import cx from 'classnames';
99
import _ from 'lodash';
10+
11+
import IconFaTh from 'react-icons/lib/fa/th';
12+
import IconFaBars from 'react-icons/lib/fa/bars';
13+
import IconFaCircleO from 'react-icons/lib/fa/circle-o';
14+
import IconFaBook from 'react-icons/lib/fa/book';
15+
import IconFaChevronLeft from 'react-icons/lib/fa/chevron-left';
16+
import IconFaChevronCircleRight from 'react-icons/lib/fa/chevron-circle-right';
17+
1018
import theme from './theme';
1119

20+
1221
/* map object */
1322
function mapo(object, callback) {
1423
return Object.keys(object).map(key =>
@@ -132,7 +141,7 @@ const SelectInitialForm = observer(({ store, actions }) =>
132141
value={key}
133142
onClick={e => handleInitialFormSelect(e, key, actions)}
134143
>
135-
<i className="fa fa-circle-o" /> {val}
144+
<IconFaCircleO className="icon" /> {val}
136145
</button>
137146
)}
138147
</div>
@@ -143,7 +152,7 @@ const RenderFormData = observer(({ store, actions }) =>
143152
<div className="tree">
144153
<h3 className="clearfix">
145154
<div className="left title">
146-
<i className="fa fa-th" /> Form
155+
<IconFaTh className="icon" /> Form
147156
</div>
148157
<div className="right select">
149158
<SelectMenu store={store} actions={actions} />
@@ -155,7 +164,7 @@ const RenderFormData = observer(({ store, actions }) =>
155164
theme={theme}
156165
isLightTheme={false}
157166
/>
158-
<h4><i className="fa fa-bars" /> Fields</h4>
167+
<h4><IconFaBars className="icon" /> Fields</h4>
159168
<JSONTree
160169
hideRoot
161170
data={parseFieldsData(store.selected.form.fields)}
@@ -180,19 +189,19 @@ export default observer(({ store, actions }) => (
180189

181190
<Draggable
182191
axis="y"
183-
handle=".handle"
192+
handle=".devtools-drag"
184193
zIndex={99999999999}
185194
defaultPosition={{ x: 0, y: 0 }}
186195
>
187196
<div className={cx('draggable', { hidden: tools.open })}>
188-
<div className="handle" data-tip="DRAG">
189-
<i className="fa fa-bars" />
197+
<div className="devtools-drag" data-tip="DRAG">
198+
<IconFaBars className="icon" />
190199
</div>
191200
<button onClick={handleOnOpenTools} data-tip="OPEN">
192-
<i className="fa fa-chevron-left" />
201+
<IconFaChevronLeft className="icon" />
193202
</button>
194203
<button onClick={handleOnOpenDoc} data-tip="DOCS">
195-
<i className="fa fa-book" />
204+
<IconFaBook className="icon" />
196205
</button>
197206
</div>
198207
</Draggable>
@@ -204,10 +213,10 @@ export default observer(({ store, actions }) => (
204213
<b className={cx({ hidden: !tools.heading.sub })}>DEVTOOLS</b>
205214
</div>
206215
<button className="right" onClick={handleOnCloseTools} data-tip="CLOSE">
207-
<i className="fa fa-chevron-circle-right" />
216+
<IconFaChevronCircleRight className="icon" />
208217
</button>
209218
<button className="right" onClick={handleOnOpenDoc} data-tip="DOCS">
210-
<i className="fa fa-book" />
219+
<IconFaBook className="icon" />
211220
</button>
212221
</div>
213222
{(store.selected.form && store.selected.key)

src/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
import DevTools from './DevTools';
2-
import './style.css';
32

43
export default DevTools;

src/style.css renamed to style/devtools.css

+6-10
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@
5757
background: #ebcb8b;
5858
}
5959

60-
.mobx-react-form-devtools .draggable i {
60+
.mobx-react-form-devtools .draggable .icon {
6161
font-size: 15px;
6262
}
6363

64-
.mobx-react-form-devtools .draggable .fa-bars {
64+
.mobx-react-form-devtools .draggable .devtools-drag .icon {
6565
font-size: 22px;
6666
color: #a7adba;
6767
}
@@ -118,17 +118,17 @@
118118
text-transform: uppercase;
119119
}
120120

121-
.mobx-react-form-devtools .draggable i {
121+
.mobx-react-form-devtools .draggable .icon {
122122
color: #2b303b;
123123
}
124124

125-
.mobx-react-form-devtools .heading button i {
125+
.mobx-react-form-devtools .heading button .icon {
126126
color: #a3be8c;
127127
font-size: 25px;
128128
margin: 10px 10px 0 0;
129129
}
130130

131-
.mobx-react-form-devtools .heading button i:hover {
131+
.mobx-react-form-devtools .heading button .icon:hover {
132132
color: #ebcb8b;
133133
}
134134

@@ -155,7 +155,7 @@
155155
background: #343d46;
156156
}
157157

158-
.mobx-react-form-devtools .initialMenu button i {
158+
.mobx-react-form-devtools .initialMenu button .icon {
159159
color: #ebcb8b;
160160
}
161161

@@ -184,10 +184,6 @@
184184
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAMCAYAAABSgIzaAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NDZFNDEwNjlGNzFEMTFFMkJEQ0VDRTM1N0RCMzMyMkIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NDZFNDEwNkFGNzFEMTFFMkJEQ0VDRTM1N0RCMzMyMkIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0NkU0MTA2N0Y3MUQxMUUyQkRDRUNFMzU3REIzMzIyQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0NkU0MTA2OEY3MUQxMUUyQkRDRUNFMzU3REIzMzIyQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PuGsgwQAAAA5SURBVHjaYvz//z8DOYCJgUxAf42MQIzTk0D/M+KzkRGPoQSdykiKJrBGpOhgJFYTWNEIiEeAAAMAzNENEOH+do8AAAAASUVORK5CYII=');
185185
}
186186

187-
.menu select {
188-
border: 1px solid #F87666;
189-
}
190-
191187
@media screen and (min-width: 0px) and (max-width: 450px) {
192188
.mobx-react-form-devtools { display: none; }
193189
}

webpack.config.babel.js

-9
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,9 @@ const loaders = [{
77
test: /\.jsx?$/,
88
exclude: /node_modules/,
99
loader: 'babel-loader',
10-
}, {
11-
test: /\.json$/,
12-
loader: 'json-loader',
1310
}, {
1411
test: /\.css$/,
1512
loader: 'style-loader!css-loader!postcss-loader',
16-
}, {
17-
test: /\.woff(2)?(\?v=[0-9].[0-9].[0-9])?$/,
18-
loader: 'url-loader?mimetype=application/font-woff',
19-
}, {
20-
test: /\.(ttf|eot|svg)(\?v=[0-9].[0-9].[0-9])?$/,
21-
loader: 'file-loader?name=[name].[ext]',
2213
}];
2314

2415
const postcss = $webpack => [

0 commit comments

Comments
 (0)