From 21fcf7cdd385226f2bf550b080d2fa72aa160893 Mon Sep 17 00:00:00 2001 From: Damien Varron Date: Fri, 26 Aug 2016 14:03:02 +0200 Subject: [PATCH 1/4] remove console.log --- index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/index.js b/index.js index 415a3e8..d5bbf7c 100644 --- a/index.js +++ b/index.js @@ -165,7 +165,6 @@ var MaterialButton = React.createClass({ onLayout(e) { var { x, y, width, height } = e.nativeEvent.layout; - console.log(x, y, width, height); this.setState({ top: y, left: x, From 85fa7d07495380980cf7ec85b466a90f483084dd Mon Sep 17 00:00:00 2001 From: Damien Varron Date: Fri, 26 Aug 2016 14:03:39 +0200 Subject: [PATCH 2/4] update react import --- index.js | 16 +++++----------- styles.js | 6 ++++-- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index d5bbf7c..4f027a1 100644 --- a/index.js +++ b/index.js @@ -1,14 +1,8 @@ -'use strict'; +import React from 'react'; +import { View, Animated, PanResponder } from 'react-native'; +import styles from './styles'; -var React = require('react-native'); -var { - View, - Animated, - PanResponder -} = React; -var styles = require('./styles'); - -var MaterialButton = React.createClass({ +const MaterialButton = React.createClass({ getDefaultProps() { return { withRipple: true, @@ -219,4 +213,4 @@ var MaterialButton = React.createClass({ } }); -module.exports = MaterialButton; +export default MaterialButton; diff --git a/styles.js b/styles.js index a7f066d..6eb59ec 100644 --- a/styles.js +++ b/styles.js @@ -1,6 +1,6 @@ -var React = require('react-native'); +import { StyleSheet } from 'react-native'; -module.exports = React.StyleSheet.create({ +const styles = StyleSheet.create({ rippleContainer: { backgroundColor: 'transparent', overflow: 'hidden', @@ -21,3 +21,5 @@ module.exports = React.StyleSheet.create({ overflow: 'visible', } }); + +export default styles; From e0f5a9f36a970313a410c2c8ea1802182601ada0 Mon Sep 17 00:00:00 2001 From: Damien Varron Date: Fri, 26 Aug 2016 14:07:00 +0200 Subject: [PATCH 3/4] bump version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a8a3e51..249eed6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-material-button", - "version": "0.0.4", + "version": "1.0.0", "description": "Customizable material style button", "main": "index.js", "scripts": { @@ -29,6 +29,6 @@ }, "homepage": "https://github.com/recr0ns/react-native-material-button", "peerDependencies": { - "react-native": ">= 0.9.0" + "react-native": ">= 0.25.0" } } From e319665c40ef544c4246508ed6064452e0f15e4e Mon Sep 17 00:00:00 2001 From: Damien Varron Date: Fri, 30 Sep 2016 16:55:24 +0200 Subject: [PATCH 4/4] clear interval on componentWillUnmount --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 4f027a1..511f1a7 100644 --- a/index.js +++ b/index.js @@ -77,6 +77,12 @@ const MaterialButton = React.createClass({ }); }, + componentWillUnmount() { + if (this.liftInterval) { + clearInterval(this.liftInterval); + } + }, + liftUp() { Animated.parallel([ Animated.timing(this.state.shadowRadius, {