您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

GoogleSignInButton.web.js 1.0KB

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