Skip to content

Commit

Permalink
update status manager
Browse files Browse the repository at this point in the history
  • Loading branch information
afeiship committed Mar 23, 2017
1 parent 32f75af commit f133441
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 38 deletions.
6 changes: 3 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# react-refresher
> React refresher for pull to refresh.
# react-status-manager
> React component for status manager.

## resource:
Expand All @@ -16,5 +16,5 @@

## usage:
```html
<react-refresher :visible="true" />
<react-status-manager :visible="true" />
```
4 changes: 2 additions & 2 deletions build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ base.entry = {
base.output = {
path: config.build.assetsRoot,
publicPath: config.build.assetsPublicPath,
filename: 'react-refresher.js',
library: 'ReactRefresher',
filename: 'react-status-manager.js',
library: 'ReactStatusManager',
libraryTarget: 'umd'
}

Expand Down
2 changes: 0 additions & 2 deletions dist/react-refresher.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/react-refresher.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions dist/react-status-manager.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/react-status-manager.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="format-detection" content="address=no" />
<meta name="format-detection" content="date=no" />

<title>react-refresher</title>
<title>react-status-manager</title>
</head>
<body>
<div id="app"></div>
Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
{
"name": "react-refresher",
"name": "react-status-manager",
"version": "0.1.0",
"description": "React refresher for pull to refresh.",
"description": "React component for status manager.",
"author": "afeiship <1290657123@qq.com>",
"keywords": [
"components",
"react-refresher",
"react",
"status",
"manager",
"state",
"ui",
"theme"
],
"private": false,
"repository": {
"type": "git",
"url": "git+https://github.com/afeiship/react-refresher.git"
"url": "git+https://github.com/afeiship/react-status-manager.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/afeiship/react-refresher/issues"
"url": "https://github.com/afeiship/react-status-manager/issues"
},
"homepage": "https://github.com/afeiship/react-refresher",
"homepage": "https://github.com/afeiship/react-status-manager",
"scripts": {
"dev": "node build/dev-server.js",
"build": "node build/build.js"
},
"main": "./dist/react-refresher.js",
"main": "./dist/react-status-manager.js",
"devDependencies": {
"autoprefixer": "^6.4.0",
"autoprefixer-loader": "^3.2.0",
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import './style.scss';
import classNames from 'classnames';
import {createElement,PureComponent,PropTypes} from 'react';
import loadingImg from './loading.svg';

export default class extends PureComponent{
static propTypes = {
Expand All @@ -12,28 +11,16 @@ export default class extends PureComponent{
};

static defaultProps = {
className:'',
status:'init',
size:'14px',
statusList:['init','active','running','finish']
};

getDefaultChildren(){
let children = [];
return [
createElement('span',{key:0},'下拉刷新'),
createElement('span',{key:1},'释放更新'),
createElement('img',{key:2,width:30,src:loadingImg}),
createElement('span',{key:3},'加载完毕')
];
}

render(){
let children = this.props.children || this.getDefaultChildren();
const { className, status, statusList, size} = this.props;
const { className, status, statusList, size ,children} = this.props;
return (
<div
className={classNames('react-refresher',className)}
className={classNames('react-status-manager',className)}
style={{fontSize:size}}
data-status={status}
>
Expand Down
Loading

0 comments on commit f133441

Please sign in to comment.