Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitca66ce7

Browse files
committed
remove classnames dependency
1 parent419e3d8 commitca66ce7

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
varreact_redux_1=require('react-redux');
1818
varactions_1=require('../../actions');
1919
varSnackbar_1=require('material-ui/Snackbar');
20-
varclassNames=require('classnames');
2120
vardefaultAlert={
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
varaction=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
importSnackbarfrom'material-ui/Snackbar';
5-
constclassNames=require('classnames');
65

76
constdefaultAlert={
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*asReactfrom'react';
22
import{connect}from'react-redux';
33
import{pageSet,routeSet,testsLoad}from'../../../actions';
4-
import*asclassnamesfrom'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+
importtestfrom'ava';
14+
import{
15+
reducer
16+
}from'../../lib/store/index';
17+
18+
test('returns defaults if the action is not found',t=>{
19+
constaction={
20+
type:'NON-EXISTING-ACTION'
21+
};
22+
conststate=reducer({},action);
23+
console.log('STATE',state);
24+
t.is(typeofstate,'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-
lettutorialPackageJson=JSON.parse(readFileSync(pathToTutorialPackageJson,'utf8'));
29+
lettutorialPackageJson=JSON.parse(
30+
readFileSync(pathToTutorialPackageJson,'utf8')
31+
);
2832
constversion=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-
exportconstisWindows=navigator.appVersion.indexOf('Win')>-1;
1+
exportconstisWindows=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)

[8]ページ先頭

©2009-2025 Movatter.jp