Skip to content

Commit ca66ce7

Browse files
committed
remove classnames dependency
1 parent 419e3d8 commit ca66ce7

File tree

12 files changed

+39
-46
lines changed

12 files changed

+39
-46
lines changed

lib/components/Alert/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ var React = require('react');
1717
var react_redux_1 = require('react-redux');
1818
var actions_1 = require('../../actions');
1919
var Snackbar_1 = require('material-ui/Snackbar');
20-
var classNames = require('classnames');
2120
var defaultAlert = {
2221
message: '',
2322
open: false,
@@ -30,7 +29,7 @@ var Alert = (function (_super) {
3029
Alert.prototype.render = function () {
3130
var _a = this.props, alert = _a.alert, alertToggle = _a.alertToggle;
3231
var action = alert.action, open = alert.open, message = alert.message, duration = alert.duration;
33-
return (React.createElement(Snackbar_1.default, {className: classNames('cr-alert', action), open: open || false, message: message || '', action: action, autoHideDuration: duration || 2000, onActionTouchTap: alertToggle, onRequestClose: alertToggle}));
32+
return (React.createElement(Snackbar_1.default, {className: "cr-alert " + action, open: open || false, message: message || '', action: action, autoHideDuration: duration || 2000, onActionTouchTap: alertToggle, onRequestClose: alertToggle}));
3433
};
3534
Alert = __decorate([
3635
react_redux_1.connect(null, function (dispatch) {

lib/services/system.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"use strict";
2-
exports.isWindows = navigator.appVersion.indexOf('Win') > -1;
2+
exports.isWindows = window.navigator.appVersion.indexOf('Win') > -1 || false;

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"atom": ">=1.0.0 <2.0.0"
3939
},
4040
"dependencies": {
41-
"classnames": "2.2.4",
4241
"highlights": "1.3.1",
4342
"marked": "0.3.5",
4443
"material-ui": "0.15.0-beta.2",
@@ -49,7 +48,10 @@
4948
"redux": "3.5.2"
5049
},
5150
"scripts": {
52-
"test": "ava",
51+
"test": "ava src/**/*.spec.js",
5352
"compile": "tsc"
53+
},
54+
"devDependencies": {
55+
"ava": "^0.14.0"
5456
}
5557
}

src/components/Alert/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as React from 'react';
22
import {connect} from 'react-redux';
33
import {alertToggle} from '../../actions';
44
import Snackbar from 'material-ui/Snackbar';
5-
const classNames = require('classnames');
65

76
const defaultAlert = {
87
message: '',
@@ -22,7 +21,7 @@ export class Alert extends React.Component<{
2221
const {action, open, message, duration} = alert;
2322
return (
2423
<Snackbar
25-
className={classNames('cr-alert', action)}
24+
className={`cr-alert ${action}`}
2625
open={open || false}
2726
message={message || ''}
2827
action={action}

src/components/Progress/ProgressPage/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as React from 'react';
22
import {connect} from 'react-redux';
33
import {pageSet, routeSet, testsLoad} from '../../../actions';
4-
import * as classnames from 'classnames';
54
import {ListItem} from 'material-ui/List';
65
import {progressIcon} from '../progressIcon';
76
import {grey400} from 'material-ui/styles/colors';

src/reducers/reducer.spec.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// import {expect} from 'chai';
2+
// import {reducer} from '../../lib/store/';
3+
//
4+
// describe('Reducer:', () => {
5+
//
6+
// it('should return the state if the action is not found', () => {
7+
// const action = {type: 'NON-EXISTING-ACTION' };
8+
// expect(reducer({}, action)).to.be.an('object');
9+
// });
10+
//
11+
// });
12+
13+
import test from 'ava';
14+
import {
15+
reducer
16+
} from '../../lib/store/index';
17+
18+
test('returns defaults if the action is not found', t => {
19+
const action = {
20+
type: 'NON-EXISTING-ACTION'
21+
};
22+
const state = reducer({}, action);
23+
console.log('STATE', state);
24+
t.is(typeof state, 'object');
25+
});

src/reducers/reducer.spec.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/reducers/tutorials/check.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ export function searchForTutorials(deps: Object): Tutorial.Info[] {
1717

1818
// no package.json
1919
if (!fileExists(pathToTutorialPackageJson)) {
20-
console.log(`Error with ${name}: no package.json file found. ${tutorialError}`);
20+
console.log(
21+
`Error with ${name}: no package.json file found. ${tutorialError}`
22+
);
2123
return {
2224
name,
2325
version: 'NOT INSTALLED'
2426
};
2527
}
2628

27-
let tutorialPackageJson = JSON.parse(readFileSync(pathToTutorialPackageJson, 'utf8'));
29+
let tutorialPackageJson = JSON.parse(
30+
readFileSync(pathToTutorialPackageJson, 'utf8')
31+
);
2832
const version = tutorialPackageJson.version;
2933

3034
return {

src/services/system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const isWindows = navigator.appVersion.indexOf('Win') > -1;
1+
export const isWindows = window.navigator.appVersion.indexOf('Win') > -1 || false;

src/typings/classnames/classnames.d.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/typings/tsd.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/// <reference path="assertion-error/assertion-error.d.ts" />
22
/// <reference path="atom/atom.d.ts" />
3-
/// <reference path="classnames/classnames.d.ts" />
43
/// <reference path="es6-promise/es6-promise.d.ts" />
54
/// <reference path="node/node.d.ts" />
65
/// <reference path="react-dom/react-dom.d.ts" />

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"files": [
2424
"src/typings/assertion-error/assertion-error.d.ts",
2525
"src/typings/atom/atom.d.ts",
26-
"src/typings/classnames/classnames.d.ts",
2726
"src/typings/cr/cr.d.ts",
2827
"src/typings/cr/globals.d.ts",
2928
"src/typings/cr/test.d.ts",

0 commit comments

Comments
 (0)