@shoutem/ui 9.0.0-rc.3 → 9.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,7 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
- import { Animated } from 'react-native';
2
+ import { Animated, ScrollView } from 'react-native';
3
3
  import PropTypes from 'prop-types';
4
4
  import { connectStyle } from '@shoutem/theme';
5
- import { ScrollView } from './ScrollView';
6
5
  import { Text } from './Text';
7
6
 
8
7
  const DEFAULT_CONFIG = {
@@ -10,7 +9,7 @@ const DEFAULT_CONFIG = {
10
9
  waitDuration: 2000,
11
10
  };
12
11
 
13
- const AnimatedScrollingText = ({ text, config, style }) => {
12
+ const AnimatedScrollingText = ({ text, config = DEFAULT_CONFIG, style }) => {
14
13
  const translateX = useRef(new Animated.Value(0)).current;
15
14
 
16
15
  const [containerWidth, setContainerWidth] = useState();
@@ -84,12 +83,12 @@ const AnimatedScrollingText = ({ text, config, style }) => {
84
83
 
85
84
  AnimatedScrollingText.propTypes = {
86
85
  text: PropTypes.string.isRequired,
86
+ // eslint-disable-next-line react/require-default-props
87
87
  config: PropTypes.object,
88
88
  style: PropTypes.object,
89
89
  };
90
90
 
91
91
  AnimatedScrollingText.defaultProps = {
92
- config: DEFAULT_CONFIG,
93
92
  style: {},
94
93
  };
95
94
 
@@ -6,6 +6,11 @@ import PropTypes from 'prop-types';
6
6
  import { AnimationDriverContext, ScrollDriver } from '@shoutem/animation';
7
7
  import { connectStyle } from '@shoutem/theme';
8
8
 
9
+ // ScrollView component envisioned to be used as a container component inside
10
+ // the Shoutem screens. It will correctly set the current animation driver
11
+ // when it is mounted inside the parent screen. In case you don't want the scroll
12
+ // that is aware of the animation driver context, but want the shoutem themed styling,
13
+ // you should use the plain RN ScrollView and connect it to the 'shoutem.ui.ScrollView' stylename
9
14
  const ScrollView = ({ driver, onScroll, primary, style, ...otherProps }) => {
10
15
  const animationDriver = useRef(
11
16
  driver ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoutem/ui",
3
- "version": "9.0.0-rc.3",
3
+ "version": "9.0.0-rc.4",
4
4
  "description": "Styleable set of components for React Native applications",
5
5
  "scripts": {
6
6
  "lint": "eslint .",
@@ -17,7 +17,7 @@
17
17
  "@react-native-community/datetimepicker": "6.2.0",
18
18
  "@shoutem/animation": "1.0.0-rc.1",
19
19
  "@shoutem/eslint-config-react": "~1.0.6",
20
- "@shoutem/theme": "1.0.0-rc.2",
20
+ "@shoutem/theme": "1.0.0-rc.3",
21
21
  "auto-bind": "4.0.0",
22
22
  "babel-plugin-transform-decorators-legacy": "1.3.5",
23
23
  "buffer": "5.6.0",