Skip to content

Commit

Permalink
merge the JS files for buttons (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
vonovak committed Feb 2, 2019
1 parent f0b30fd commit 4808fb2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 64 deletions.
10 changes: 5 additions & 5 deletions example/android/build.gradle
Expand Up @@ -34,8 +34,8 @@ allprojects {
}
}


task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
// commented because of `Cannot add task 'wrapper' as a task with that name already exists.`
//task wrapper(type: Wrapper) {
// gradleVersion = '5.0'
// distributionUrl = distributionUrl.replace("bin", "all")
//}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip
44 changes: 0 additions & 44 deletions src/GoogleSigninButton.ios.js

This file was deleted.

23 changes: 10 additions & 13 deletions src/GoogleSigninButton.android.js → src/GoogleSigninButton.js
@@ -1,29 +1,26 @@
import React, { Component } from 'react';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';

import {
DeviceEventEmitter,
NativeModules,
requireNativeComponent,
ViewPropTypes,
} from 'react-native';
import { NativeModules, requireNativeComponent, ViewPropTypes, Platform } from 'react-native';

const { RNGoogleSignin } = NativeModules;

const RNGoogleSigninButton = requireNativeComponent('RNGoogleSigninButton', null);

export class GoogleSigninButton extends Component {
export class GoogleSigninButton extends PureComponent {
static propTypes = {
...ViewPropTypes,
size: PropTypes.number,
color: PropTypes.number,
color: PropTypes.string,
disabled: PropTypes.bool,
onPress: PropTypes.func.isRequired,
};

componentDidMount() {
this._clickListener = DeviceEventEmitter.addListener('RNGoogleSigninButtonClicked', () => {
this.props.onPress && this.props.onPress();
});
if (Platform.OS === 'android') {
this._clickListener = DeviceEventEmitter.addListener('RNGoogleSigninButtonClicked', () => {
this.props.onPress && this.props.onPress();
});
}
}

componentWillUnmount() {
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Expand Up @@ -2,6 +2,7 @@
# yarn lockfile v1


prettier@^1.14.2:
prettier@1.14.2:
version "1.14.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.2.tgz#0ac1c6e1a90baa22a62925f41963c841983282f9"
integrity sha512-McHPg0n1pIke+A/4VcaS2en+pTNjy4xF+Uuq86u/5dyDO59/TtFZtQ708QIRkEZ3qwKz3GVkVa6mpxK/CpB8Rg==

0 comments on commit 4808fb2

Please sign in to comment.