Skip to content

Commit

Permalink
Finalize 2.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad committed Feb 25, 2020
1 parent 6ec6f4f commit 8bb6806
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Shoutem UI is a set of styleable components that enables you to build beautiful

## Install

These instructions are valid for React Native 0.60.0 and higher. If you're running a lower version, please use v1.X.X.

```
$ npm install --save @shoutem/ui
$ react-native link @shoutem/ui # No need to run this with Create React Native App / Expo
```

We have a prelink hook which will add `@shoutem/ui`'s native dependencies to your root `package.json` in order to support autolinking and pod installation.
We have a `postinstall` script which will add `@shoutem/ui`'s native dependencies to your root `package.json` in order to support autolinking and pod installation.

## Docs

Expand Down Expand Up @@ -42,7 +43,6 @@ Install `@shoutem/ui` in your project:

```bash
$ npm install --save @shoutem/ui
$ react-native link @shoutem/ui
```

Now, simply copy the following to your `App.js` files of the React Native project:
Expand Down
12 changes: 7 additions & 5 deletions components/HorizontalPager/HorizontalPager.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ class HorizontalPager extends PureComponent {
};
}

componentDidMount() {
InteractionManager.runAfterInteractions(() => {
LayoutAnimation.easeInEaseOut();
this.setState({ shouldRenderContent: true });
});
}

componentDidUpdate(prevProps) {
const { scrollEnabled: scrollIsEnabled } = this.props;
const { selectedIndex } = this.state;
Expand All @@ -97,11 +104,6 @@ class HorizontalPager extends PureComponent {
if (!scrollIsEnabled && prevProps.scrollEnabled) {
this.scrollToPage(selectedIndex);
}

InteractionManager.runAfterInteractions(() => {
LayoutAnimation.easeInEaseOut();
this.setState({ shouldRenderContent: true });
});
}

onLayoutContainer(event) {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"prop-types": "^15.5.10",
"react-native-lightbox": "shoutem/react-native-lightbox#v0.7.2",
"react-native-linear-gradient": "~2.5.6",
"react-native-photo-view": "shoutem/react-native-photo-view#ece17646eba33a33d2d276033faa945255ae63af",
"react-native-photo-view": "shoutem/react-native-photo-view#0ffa1481f6b6cb8663cb291b7db1d6644440584d",
"react-native-render-html": "~4.1.2",
"react-native-transformable-image": "shoutem/react-native-transformable-image#v0.0.20",
"react-native-vector-icons": "^6.6.0",
Expand Down Expand Up @@ -45,7 +45,8 @@
"react-native-webview"
],
"scripts": {
"test": "mocha -R spec --require test-utils/setup.js --require react-native-mock/mock.js --compilers js:babel-core/register $(find . -name '*.spec.js' ! -ipath '*node_modules*')"
"test": "mocha -R spec --require test-utils/setup.js --require react-native-mock/mock.js --compilers js:babel-core/register $(find . -name '*.spec.js' ! -ipath '*node_modules*')",
"postinstall": "node ./scripts/add-native-deps"
},
"homepage": "http://shoutem.github.io/docs/ui-toolkit/introduction",
"bugs": {
Expand Down
3 changes: 0 additions & 3 deletions react-native.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module.exports = {
dependency: {
assets: ['fonts'],
hooks: {
prelink: 'node ./node_modules/@shoutem/ui/scripts/add-native-deps.js',
},
},
};
4 changes: 2 additions & 2 deletions scripts/add-native-deps.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const fs = require('fs-extra');
const { nativeDependencies } = require('../const');

const ROOT_PACKAGE_JSON_PATH = './package.json';
const UI_PACKAGE_JSON_PATH = './node_modules/@shoutem/ui/package.json';
const ROOT_PACKAGE_JSON_PATH = '../../../package.json';
const UI_PACKAGE_JSON_PATH = './package.json';

function insertNativeDependencies() {
const rootPackageJson = fs.readJsonSync(ROOT_PACKAGE_JSON_PATH);
Expand Down

0 comments on commit 8bb6806

Please sign in to comment.