Skip to content

Commit 0f8890e

Browse files
committed
Initial commit
0 parents  commit 0f8890e

File tree

15 files changed

+8090
-0
lines changed

15 files changed

+8090
-0
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# node.js
6+
#
7+
node_modules/
8+
npm-debug.log
9+
yarn-error.log
10+
11+
dist

.npmignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*.test.js
2+
__snapshots/**
3+
.babelrc
4+
.eslintrc
5+
.eslintignore
6+
.flowconfig
7+
.yarn.lock
8+
.gitattributes
9+
.prettierrc
10+
docs/
11+
.idea

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"trailingComma": "es5"
5+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Louis Lagrange
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# react-native-web-lottie
2+
> React Native for Web implementation of Lottie
3+
4+
## Getting started
5+
`$ npm install react-native-web-lottie --save`
6+
7+
Alias the package in your webpack config:
8+
9+
```
10+
resolve: {
11+
alias: {
12+
'react-native': 'react-native-web',
13+
...
14+
'lottie-react-native': 'react-native-web-lottie',
15+
}
16+
}
17+
```
18+
19+
## Usage
20+
See [Lottie's docs](http://airbnb.io/lottie/react-native/react-native.html/).
21+
22+
## Examples
23+
See the [storybook](https://react-native-web-community.github.io/react-native-web-lottie/storybook).
24+
25+
## Contributing
26+
PRs are welcome!

docs/.storybook/addons.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@storybook/addon-options/register';

docs/.storybook/config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { setOptions } from '@storybook/addon-options';
2+
import { configure, addDecorator } from '@storybook/react';
3+
import centered from './decorator-centered';
4+
5+
addDecorator(centered);
6+
7+
setOptions({
8+
name: 'Name',
9+
url: 'https://react-native-web-community.github.io/react-native-web-name',
10+
goFullScreen: false,
11+
showLeftPanel: true,
12+
showDownPanel: false,
13+
downPanelInRight: false
14+
});
15+
16+
function loadStories() {
17+
require('../stories');
18+
}
19+
20+
configure(loadStories, module);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import { StyleSheet, View } from 'react-native';
3+
4+
const styles = StyleSheet.create({
5+
root: {
6+
flex: 1,
7+
alignItems: 'center',
8+
justifyContent: 'center',
9+
minHeight: '100vh',
10+
},
11+
});
12+
13+
export default function(renderStory) {
14+
return <View style={styles.root}>{renderStory()}</View>;
15+
}

docs/.storybook/webpack.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const path = require('path');
2+
const webpack = require('webpack');
3+
4+
module.exports = (storybookBaseConfig, configType) => {
5+
const DEV = configType === 'DEVELOPMENT';
6+
7+
storybookBaseConfig.module.rules.push({
8+
test: /\.js$/,
9+
exclude: /node_modules/,
10+
use: {
11+
loader: 'babel-loader',
12+
options: { cacheDirectory: true }
13+
}
14+
});
15+
16+
storybookBaseConfig.plugins.push(
17+
new webpack.DefinePlugin({
18+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
19+
'process.env.__REACT_NATIVE_DEBUG_ENABLED__': DEV
20+
})
21+
);
22+
23+
storybookBaseConfig.resolve.alias = {
24+
'react-native': 'react-native-web',
25+
'lottie-react-native': path.join(__dirname, '../../src/')
26+
};
27+
28+
return storybookBaseConfig;
29+
};

docs/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"scripts": {
3+
"build": "yarn && build-storybook -o ./dist -c ./.storybook",
4+
"start": "start-storybook -p 9001 -c ./.storybook",
5+
"release": "yarn build && git checkout gh-pages && rm -rf ../storybook && mv dist ../storybook && git add -A && git commit -m \"Storybook deploy\" && git push origin gh-pages && git checkout -"
6+
},
7+
"dependencies": {
8+
"@storybook/addon-options": "^3.2.10",
9+
"@storybook/react": "^3.1.9"
10+
}
11+
}

0 commit comments

Comments
 (0)