You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GoogleSignInButton.web.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import PropTypes from 'prop-types';
  2. import React, { Component } from 'react';
  3. /**
  4. * A React Component showing a button to sign in with Google.
  5. *
  6. * @extends Component
  7. */
  8. export default class GoogleSignInButton extends Component {
  9. /**
  10. * {@code GoogleSignInButton} component's property types.
  11. *
  12. * @static
  13. */
  14. static propTypes = {
  15. /**
  16. * The callback to invoke when the button is clicked.
  17. */
  18. onClick: PropTypes.func,
  19. /**
  20. * The text to display in the button.
  21. */
  22. text: PropTypes.string
  23. };
  24. /**
  25. * Implements React's {@link Component#render()}.
  26. *
  27. * @inheritdoc
  28. * @returns {ReactElement}
  29. */
  30. render() {
  31. return (
  32. <div
  33. className = 'google-sign-in'
  34. onClick = { this.props.onClick }>
  35. <img
  36. className = 'google-logo'
  37. src = 'images/googleLogo.svg' />
  38. <div className = 'google-cta'>
  39. { this.props.text }
  40. </div>
  41. </div>
  42. );
  43. }
  44. }