aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/reading/Main.scala
blob: 61048915da19e9fdaf034924b0dc2d48bef16e4f (plain)
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
package reading

import scala.scalajs.js.JSApp

import org.scalajs.dom

import scalacss.Defaults._

import reading.component.style.{ Global => GlobalStyle }
import reading.utils.RxTag

object Main extends JSApp {
  def main(): Unit = {
    val style = dom.document.createElement("style")
    style.appendChild(dom.document.createTextNode(GlobalStyle.render))
    dom.document.head.appendChild(style)

    val _ = dom.document.body.appendChild {
      RxTag { implicit context =>
        Route.current() match {
          case Route.Books(filters) => component.Index(filters)
        }
      }.render
    }
  }
}