Skip to content

Commit

Permalink
Codacy Added and issues fixed (code style and 1 unused code)
Browse files Browse the repository at this point in the history
  • Loading branch information
KBLNY committed May 4, 2016
1 parent 048c6f0 commit ff1769b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
28 changes: 14 additions & 14 deletions MessageBarManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
* Description: A manager to show/hide and handle a queue of alerts
* https://github.com/KBLNY/react-native-message-bar
*/
'use strict';
"use strict";

module.exports = {
_currentMessageBarAlert: null,
_messageAlerts: new Array(),

setCurrentMessageBarAlert: function(alert) {
console.warn('This method is deprecated, please use registerMessageBar instead.');
setCurrentMessageBarAlert(alert) {
Console.warn('This method is deprecated, please use registerMessageBar instead.');
this.registerMessageBar(alert);
},

removeCurrentMessageBarAlert: function() {
console.warn('This method is deprecated, please use registerMessageBar instead.');
removeCurrentMessageBarAlert() {
Console.warn('This method is deprecated, please use registerMessageBar instead.');
this.unregisterMessageBar();
},

Expand All @@ -24,16 +24,16 @@ module.exports = {
},

unregisterMessageBar() {
this._currentMessageBarAlert = null;;
this._currentMessageBarAlert = null;
},


showCurrentAlert: function(newState = null) {
console.warn('This method is deprecated, please use showAlert instead.');
showCurrentAlert(newState = null) {
Console.warn('This method is deprecated, please use showAlert instead.');
this.showAlert(newState);
},

showAlert: function(newState = null) {
showAlert(newState = null) {
if (this._currentMessageBarAlert === null) {
return;
}
Expand All @@ -44,17 +44,17 @@ module.exports = {
// Get the current alert's duration to hide
var durationToHide = this._currentMessageBarAlert.state.durationToHide;

setTimeout(()=>{
setTimeout(() => {
// Show the new alert if there is a new state, otherwise
if (newState != null) {
// Clear current state
this._currentMessageBarAlert.setNewState({});
// Clear current state
this._currentMessageBarAlert.setNewState({});

this._currentMessageBarAlert.setNewState(newState);

this._currentMessageBarAlert.notifyAlertHiddenCallback = null;

setTimeout(()=>{
setTimeout(() => {
this._currentMessageBarAlert.showMessageBarAlert();
}, 100);
}
Expand All @@ -68,4 +68,4 @@ module.exports = {
}
},

}
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# react-native-message-bar ![npm version](http://img.shields.io/npm/dm/react-native-message-bar.svg) ![downloads](https://img.shields.io/npm/v/react-native-message-bar.svg) ![license](https://img.shields.io/npm/l/react-native-message-bar.svg)
# react-native-message-bar ![npm version](http://img.shields.io/npm/dm/react-native-message-bar.svg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/482dc013717642e3971f78b22f2a95fd)](https://www.codacy.com/app/ktgr45/react-native-message-bar?utm_source=github.com&utm_medium=referral&utm_content=KBLNY/react-native-message-bar&utm_campaign=Badge_Grade) ![downloads](https://img.shields.io/npm/v/react-native-message-bar.svg) ![license](https://img.shields.io/npm/l/react-native-message-bar.svg)
A message bar notification component displayed at the top of the screen for React Native (Android and iOS) projects.

![Screenshot](http://s31.postimg.org/cxq6x5srf/Untitled.gif)
Expand Down
8 changes: 4 additions & 4 deletions index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Description: A Project to test the Message Bar Component
* https://github.com/KBLNY/react-native-message-bar
*/
'use strict';
"use strict";

const React = require('react-native');
const React = require("react-native");
const { AppRegistry, } = React;
const AppTest = require('./AppTest');
const AppTest = require("./AppTest");

AppRegistry.registerComponent('MessageBar', () => AppTest);
AppRegistry.registerComponent("MessageBar", () => AppTest);
6 changes: 3 additions & 3 deletions index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* Description: A Project to test the Message Bar Component
* https://github.com/KBLNY/react-native-message-bar
*/
'use strict';
"use strict";

const React = require('react-native');
const React = require("react-native");
const { AppRegistry, } = React;
const AppTest = require('./AppTest');
const AppTest = require("./AppTest");

AppRegistry.registerComponent('MessageBar', () => AppTest);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-message-bar",
"version": "1.5.2",
"version": "1.5.3",
"description": "A message bar alert displayed at the top of the screen for react-native",
"main": "index.js",
"private": false,
Expand Down

0 comments on commit ff1769b

Please sign in to comment.