1.1.0
[info] Main Scala API documentation to /home/ashutosh/Development/scalareact2/scalajs-react-components/macros/target/scala-2.12/api...
[info] :: delivering :: com.olvind#scalajs-react-components_2.12;1.0.0-M2 :: 1.0.0-M2 :: release :: Sun Apr 22 11:54:00 IST 2018
[info] Wrote /home/ashutosh/Development/scalareact2/scalajs-react-components/macros/target/scala-2.12/scalajs-react-components-macros_sjs0.6_2.12-1.0.0-M2.pom
[info] Wrote /home/ashutosh/Development/scalareact2/scalajs-react-components/core/target/scala-2.12/scalajs-react-components_sjs0.6_2.12-1.0.0-M2.pom
[info] :: delivering :: com.olvind#scalajs-react-components-demo_sjs0.6_2.12;1.0.0-M2 :: 1.0.0-M2 :: release :: Sun Apr 22 11:54:00 IST 2018
[info] delivering ivy file to /home/ashutosh/Development/scalareact2/scalajs-react-components/demo/target/scala-2.12/ivy-1.0.0-M2.xml
[info] published ivy to /home/ashutosh/.ivy2/local/com.olvind/scalajs-react-components-demo_sjs0.6_2.12/1.0.0-M2/ivys/ivy.xml
[info] Packaging /home/ashutosh/Development/scalareact2/scalajs-react-components/macros/target/scala-2.12/scalajs-react-components-macros_sjs0.6_2.12-1.0.0-M2.jar ...
[info] Done packaging.
[info] Updating NPM dependencies
[error] Usage: yarn [options]
[error] yarn: error: no such option: --non-interactive
model contains 9 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /home/ashutosh/Development/scalareact2/scalajs-react-components/macros/target/scala-2.12/scalajs-react-components-macros_sjs0.6_2.12-1.0.0-M2-javadoc.jar ...
[info] Done packaging.
Symbol 'type japgolly.scalajs.react.raw.package.ReactComponent' is missing from the classpath.
[error] This symbol is required by 'method chandu0101.scalajs.react.components.materialui.MuiTableRow.apply'.
[error] Make sure that type ReactComponent is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
[error] A full rebuild may help if 'MuiTableRow.class' was compiled against an incompatible version of japgolly.scalajs.react.raw.package.
[error] MuiTableRow()(
I am trying to get the MuiStepper work
val materialui = "0.16.7" // "0.15.1"
val scala = "2.11.11"
val scalajsReactComponents = "0.8.0"
The code below is inspired from this exemple https://codesandbox.io/s/r6401x80o
I am new to React, State, Props, etc
Nothing happend when i call my component :( :(
object ScalaMuiStepper {
def getSteps(): Array[String] = {
Array("Select campaign settings", "Create an ad group", "Create an ad")
}
def getStepContent(step: Int): String = {
step match {
case 0 => "For each ad campaign that you create, you can control how much you're willing to spend on clicks and conversions, which networks and geographical locations you want your ads to show on, and more."
case 1 => "An ad group contains one or more ads which target a shared set of keywords."
case 2 => "Try out different ad text to see what brings in the most customers, and learn how to enhance your ads using features like ad extensions.If you run into any problems with your ads, find out how to tell if they're running and how to resolve approval issues."
case whoa => "Unknown step"
}
}
case class ScalaMuiStepperState(activeStep: Double)
case class ScalaMuiStepperProps()
class Backend(t: BackendScope[ScalaMuiStepperProps, ScalaMuiStepperState]) {
def handleNext: ReactEvent => Callback = e => t.modState(s => s.copy(activeStep = s.activeStep + 1))
def handleBack: ReactEvent => Callback = e => t.modState(s => s.copy(activeStep = s.activeStep - 1))
//to be called later if needed
def handleReset: ReactEvent => Callback = e => t.modState(s => s.copy(activeStep = 0))
def render(state: ScalaMuiStepperState) = {
val steps = getSteps()
<.div(^.id := "ScalaMuiStepper")(
MuiMuiThemeProvider()(
MuiStepper(activeStep = state.activeStep)(
steps.zipWithIndex.map {
case (step, index) =>
MuiStep(key = step, active = index == state.activeStep)(
MuiStepLabel(active = index == state.activeStep, icon = index + 1)(step + index.toString),
MuiStepContent(active = index == state.activeStep)(
getStepContent(index),
<.div()(
MuiRaisedButton(disabled = state.activeStep == 0, onClick = handleBack)("Back"),
MuiRaisedButton(primary = true, onClick = handleNext)("Next")
)
)
)
}
)
)
)
}
}
private val component = ScalaComponent.builder[ScalaMuiStepperProps]("ScalaMuiStepper")
.renderBackend[Backend]
.build
def apply() = {
component(ScalaMuiStepperProps())
}
}