From ff1769bd677821782d23a1c28e675a5c9a995bbd Mon Sep 17 00:00:00 2001 From: kblny Date: Wed, 4 May 2016 11:57:39 +0200 Subject: [PATCH] Codacy Added and issues fixed (code style and 1 unused code) --- MessageBarManager.js | 28 ++++++++++++++-------------- README.md | 2 +- index.android.js | 8 ++++---- index.ios.js | 6 +++--- package.json | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/MessageBarManager.js b/MessageBarManager.js index 3a9c02d..77a1668 100644 --- a/MessageBarManager.js +++ b/MessageBarManager.js @@ -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(); }, @@ -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; } @@ -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); } @@ -68,4 +68,4 @@ module.exports = { } }, -} +}; diff --git a/README.md b/README.md index a3502f3..4c62c57 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/index.android.js b/index.android.js index ef6414f..8cf622f 100644 --- a/index.android.js +++ b/index.android.js @@ -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); diff --git a/index.ios.js b/index.ios.js index ef6414f..c8149ae 100644 --- a/index.ios.js +++ b/index.ios.js @@ -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); diff --git a/package.json b/package.json index 3902f20..a8be56e 100644 --- a/package.json +++ b/package.json @@ -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,