<commit_before>goog.provide 'app.react.Login'

class app.react.Login

  ###*
    @param {app.Routes} routes
    @param {app.react.Touch} touch
    @param {app.user.Store} userStore
    @param {app.Firebase} firebase
    @constructor
  ###
  constructor: (routes, touch, userStore, firebase) ->
    {button} = touch.none 'button'

    @component = React.createClass

      render: ->
        if userStore.isLogged()
          button onPointerUp: @logout, Login.MSG_LOGOUT
        else
          button onPointerUp: @login, Login.MSG_LOGIN

      logout: ->
        routes.home.redirect()
        firebase.logout()

      login: ->
        # TODO: Add more options.
        firebase.loginViaFacebook()

  @MSG_LOGOUT: goog.getMsg 'Log Out'
  @MSG_LOGIN: goog.getMsg 'Log In'<commit_msg>Fix login btn label.<commit_after>goog.provide 'app.react.Login'

class app.react.Login

  ###*
    @param {app.Routes} routes
    @param {app.react.Touch} touch
    @param {app.user.Store} userStore
    @param {app.Firebase} firebase
    @constructor
  ###
  constructor: (routes, touch, userStore, firebase) ->
    {button} = touch.none 'button'

    @component = React.createClass

      render: ->
        if userStore.isLogged()
          button onPointerUp: @logout, Login.MSG_LOGOUT
        else
          button onPointerUp: @login, Login.MSG_LOGIN

      logout: ->
        routes.home.redirect()
        firebase.logout()

      login: ->
        # TODO: Add more options.
        firebase.loginViaFacebook()

  @MSG_LOGOUT: goog.getMsg 'Log Out'
  @MSG_LOGIN: goog.getMsg 'Login with Facebook'
{'fraction_non_alphanumeric': 0.12153652392947104, 'fraction_numerical': 0.0, 'mean_word_length': 2.531111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1762132', 'n_tokens_mistral': 525, 'n_tokens_neox': 510, 'n_words': 115}