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.

MicrosoftSignInButton.web.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { translate } from '../../base/i18n';
  4. /**
  5. * The type of the React {@code Component} props of
  6. * {@link MicrosoftSignInButton}.
  7. */
  8. type Props = {
  9. /**
  10. * The callback to invoke when {@code MicrosoftSignInButton} is clicked.
  11. */
  12. onClick: Function,
  13. /**
  14. * The text to display within {@code MicrosoftSignInButton}.
  15. */
  16. text: string,
  17. /**
  18. * Invoked to obtain translated strings.
  19. */
  20. t: Function
  21. };
  22. /**
  23. * A React Component showing a button to sign in with Microsoft.
  24. *
  25. * @extends Component
  26. */
  27. class MicrosoftSignInButton extends Component<Props> {
  28. /**
  29. * Implements React's {@link Component#render()}.
  30. *
  31. * @inheritdoc
  32. * @returns {ReactElement}
  33. */
  34. render() {
  35. return (
  36. <div
  37. className = 'microsoft-sign-in'
  38. onClick = { this.props.onClick }>
  39. <img
  40. alt = { this.props.t('welcomepage.logo.microsoftLogo') }
  41. className = 'microsoft-logo'
  42. src = 'images/microsoftLogo.svg' />
  43. <div className = 'microsoft-cta'>
  44. { this.props.text }
  45. </div>
  46. </div>
  47. );
  48. }
  49. }
  50. export default translate(MicrosoftSignInButton);