-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathShowcaseScreen.scala
37 lines (30 loc) · 1.03 KB
/
ShowcaseScreen.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package showcase.app
import showcase.app.style._
import showcase.app.task._
import showcase.app.ui._
import scommons.react._
import scommons.react.navigation._
import scommons.react.navigation.stack._
case class ShowcaseScreenProps(navigate: String => Unit)
object ShowcaseScreen extends FunctionComponent[ShowcaseScreenProps] {
protected def render(compProps: Props): ReactElement = {
val props = compProps.wrapped
<(ShowcaseListView())(^.wrapped := ShowcaseListViewProps(
items = List(
"Styles" -> "Demo different styles",
"DemoTask" -> "Demo API tasks",
"UI" -> "Demo common UI components"
),
navigate = props.navigate
))()
}
private[app] lazy val demoTaskComp = new DemoTaskController(ShowcaseActions).apply()
def getHomeScreens(stack: StackNavigator): Seq[ReactElement] = {
// styles
StylesScreen.getStylesStack(stack) ++ List(
// ui
<(stack.Screen)(^.name := "DemoTask", ^.component := demoTaskComp)()
) ++
UiDemoScreen.getUiStack(stack)
}
}