-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dab9ef1
commit 541f00a
Showing
23 changed files
with
442 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
community/src/main/scala/scommons/reactnative/svg/package.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package scommons.reactnative | ||
|
||
import io.github.shogowada.scalajs.reactjs.VirtualDOM.VirtualDOMElements.ReactClassElementSpec | ||
import io.github.shogowada.scalajs.reactjs.VirtualDOM._ | ||
import io.github.shogowada.statictags._ | ||
|
||
/** @see https://github.com/react-native-community/react-native-svg | ||
*/ | ||
package object svg { | ||
|
||
implicit class SvgVirtualDOMElements(elements: VirtualDOMElements) { | ||
lazy val SvgXml: ReactClassElementSpec = elements(svg.raw.SvgXml) | ||
} | ||
|
||
implicit class SvgVirtualDOMAttributes(attributes: VirtualDOMAttributes) { | ||
|
||
lazy val xml = StringAttributeSpec("xml") | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
community/src/main/scala/scommons/reactnative/svg/raw/package.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package scommons.reactnative.svg | ||
|
||
import scommons.react.ReactClass | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation.JSImport | ||
|
||
package object raw { | ||
|
||
@js.native | ||
@JSImport("react-native-svg", "SvgXml") | ||
object SvgXml extends ReactClass | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
project/src/main/scala/definitions/ReactNativeCommunity.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package definitions | ||
|
||
import common.TestLibs | ||
import sbt.Keys._ | ||
import sbt._ | ||
import scoverage.ScoverageKeys.coverageExcludedPackages | ||
|
||
import scalajsbundler.sbtplugin.ScalaJSBundlerPlugin.autoImport._ | ||
|
||
object ReactNativeCommunity extends ScalaJsModule { | ||
|
||
override val id: String = "scommons-react-native-community" | ||
|
||
override val base: File = file("community") | ||
|
||
override def definition: Project = super.definition | ||
.settings( | ||
description := "Scala.js facades for react-native-community Components and APIs", | ||
|
||
requireJsDomEnv in Test := false, | ||
|
||
coverageExcludedPackages := "scommons.reactnative.*raw" | ||
) | ||
|
||
override val internalDependencies: Seq[ClasspathDep[ProjectReference]] = Seq( | ||
ReactNativeCore.definition | ||
) | ||
|
||
override val superRepoProjectsDependencies: Seq[(String, String, Option[String])] = Nil | ||
|
||
override val runtimeDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting(Nil) | ||
|
||
override val testDependencies: Def.Initialize[Seq[ModuleID]] = Def.setting(Seq( | ||
TestLibs.scalaTestJs.value, | ||
TestLibs.scalaMockJs.value | ||
).map(_ % "test")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
showcase/src/main/scala/showcase/app/community/CommunityDemoController.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package showcase.app.community | ||
|
||
import showcase.app.ShowcaseStateDef | ||
import io.github.shogowada.scalajs.reactjs.redux.Redux.Dispatch | ||
import scommons.react._ | ||
import scommons.react.navigation._ | ||
import scommons.reactnative.app.BaseStateAndRouteController | ||
|
||
object CommunityDemoController | ||
extends BaseStateAndRouteController[ShowcaseStateDef, CommunityDemoScreenProps] { | ||
|
||
lazy val uiComponent: UiComponent[CommunityDemoScreenProps] = CommunityDemoScreen | ||
|
||
def mapStateAndRouteToProps(dispatch: Dispatch, | ||
state: ShowcaseStateDef, | ||
nav: Navigation): CommunityDemoScreenProps = { | ||
CommunityDemoScreenProps( | ||
navigate = { screen => | ||
nav.navigate(screen) | ||
} | ||
) | ||
} | ||
} |
Oops, something went wrong.