These are chat archives for chandu0101/scalajs-react-components

30th
Oct 2015
virtualirfan
@virtualirfan
Oct 30 2015 03:23
@ochrons @b0c1 fwiw: i'm playing with react-grid-layout for, well, layout right now :smile:
Janos Haber
@b0c1
Oct 30 2015 09:47
interesting.... thnx... you have scalajs binding for this?
Janos Haber
@b0c1
Oct 30 2015 13:47
Hi guys
I try to do the following: MuiFlatButton(label = "Login", onTouchTap = this.handleLogin _)()
The application is compile but IDEA say: cannot resolve symbol onTouchTap
Janos Haber
@b0c1
Oct 30 2015 14:02
another question... how can I set a textfield to disabled?
I mean not MioTextField(disabled=true), I mean when any event happened, change the button to disabled :D
Zach Langbert
@zlangbert
Oct 30 2015 14:24
For the intellij thing, wrap it in curly braces
Janos Haber
@b0c1
Oct 30 2015 14:24
ty
Zach Langbert
@zlangbert
Oct 30 2015 14:25
to disable something conidtionally just make it dependent on something in your state
or props, depending on how you are doing things
Janos Haber
@b0c1
Oct 30 2015 14:33
@ochrons can I ask about autowire?
Zach Langbert
@zlangbert
Oct 30 2015 14:43
I could probably answer a question about autowire if you want
Janos Haber
@b0c1
Oct 30 2015 14:43
hurray :D
I already talk about authorization with @ochrons
he said the prefered way: get the user from the request (maybe token from header/cookie/etc I think) and create a new api using the constructor...
(pass the user through the constructor)
it's not a big waste of time?
Zach Langbert
@zlangbert
Oct 30 2015 14:47
right, that's what I do also
Janos Haber
@b0c1
Oct 30 2015 14:47
create new instance from the class...
and you not cache it (example in a map, or I dunno)
?
Zach Langbert
@zlangbert
Oct 30 2015 14:47
if you need information from the original request, that's the way to do it
well, you might be able to cache it depending on what you are passing
but its just one allocation
not worth it
Janos Haber
@b0c1
Oct 30 2015 14:48
hmm...
and how do you store the user? in the serverside? you get in each request?
Zach Langbert
@zlangbert
Oct 30 2015 14:49
that depends on what server side framework you are using
Janos Haber
@b0c1
Oct 30 2015 14:49
I mean the user login with a public api, and call a different API... somewhere you must store the user
I using play right now
Zach Langbert
@zlangbert
Oct 30 2015 14:50
what are you using for authentication?
Janos Haber
@b0c1
Oct 30 2015 14:51
I now started to build the app... so green field... what should I use? :D
Zach Langbert
@zlangbert
Oct 30 2015 14:52
I use play-silhouette
it can take a bit of work to set up, but it's pretty powerful
Janos Haber
@b0c1
Oct 30 2015 14:53
hmmm...
Can you show me how can I use with autowire?
Zach Langbert
@zlangbert
Oct 30 2015 15:00
basically when you use a silhouette action, it wraps the request so you have access to the user object
Janos Haber
@b0c1
Oct 30 2015 15:00
wow
Zach Langbert
@zlangbert
Oct 30 2015 15:01
so you can pass request.identity into your api instance
then pass that to autowire and yay, you have user info in your api
Janos Haber
@b0c1
Oct 30 2015 15:01
@zlangbert thanks... can you help if I'm stucked?
Zach Langbert
@zlangbert
Oct 30 2015 15:01
sure :)
Janos Haber
@b0c1
Oct 30 2015 15:01
ty :D
@zlangbert ok first problem:
[warn]     :: com.atlassian.jwt#jwt-core;1.2.4: not found
[warn]     :: com.atlassian.jwt#jwt-api;1.2.4: not found
:D
Haha nevermind... user error :D
Janos Haber
@b0c1
Oct 30 2015 15:24
Hmm
Janos Haber
@b0c1
Oct 30 2015 16:42
Umm
I try to use MuiSvgIcon but I got javascript exception
This is the code:
object FacebookIcon {
  val component = ReactComponentB[Unit]("FacebookIcon")
    .render($ => {
      MuiSvgIcon()(
        <.svg.lineargradient(
          ^.id := "SVGID_1_",
          ^.svg.gradientUnits := "userSpaceOnUse",
          ^.svg.x1 := "90.0527",
          ^.svg.y1 := "-99.7603",
          ^.svg.x2 := "90.0527",
          ^.svg.y2 := "-106.3809",
          ^.svg.gradientTransform := "matrix(7.2338 0 0 -7.2338 -641.4998 -735.5619)"
        )(
          <.svg.stop(^.svg.offset := "0", ^.svg.style := "stop-color:#4B71B8"),
          <.svg.stop(^.svg.offset := "1", ^.svg.style := "stop-color:#293F7E")
        ),
        <.svg.path(
          ^.svg.fill := "url(#SVGID_1_)",
          ^.svg.d := "M33.931,27.993c0,3.304-2.689,5.983-6.002,5.983H-8.082c-3.315,0-6.001-2.683-6.001-5.983V-7.928c0-3.308,2.687-5.988,6.001-5.988h36.011c3.312,0,6.002,2.681,6.002,5.988V27.993z"
        ),
        <.svg.path(
          ^.svg.fill := "#FFFFFF",
          ^.svg.d := "M25.613-4.557c0,0-3.707,0-6.166,0c-3.662,0-7.732,1.535-7.732,6.835c0.019,1.845,0,3.613,0,5.603H7.481v6.728h4.366v19.37h8.021V14.48h5.295l0.479-6.618h-5.913c0,0,0.016-2.946,0-3.8c0-2.093,2.184-1.974,2.312-1.974c1.042,0,3.059,0.003,3.578,0v-6.646H25.613z"
        )
      )
    }).buildU

  def apply() = component()
}
And I got: Uncaught Error: Invariant Violation: The 'style' prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX. This DOM node was rendered by 'FacebookIcon'
Janos Haber
@b0c1
Oct 30 2015 16:47
@elacin @zlangbert ?
I using standard tags, maybe I miss something?
Zach Langbert
@zlangbert
Oct 30 2015 16:48
It's probably your svg.styles
Janos Haber
@b0c1
Oct 30 2015 16:49
but what's wrong with it? I got it from an original svg file...
Zach Langbert
@zlangbert
Oct 30 2015 16:49
Not sure.. I might be wrong
Janos Haber
@b0c1
Oct 30 2015 16:51
You're right... it's show shomething if I disable the stop element
Zach Langbert
@zlangbert
Oct 30 2015 16:52
Yeah, I just tried to use ^.svg.style and it doesn't work. It either a bug in scalajs-react or I don't know how to use it
Janos Haber
@b0c1
Oct 30 2015 16:53
wow
ok, thnx
Zach Langbert
@zlangbert
Oct 30 2015 16:53
In this case though, you can probably use ^.svg.stopColor := "#aaaaaa"
Janos Haber
@b0c1
Oct 30 2015 16:53
hmm... ok
thanks
Zach Langbert
@zlangbert
Oct 30 2015 16:54
np
Zach Langbert
@zlangbert
Oct 30 2015 17:04
Opened an issue japgolly/scalajs-react#219