Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Commit 8362cfa

Browse files
committed
removes Icon dependency, use react-bootstrap Glyphicon instead
1 parent 8737535 commit 8362cfa

File tree

8 files changed

+31
-18
lines changed

8 files changed

+31
-18
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
"grunt-contrib-requirejs": "~0.4.1",
4848
"grunt-shell": "~0.6.4",
4949
"grunt-contrib-copy": "~0.5.0"
50-
50+
},
51+
"dependencies": {
52+
"react-bootstrap": "^0.11.1"
5153
}
52-
}
54+
}

src/DateTimeField.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
/** @jsx React.DOM */
33
import React from './react-es6';
44
import DateTimePicker from './DateTimePicker';
5-
var DateTimeField;
5+
var DateTimeField, Glyphicon;
6+
7+
Glyphicon = require('react-bootstrap/Glyphicon');
68

79
DateTimeField = React.createClass({
810
propTypes: {
@@ -268,7 +270,7 @@ DateTimeField = React.createClass({
268270
/>
269271
<div className="input-group date" ref="datetimepicker">
270272
<input type="text" className="form-control" onChange={this.onChange} value={this.state.selectedDate.format("MM/DD/YY h:mm A")} />
271-
<span className="input-group-addon" onClick={this.onClick} onBlur={this.onBlur} ref="dtpbutton"><Icon name="calendar" type="glyphicon" /></span>
273+
<span className="input-group-addon" onClick={this.onClick} onBlur={this.onBlur} ref="dtpbutton"><Glyphicon glyph="calendar" /></span>
272274
</div>
273275
</div>
274276
);

src/DateTimePicker.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
import React from './react-es6';
44
import DateTimePickerDate from './DateTimePickerDate';
55
import DateTimePickerTime from './DateTimePickerTime';
6-
var DateTimePicker;
6+
var DateTimePicker, Glyphicon;
7+
8+
Glyphicon = require('react-bootstrap/Glyphicon');
79

810
DateTimePicker = React.createClass({
911
propTypes: {
@@ -72,7 +74,7 @@ DateTimePicker = React.createClass({
7274

7375
{this.renderDatePicker()}
7476

75-
<a className="btn btn-default picker-switch" style={{width:'100%'}} onClick={this.props.togglePicker}><Icon name={this.props.showTimePicker ? 'calendar' : 'time'} type="glyphicon" /></a>
77+
<a className="btn btn-default picker-switch" style={{width:'100%'}} onClick={this.props.togglePicker}><Glyphicon name={this.props.showTimePicker ? 'calendar' : 'time'} /></a>
7678

7779
{this.renderTimePicker()}
7880

src/DateTimePickerTime.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
import React from './react-es6';
44
import DateTimePickerMinutes from './DateTimePickerMinutes';
55
import DateTimePickerHours from './DateTimePickerHours';
6-
var DateTimePickerTime;
6+
var DateTimePickerTime, Glyphicon;
7+
8+
Glyphicon = require('react-bootstrap/Glyphicon');
79

810
DateTimePickerTime = React.createClass({
911
propTypes: {
@@ -62,11 +64,11 @@ DateTimePickerTime = React.createClass({
6264
<table className="table-condensed">
6365
<tbody>
6466
<tr>
65-
<td><a className="btn" onClick={this.props.addHour}><Icon name="chevron-up" type="glyphicon" /></a></td>
67+
<td><a className="btn" onClick={this.props.addHour}><Glyphicon glyph="chevron-up" /></a></td>
6668

6769
<td className="separator"></td>
6870

69-
<td><a className="btn" onClick={this.props.addMinute}><Icon name="chevron-up" type="glyphicon" /></a></td>
71+
<td><a className="btn" onClick={this.props.addMinute}><Glyphicon glyph="chevron-up" /></a></td>
7072

7173
<td className="separator"></td>
7274
</tr>
@@ -84,11 +86,11 @@ DateTimePickerTime = React.createClass({
8486
</tr>
8587

8688
<tr>
87-
<td><a className="btn" onClick={this.props.subtractHour}><Icon name="chevron-down" type="glyphicon" /></a></td>
89+
<td><a className="btn" onClick={this.props.subtractHour}><Glyphicon glyph="chevron-down" /></a></td>
8890

8991
<td className="separator"></td>
9092

91-
<td><a className="btn" onClick={this.props.subtractMinute}><Icon name="chevron-down" type="glyphicon" /></a></td>
93+
<td><a className="btn" onClick={this.props.subtractMinute}><Glyphicon glyph="chevron-down" /></a></td>
9294

9395
<td className="separator"></td>
9496
</tr>

src/coffee/DateTimeField.jsx.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
`import React from './react-es6'`
44
`import DateTimePicker from './DateTimePicker'`
5+
Glyphicon = require('react-bootstrap/Glyphicon')
56

67
DateTimeField = React.createClass(
78

@@ -242,7 +243,7 @@ DateTimeField = React.createClass(
242243
/>
243244
<div className="input-group date" ref="datetimepicker">
244245
<input type="text" className="form-control" onChange={this.onChange} value={this.state.selectedDate.format("MM/DD/YY h:mm A")} />
245-
<span className="input-group-addon" onClick={this.onClick} onBlur={this.onBlur} ref="dtpbutton"><Icon name="calendar" type="glyphicon" /></span>
246+
<span className="input-group-addon" onClick={this.onClick} onBlur={this.onBlur} ref="dtpbutton"><Glyphicon glyph="calendar" /></span>
246247
</div>
247248
</div>
248249
)`

src/coffee/DateTimePicker.jsx.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
`import React from './react-es6'`
44
`import DateTimePickerDate from './DateTimePickerDate'`
55
`import DateTimePickerTime from './DateTimePickerTime'`
6+
Glyphicon = require('react-bootstrap/Glyphicon')
67

78
DateTimePicker = React.createClass(
89

@@ -72,7 +73,7 @@ DateTimePicker = React.createClass(
7273

7374
{this.renderDatePicker()}
7475

75-
<a className="btn btn-default picker-switch" style={{width:'100%'}} onClick={this.props.togglePicker}><Icon name={this.props.showTimePicker ? 'calendar' : 'time'} type="glyphicon" /></a>
76+
<a className="btn btn-default picker-switch" style={{width:'100%'}} onClick={this.props.togglePicker}><Glyphicon name={this.props.showTimePicker ? 'calendar' : 'time'} /></a>
7677

7778
{this.renderTimePicker()}
7879

src/coffee/DateTimePickerTime.jsx.coffee

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
`import React from './react-es6'`
44
`import DateTimePickerMinutes from './DateTimePickerMinutes'`
55
`import DateTimePickerHours from './DateTimePickerHours'`
6-
6+
Glyphicon = require('react-bootstrap/Glyphicon')
77

88
DateTimePickerTime = React.createClass(
99

@@ -55,11 +55,11 @@ DateTimePickerTime = React.createClass(
5555
<table className="table-condensed">
5656
<tbody>
5757
<tr>
58-
<td><a className="btn" onClick={this.props.addHour}><Icon name="chevron-up" type="glyphicon" /></a></td>
58+
<td><a className="btn" onClick={this.props.addHour}><Glyphicon glyph="chevron-up" /></a></td>
5959

6060
<td className="separator"></td>
6161

62-
<td><a className="btn" onClick={this.props.addMinute}><Icon name="chevron-up" type="glyphicon" /></a></td>
62+
<td><a className="btn" onClick={this.props.addMinute}><Glyphicon glyph="chevron-up" /></a></td>
6363

6464
<td className="separator"></td>
6565
</tr>
@@ -77,11 +77,11 @@ DateTimePickerTime = React.createClass(
7777
</tr>
7878

7979
<tr>
80-
<td><a className="btn" onClick={this.props.subtractHour}><Icon name="chevron-down" type="glyphicon" /></a></td>
80+
<td><a className="btn" onClick={this.props.subtractHour}><Glyphicon glyph="chevron-down" /></a></td>
8181

8282
<td className="separator"></td>
8383

84-
<td><a className="btn" onClick={this.props.subtractMinute}><Icon name="chevron-down" type="glyphicon" /></a></td>
84+
<td><a className="btn" onClick={this.props.subtractMinute}><Glyphicon glyph="chevron-down" /></a></td>
8585

8686
<td className="separator"></td>
8787
</tr>

tools/cjs/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@
2020
},
2121
"peerDependencies": {
2222
"react": ">=0.9"
23+
},
24+
"dependencies": {
25+
"react-bootstrap": "^0.11.1"
2326
}
2427
}

0 commit comments

Comments
 (0)