Skip to content

Commit

Permalink
feat(*): init project
Browse files Browse the repository at this point in the history
  • Loading branch information
sosomuse committed Jul 14, 2021
1 parent 12fd7be commit e1a393a
Show file tree
Hide file tree
Showing 18 changed files with 23,485 additions and 144 deletions.
98 changes: 0 additions & 98 deletions .circleci/config.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.eslintrc.js
node_modules/
lib/
25 changes: 25 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
plugins: ['react-native', '@typescript-eslint', 'react'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
es6: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
};
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
singleQuote: true,
};
39 changes: 28 additions & 11 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
import * as React from 'react';

import { StyleSheet, View, Text } from 'react-native';
import AnimatedScrollView from 'react-native-animated-scroll-view';

export default function App() {
const [result, setResult] = React.useState<number | undefined>();
import { ScrollView } from 'react-native-animated-scroll-view';

React.useEffect(() => {
AnimatedScrollView.multiply(3, 7).then(setResult);
}, []);
const DATA = Array.from({ length: 30 }).map((_, index) => ({ id: index }));
const maxHeight = 150;
const minHeight = 50;

export default function App() {
return (
<View style={styles.container}>
<Text>Result: {result}</Text>
<ScrollView
style={styles.container}
maxHeight={maxHeight}
minHeight={minHeight}
AnimationHeaderComponent={<View style={styles.animationHeader} />}
>
{DATA.map((item) => {
return (
<View style={styles.listItem} key={item.id}>
<Text>{item.id}</Text>
</View>
);
})}
</ScrollView>
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
box: {
width: 60,
height: 60,
marginVertical: 20,
},
listItem: {
width: '100%',
height: 60,
},
animationHeader: {
backgroundColor: 'red',
height: '100%',
width: '100%',
},
});
16 changes: 16 additions & 0 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"jsx": "react-native",
"target": "esnext",
"lib": [
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"noEmit": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"moduleResolution": "node"
}
}
Loading

0 comments on commit e1a393a

Please sign in to comment.