Skip to content

Instantly share code, notes, and snippets.

@jozan
Created May 24, 2018 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jozan/19050bbcec7452158e7db08d0005b6fc to your computer and use it in GitHub Desktop.
Save jozan/19050bbcec7452158e7db08d0005b6fc to your computer and use it in GitHub Desktop.
#import <React/RCTViewManager.h>
#import <React/RCTLog.h>
#import "RNGoogleSignin.h"
@interface RNGoogleSigninButtonManager : RCTViewManager
@end
@implementation RNGoogleSigninButtonManager
RCT_EXPORT_MODULE()
- (UIView *)view
{
GIDSignInButton *button = [[GIDSignInButton alloc] init];
button.colorScheme = kGIDSignInButtonColorSchemeLight;
button.style = kGIDSignInButtonStyleStandard;
[button removeTarget:nil action:NULL forControlEvents:UIControlEventTouchUpInside];
[button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
return button;
}
RCT_CUSTOM_VIEW_PROPERTY(color, NSString, GIDSignInButton)
{
view.colorScheme = json ? [RCTConvert GIDSignInButtonColorScheme:json] :kGIDSignInButtonColorSchemeLight;
}
RCT_CUSTOM_VIEW_PROPERTY(size, NSString, GIDSignInButton)
{
view.style = json ? [RCTConvert GIDSignInButtonStyle:json] :kGIDSignInButtonStyleStandard;
}
-(void)buttonAction:(GIDSignInButton*)sender
{
RCTLogError(@"%s", __func__);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment