-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add react-native-animate (#8) #11
Draft
mvillafuertem
wants to merge
2
commits into
master
Choose a base branch
from
feature/react-native-animate
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
Don't worry at all Thanks for keeping it up here. I'll have a look as soon as easter permits :) |
You can type the animated components like this: diff --git a/react-native-animations/src/main/scala/demo/AnimatedIconApp.scala b/react-native-animations/src/main/scala/demo/AnimatedIconApp.scala
index 8b569ea..84b930e 100644
--- a/react-native-animations/src/main/scala/demo/AnimatedIconApp.scala
+++ b/react-native-animations/src/main/scala/demo/AnimatedIconApp.scala
@@ -8,7 +8,7 @@ import japgolly.scalajs.react.{CallbackTo, Children, CtorType, JsComponent, Scal
import typings.react.mod.useState
import typings.reactNative.components.{TouchableWithoutFeedback, View}
import typings.reactNative.mod.Animated.{InterpolationConfigType, SpringAnimationConfig, TimingAnimationConfig}
-import typings.reactNative.mod.{Animated, FlexAlignType, ViewStyle}
+import typings.reactNative.mod.{Animated, FlexAlignType, OpaqueColorValue, ViewProps, ViewStyle}
import typings.reactNative.reactNativeStrings
import scala.scalajs.js
@@ -97,25 +97,19 @@ object AnimatedIconApp {
)(
TouchableWithoutFeedback().onPress((_) => CallbackTo[Unit](startAnimation()))(
AnimatedView.component(
- js.Dynamic
- .literal(
- style = js.Array(
- js.Dynamic.literal(
- display = reactNativeStrings.flex,
- flexDirection = reactNativeStrings.column,
- justifyContent = reactNativeStrings.`space-between`,
- alignItems = reactNativeStrings.center,
- width = 100,
- height = 100,
- paddingVertical = 20,
- borderRadius = 50,
- backgroundColor = jsAnimation
- .interpolate(InterpolationConfigType(js.Array(0, 1), js.Array("green", "red")))
- .asInstanceOf[js.Dynamic]
- )
- )
- )
- .asInstanceOf[AnimatedViewProps]
+ ViewProps()
+ .setStyle(
+ ViewStyle()
+ .setDisplay(reactNativeStrings.flex)
+ .setFlexDirection(reactNativeStrings.column)
+ .setJustifyContent(reactNativeStrings.`space-between`)
+ .setAlignItems(FlexAlignType.center)
+ .setWidth(100)
+ .setHeight(100)
+ .setPaddingVertical(20)
+ .setBorderRadius(50)
+ .setBackgroundColor(jsAnimation.interpolate(InterpolationConfigType(js.Array(0, 1), js.Array("green", "red"))).asInstanceOf[OpaqueColorValue])
+ ),
)(
AnimatedView.component(
js.Dynamic
diff --git a/react-native-animations/src/main/scala/demo/facade/AnimatedView.scala b/react-native-animations/src/main/scala/demo/facade/AnimatedView.scala
index 30c7b9c..de5f3e7 100644
--- a/react-native-animations/src/main/scala/demo/facade/AnimatedView.scala
+++ b/react-native-animations/src/main/scala/demo/facade/AnimatedView.scala
@@ -1,8 +1,8 @@
package demo.facade
-import japgolly.scalajs.react.{Children, CtorType, JsComponent}
import japgolly.scalajs.react.component.Js
-import typings.reactNative.components.SharedBuilder_ViewProps39190290
+import japgolly.scalajs.react.{Children, CtorType, JsComponent}
+import typings.reactNative.mod.ViewProps
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
@@ -13,11 +13,8 @@ object AnimatedView {
@js.native
object RawComponent extends js.Object
- @js.native
- trait AnimatedViewProps extends js.Object {}
-
- val component: Js.Component[AnimatedViewProps, Null, CtorType.PropsAndChildren] =
- JsComponent[AnimatedViewProps, Children.Varargs, Null](RawComponent)
+ val component: Js.Component[ViewProps, Null, CtorType.PropsAndChildren] =
+ JsComponent[ViewProps, Children.Varargs, Null](RawComponent)
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had some problems with my fork and I had to delete it, to recover the changes I had to merge into a scalablytyped branch. I'm sorry :(