Skip to content

Commit

Permalink
bumped to v5
Browse files Browse the repository at this point in the history
fixed warnings
fixed semantics
  • Loading branch information
Puranjay Jain committed Jun 1, 2017
1 parent d1bb464 commit f186705
Show file tree
Hide file tree
Showing 12 changed files with 1,911 additions and 3,159 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@

## v0.4.1
* Bumped versions of dependencies to newer versions

## v0.5.0
* Warning this release contains breaking changes in dependencies.
* react-addons-css-transition-group changed to react-transition-group to remove warning.
* removed proptypes from react instead imported from prop-types library
* Special thanks to [Gonçalo Margalho @DevAlien](https://github.com/DevAlien) for making that wonderful hotfix
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Puranjay Jain
Copyright (c) 2017 Puranjay Jain

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
[![GitHub version](https://img.shields.io/github/release/puranjayjain/react-materialui-notifications.svg)](https://badge.fury.io/gh/puranjayjain%2Freact-materialui-notifications)
[![npm version](https://badge.fury.io/js/react-materialui-notifications.svg)](https://badge.fury.io/js/react-materialui-notifications)

[![Maintenance](https://img.shields.io/maintenance/yes/2016.svg)]()

[![Issues](https://img.shields.io/github/issues/puranjayjain/react-materialui-notifications.svg)](https://github.com/puranjayjain/react-materialui-notifications/issues)
[![Forks](https://img.shields.io/github/forks/puranjayjain/react-materialui-notifications.svg)](https://github.com/puranjayjain/react-materialui-notifications/network)
[![Stars](https://img.shields.io/github/stars/puranjayjain/react-materialui-notifications.svg)](https://github.com/puranjayjain/react-materialui-notifications/stargazers)
Expand All @@ -17,7 +15,7 @@
# Installation

* Use the latest github release
* or Install via `npm i react-materialui-notifications`
* or Install via `npm i react-materialui-notifications --save`

# Demo

Expand All @@ -36,8 +34,8 @@ but we'll adhere to those rules whenever possible.

# Development

* To test the project use `gulp run.bat`
* To release the project use `gulp run.bat` then run `gulp release.bat`
* If developing the project use `gulp run.bat` or the equivalent command written in it.
* To release the project use `gulp run.bat` then run `gulp release.bat` or the equivalent command written in them.

# TODO
- [x] a lot of core functionality
Expand Down
4,743 changes: 1,749 additions & 2,994 deletions build/app.js

Large diffs are not rendered by default.

21 changes: 1 addition & 20 deletions build/app.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
var wf = document.createElement('script');
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
wf.async = 1;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
<script src="app.js"></script>
<script src="app.js" defer async></script>
</body>

</html>
80 changes: 39 additions & 41 deletions lib/ReactMaterialUiNotifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('material-ui/utils/propTypes');
var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _reactAddonsCssTransitionGroup = require('react-addons-css-transition-group');
var _propTypes3 = require('material-ui/utils/propTypes');

var _reactAddonsCssTransitionGroup2 = _interopRequireDefault(_reactAddonsCssTransitionGroup);
var _propTypes4 = _interopRequireDefault(_propTypes3);

var _reactTransitionGroup = require('react-transition-group');

var _Paper = require('material-ui/Paper');

Expand Down Expand Up @@ -169,20 +171,19 @@ var ReactMaterialUiNotifications = function (_Component) {
return ReactMaterialUiNotifications;
}(_react.Component);

ReactMaterialUiNotifications.propTypes = {
ReactMaterialUiNotifications.muiPropTypes = {
/**
* Desktop device or touch device
*/
desktop: _react.PropTypes.bool,
desktop: _propTypes2.default.bool,
/**
* maximum number of notifications to display
*/
maxNotifications: _react2.default.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]),
maxNotifications: _react2.default.PropTypes.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
/**
* root component's style
*/
rootStyle: _react.PropTypes.object
};
rootStyle: _propTypes2.default.object };
ReactMaterialUiNotifications.defaultProps = {
maxNotifications: Infinity,
rootStyle: {
Expand All @@ -191,21 +192,20 @@ ReactMaterialUiNotifications.defaultProps = {
}
};
ReactMaterialUiNotifications.contextTypes = {
muiTheme: _react.PropTypes.object.isRequired
};
muiTheme: _propTypes2.default.object.isRequired };

ReactMaterialUiNotifications.showNotification = function (notification) {
var tempNotifications = notifications;
// push a new notification to notifications
notification.open = true;
notification.count = count;
tempNotifications.push(notification);
tempNotifications.push(notification
// filter and keep only the open ones
tempNotifications = tempNotifications.filter(ReactMaterialUiNotifications.filterOpen);
);tempNotifications = tempNotifications.filter(ReactMaterialUiNotifications.filterOpen
// shuffle notifications and set actual notifications to the temp ones to update render
notifications = ReactMaterialUiNotifications.shuffleNotifications(tempNotifications);
);notifications = ReactMaterialUiNotifications.shuffleNotifications(tempNotifications
// update counter
count++;
);count++;
};

ReactMaterialUiNotifications.filterOpen = function (notification) {
Expand Down Expand Up @@ -436,12 +436,11 @@ var Notification = function (_Component2) {
right: this.props.desktop ? 42 : 8,
fontSize: 12,
top: 14
};

/**
* secondary line text
*/
var secondaryText = void 0,
/**
* secondary line text
*/
};var secondaryText = void 0,
expandedText = void 0,
expandedAction = void 0,
desktopClose = void 0,
Expand Down Expand Up @@ -516,7 +515,7 @@ var Notification = function (_Component2) {
}

return _react2.default.createElement(
_reactAddonsCssTransitionGroup2.default,
_reactTransitionGroup.CSSTransitionGroup,
{
transitionName: this.props.transitionName ? this.props.transitionName : "",
transitionAppear: this.props.transitionAppear ? this.props.transitionAppear : false,
Expand Down Expand Up @@ -564,85 +563,84 @@ var Notification = function (_Component2) {
return Notification;
}(_react.Component);

Notification.propTypes = {
Notification.muiPropTypes = {
/**
* additional text for display
*/
additionalText: _react.PropTypes.string,
additionalText: _propTypes2.default.string,
/**
* number of lines of text for additionalText
*/
additionalLines: _react.PropTypes.number,
additionalLines: _propTypes2.default.number,
/**
* autohide timeout to determine whether to hide the notification automatically or nor
*/
autoHide: _react.PropTypes.number,
autoHide: _propTypes2.default.number,
/**
* pass left avatar image url to be displayed in a personalised notification
*/
avatar: _react.PropTypes.string,
avatar: _propTypes2.default.string,
/**
* notification icon on the left
*/
icon: _react.PropTypes.element,
icon: _propTypes2.default.element,
/*
* icon surrounding badge color
*/
iconBadgeColor: _react.PropTypes.string,
iconBadgeColor: _propTypes2.default.string,
/**
* icon color
*/
iconFillColor: _react.PropTypes.string,
iconFillColor: _propTypes2.default.string,
/**
* When the notification is clicked, if not passed it won't be clicakble
*/
onClick: _react.PropTypes.func,
onClick: _propTypes2.default.func,
/**
* open which tells whether to display the message
*/
open: _react.PropTypes.bool,
open: _propTypes2.default.bool,
/**
* additional overflow text
*/
overflowText: _react.PropTypes.string,
overflowText: _propTypes2.default.string,
/**
* additional overflow content, like buttons
* TODO implement the on click dismiss action like done in card (material-ui) as actAsExpander
*/
overflowContent: _react.PropTypes.element,
overflowContent: _propTypes2.default.element,
/**
* is personalised notification or not
*/
personalised: _react.PropTypes.bool,
personalised: _propTypes2.default.bool,
/**
* it is a priority notification
*/
priority: _react.PropTypes.bool,
priority: _propTypes2.default.bool,
/**
* Injected from parent, needed to remove the notification
*/
removeNotification: _react.PropTypes.func,
removeNotification: _propTypes2.default.func,
/**
* Override the inline-styles of the root element.
*/
style: _react.PropTypes.object,
style: _propTypes2.default.object,
/**
* notification title
*/
title: _react.PropTypes.string,
title: _propTypes2.default.string,
/**
* timestamp you want to display
*/
timestamp: _react.PropTypes.string,
timestamp: _propTypes2.default.string,
/**
* This number represents the zDepth of the paper shadow covering the message.
*/
zDepth: _propTypes2.default.zDepth
};
zDepth: _propTypes4.default.zDepth };
Notification.defaultProps = {
iconFillColor: '#fff',
zDepth: 1
};
Notification.contextTypes = {
muiTheme: _react.PropTypes.object.isRequired
muiTheme: _propTypes2.default.object.isRequired
};
2 changes: 1 addition & 1 deletion lib/ReactMaterialUiNotifications.min.js

Large diffs are not rendered by default.

60 changes: 36 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-materialui-notifications",
"version": "0.4.1",
"version": "0.5.0",
"description": "Spec compliant notifications for react and material ui users",
"keywords": [
"react",
Expand All @@ -9,47 +9,59 @@
"notification",
"material-ui"
],
"repository": {
"repository":
{
"type": "git",
"url": "https://github.com/puranjayjain/react-materialui-notifications.git"
},
"author": "Puranjay Jain <me+npm@puranjayjain.com>",
"contributors": [
{
"name": "Gonçalo Margalho",
"email": "gsky89@gmail.com",
"url": "https://github.com/DevAlien"
}
],
"main": "./lib/ReactMaterialUiNotifications.js",
"scripts": {
"scripts":
{
"start": "gulp"
},
"license": "MIT ",
"devDependencies": {
"babel-core": "^6.23.1",
"babel-plugin-transform-class-properties": "^6.23.0",
"babel-plugin-transform-es2015-duplicate-keys": "^6.22.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.22.0",
"dependencies":
{
"material-ui": "^0.18.1",
"prop-types": "^15.5.10",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-tap-event-plugin": "^2.0.1",
"react-transition-group": "^1.1.3"
},
"devDependencies":
{
"babel-core": "^6.24.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-es2015-duplicate-keys": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babelify": "^7.3.0",
"browser-sync": "^2.18.8",
"browserify": "^14.1.0",
"browser-sync": "^2.18.12",
"browserify": "^14.4.0",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-notify": "^3.0.0",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^2.1.0",
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.8",
"moment": "^2.17.1",
"moment": "^2.18.1",
"pretty-hrtime": "^1.0.3",
"pump": "^1.0.2",
"recompose": "^0.22.0",
"require-dir": "^0.3.1",
"recompose": "^0.23.4",
"require-dir": "^0.3.2",
"run-sequence": "^1.2.2",
"underscore": "^1.8.3",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.9.0"
},
"dependencies": {
"material-ui": "^0.17.1",
"react": "^15.4.2",
"react-addons-css-transition-group": "^15.4.2",
"react-dom": "^15.4.2",
"react-tap-event-plugin": "^2.0.1"
}
}
}
1 change: 1 addition & 0 deletions src/app/Github.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ let Github = (props) => (
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
</SvgIcon>
)

Github = pure(Github)
Github.displayName = 'Github'
Github.muiName = 'SvgIcon'
Expand Down
Loading

0 comments on commit f186705

Please sign in to comment.