Skip to content

Commit 2701c3e

Browse files
committed
minor updates & cleanup
1 parent 7e82ea1 commit 2701c3e

File tree

17 files changed

+1009
-3698
lines changed

17 files changed

+1009
-3698
lines changed

.circleci/config.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ jobs:
66
working_directory: ~/repo
77
steps:
88
- checkout
9-
- run: npm i
10-
- run: npm run lint
11-
- run: npm run build
12-
- run: cd CollapsibleHeaderViewsExample
13-
- run: npm i
14-
- run: npm run lint
15-
- run: npm run build
9+
10+
- run: npm i && npm run lint && npm run build
11+
12+
- run: cd CollapsibleHeaderViewsExample && npm i && npm run build
13+
1614
- persist_to_workspace:
1715
root: .
1816
paths:
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import * as React from 'react';
2-
import { createStackNavigator } from 'react-navigation';
3-
import { Home } from './screens/Home';
4-
import { Basic } from './screens/Basic';
5-
import { InterpolatedTranslation } from './screens/InterpolatedTranslation';
6-
import { ShowAndHide } from './screens/ShowAndHide';
7-
import { WithoutSnap } from './screens/WithoutSnap';
8-
import { WrappedInstanceMethods } from './screens/WrappedInstanceMethods';
1+
import * as React from 'react'
2+
import { createStackNavigator } from 'react-navigation'
3+
import { Home } from './screens/Home'
4+
import { Basic } from './screens/Basic'
5+
import { InterpolatedTranslation } from './screens/InterpolatedTranslation'
6+
import { ShowAndHide } from './screens/ShowAndHide'
7+
import { WithoutSnap } from './screens/WithoutSnap'
8+
import { WrappedInstanceMethods } from './screens/WrappedInstanceMethods'
99

1010
const RootStack = createStackNavigator({
1111
Home: { screen: Home },
@@ -17,12 +17,12 @@ const RootStack = createStackNavigator({
1717
}, {
1818
initialRouteName: 'Home',
1919
headerMode: 'none'
20-
});
20+
})
2121

22-
type Props = {};
22+
type Props = {}
2323

2424
export default class App extends React.Component<Props> {
2525
render() {
26-
return <RootStack />;
26+
return <RootStack />
2727
}
2828
}

CollapsibleHeaderViewsExample/package-lock.json

Lines changed: 761 additions & 3404 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CollapsibleHeaderViewsExample/package.json

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,28 @@
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {
6-
"preinstall": "cd .. && npm i --only=prod",
6+
"preinstall": "cd .. && npm i",
77
"postinstall": "metro-with-symlinks",
8-
"build": "rm -rf build && tsc -p .",
9-
"lint": "tslint -p .",
8+
"build": "rm -rf build && ../node_modules/.bin/tsc -p .",
109
"watch": "npm run build -- --watch",
1110
"run:android": "npm run clean:android && react-native run-android",
1211
"clean:android": "cd android && ./gradlew clean",
1312
"start": "node node_modules/react-native/local-cli/cli.js start",
14-
"reset:packager": "watchman watch-del-all && node_modules/react-native/scripts/packager.sh --reset-cache",
15-
"test": "jest"
13+
"reset:packager": "watchman watch-del-all && node_modules/react-native/scripts/packager.sh --reset-cache"
1614
},
1715
"dependencies": {
1816
"cat-names": "github:iyegoroff/cat-names#types",
1917
"react": "16.5.1",
2018
"react-native": "0.57.0",
2119
"react-native-collapsible-header-views": "file:../",
22-
"react-native-iphone-x-helper": "^1.1.0",
23-
"react-navigation": "^2.13.0"
20+
"react-native-iphone-x-helper": "1.2.0",
21+
"react-navigation": "2.13.0"
2422
},
2523
"devDependencies": {
26-
"@types/react": "^16.4.13",
27-
"@types/react-native": "^0.56.18",
24+
"@types/react": "16.8.2",
25+
"@types/react-native": "0.57.34",
2826
"@types/react-navigation": "^2.0.19",
29-
"babel-jest": "23.4.2",
30-
"jest": "23.5.0",
3127
"metro-react-native-babel-preset": "^0.45.2",
32-
"metro-with-symlinks": "github:treyp/metro-with-symlinks#rn-47",
33-
"react-test-renderer": "16.4.1",
34-
"tslint": "^5.11.0",
35-
"tslint-config-standard": "^8.0.1",
36-
"typescript": "^3.0.3",
37-
"vrsource-tslint-rules": "^5.8.2"
38-
},
39-
"jest": {
40-
"preset": "react-native"
28+
"metro-with-symlinks": "1.3.0"
4129
}
4230
}

CollapsibleHeaderViewsExample/screens/Basic.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as React from 'react';
2-
import { NavigationScreenConfigProps } from 'react-navigation';
3-
import { StyleSheet, View, Text, TouchableOpacity, StatusBar } from 'react-native';
4-
import { CollapsibleHeaderFlatList } from 'react-native-collapsible-header-views';
5-
import { getStatusBarHeight } from 'react-native-iphone-x-helper';
1+
import * as React from 'react'
2+
import { NavigationScreenConfigProps } from 'react-navigation'
3+
import { StyleSheet, View, Text, TouchableOpacity, StatusBar } from 'react-native'
4+
import { CollapsibleHeaderFlatList } from 'react-native-collapsible-header-views'
5+
import { getStatusBarHeight } from 'react-native-iphone-x-helper'
66

77
const Header = ({ goBack }: { goBack: () => void }) => (
88
<View style={styles.header}>
@@ -13,7 +13,7 @@ const Header = ({ goBack }: { goBack: () => void }) => (
1313
</TouchableOpacity>
1414
<Text style={styles.title}>BASIC</Text>
1515
</View>
16-
);
16+
)
1717

1818
export const Basic = ({ navigation }: NavigationScreenConfigProps) => (
1919
<>
@@ -34,19 +34,19 @@ export const Basic = ({ navigation }: NavigationScreenConfigProps) => (
3434
keyExtractor={keyExtractor}
3535
/>
3636
</>
37-
);
37+
)
3838

39-
const keyExtractor = (item: number, _index: number) => `${item}`;
39+
const keyExtractor = (item: number, _index: number) => `${item}`
4040

41-
const data = Array(50).fill(0).map((_, i) => i);
41+
const data = Array(50).fill(0).map((_, i) => i)
4242

4343
const Item = ({ item }: { item: number }) => (
4444
<Text style={styles.item}>{item}</Text>
45-
);
45+
)
4646

4747
const Separator = () => (
4848
<View style={styles.separator} />
49-
);
49+
)
5050

5151
const styles = StyleSheet.create({
5252
item: {
@@ -76,4 +76,4 @@ const styles = StyleSheet.create({
7676
fontSize: 20,
7777
color: 'white'
7878
}
79-
});
79+
})

CollapsibleHeaderViewsExample/screens/Home.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as React from 'react';
2-
import { View, StyleSheet, TouchableOpacity, Text, ViewStyle, StatusBar } from 'react-native';
3-
import { NavigationScreenConfigProps } from 'react-navigation';
1+
import * as React from 'react'
2+
import { View, StyleSheet, TouchableOpacity, Text, ViewStyle, StatusBar } from 'react-native'
3+
import { NavigationScreenConfigProps } from 'react-navigation'
44

5-
const route = (routeName: string) => ({ routeName, key: 'example' });
5+
const route = (routeName: string) => ({ routeName, key: 'example' })
66

77
export const Home = ({ navigation }: NavigationScreenConfigProps) => {
88
return (
@@ -53,15 +53,15 @@ export const Home = ({ navigation }: NavigationScreenConfigProps) => {
5353
</View>
5454
</TouchableOpacity>
5555
</View>
56-
);
57-
};
56+
)
57+
}
5858

5959
const buttonStyle: ViewStyle = {
6060
flex: 1,
6161
justifyContent: 'center',
6262
alignItems: 'center',
6363
width: '100%'
64-
};
64+
}
6565

6666
const styles = StyleSheet.create({
6767
container: {
@@ -92,4 +92,4 @@ const styles = StyleSheet.create({
9292
...buttonStyle,
9393
backgroundColor: '#FFDA6C'
9494
}
95-
});
95+
})

CollapsibleHeaderViewsExample/screens/InterpolatedTranslation.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as React from 'react';
2-
import { NavigationScreenConfigProps } from 'react-navigation';
1+
import * as React from 'react'
2+
import { NavigationScreenConfigProps } from 'react-navigation'
33
import {
44
StyleSheet,
55
View,
@@ -8,12 +8,12 @@ import {
88
Animated,
99
StatusBar,
1010
Dimensions
11-
} from 'react-native';
11+
} from 'react-native'
1212
import {
1313
CollapsibleHeaderFlatList,
1414
CollapsibleHeaderProps
15-
} from 'react-native-collapsible-header-views';
16-
import { getStatusBarHeight } from 'react-native-iphone-x-helper';
15+
} from 'react-native-collapsible-header-views'
16+
import { getStatusBarHeight } from 'react-native-iphone-x-helper'
1717

1818
const Header = ({
1919
goBack,
@@ -33,7 +33,7 @@ const Header = ({
3333
</TouchableOpacity>
3434
<Text style={styles.title}>INTERPOLATED TRANSLATION</Text>
3535
</Animated.View>
36-
);
36+
)
3737

3838
export const InterpolatedTranslation = ({ navigation }: NavigationScreenConfigProps) => (
3939
<>
@@ -56,19 +56,19 @@ export const InterpolatedTranslation = ({ navigation }: NavigationScreenConfigPr
5656
keyExtractor={keyExtractor}
5757
/>
5858
</>
59-
);
59+
)
6060

61-
const keyExtractor = (item: number, _index: number) => `${item}`;
61+
const keyExtractor = (item: number, _index: number) => `${item}`
6262

63-
const data = Array(50).fill(0).map((_, i) => i);
63+
const data = Array(50).fill(0).map((_, i) => i)
6464

6565
const Item = ({ item }: { item: number }) => (
6666
<Text style={styles.item}>{item}</Text>
67-
);
67+
)
6868

6969
const Separator = () => (
7070
<View style={styles.separator} />
71-
);
71+
)
7272

7373
const styles = StyleSheet.create({
7474
item: {
@@ -103,4 +103,4 @@ const styles = StyleSheet.create({
103103
fontSize: 28,
104104
color: 'white'
105105
}
106-
});
106+
})

CollapsibleHeaderViewsExample/screens/ShowAndHide.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import * as React from 'react';
2-
import { NavigationScreenConfigProps } from 'react-navigation';
3-
import { StyleSheet, View, Text, TouchableOpacity, TextInput, Animated } from 'react-native';
1+
import * as React from 'react'
2+
import { NavigationScreenConfigProps } from 'react-navigation'
3+
import { StyleSheet, View, Text, TouchableOpacity, TextInput, Animated } from 'react-native'
44
import {
55
CollapsibleHeaderFlatList,
66
CollapsibleHeaderProps
7-
} from 'react-native-collapsible-header-views';
8-
import { isIphoneX, getStatusBarHeight } from 'react-native-iphone-x-helper';
9-
import { all } from 'cat-names';
7+
} from 'react-native-collapsible-header-views'
8+
import { isIphoneX, getStatusBarHeight } from 'react-native-iphone-x-helper'
9+
import { all } from 'cat-names'
1010

1111
export class ShowAndHide extends React.Component<NavigationScreenConfigProps, { text: string }> {
1212

13-
public state = { text: '' };
13+
public state = { text: '' }
1414

1515
private header = (props: CollapsibleHeaderProps) => (
1616
<Animated.View style={[
@@ -48,20 +48,20 @@ export class ShowAndHide extends React.Component<NavigationScreenConfigProps, {
4848
ItemSeparatorComponent={Separator}
4949
keyExtractor={keyExtractor}
5050
/>
51-
);
51+
)
5252
}
5353
}
5454

55-
const keyExtractor = (item: string, _index: number) => `${item}`;
56-
const statusBarHeight = () => isIphoneX() ? getStatusBarHeight(false) : 0;
55+
const keyExtractor = (item: string, _index: number) => `${item}`
56+
const statusBarHeight = () => isIphoneX() ? getStatusBarHeight(false) : 0
5757

5858
const Item = ({ item }: { item: string }) => (
5959
<Text style={styles.item}>{item}</Text>
60-
);
60+
)
6161

6262
const Separator = () => (
6363
<View style={styles.separator} />
64-
);
64+
)
6565

6666
const styles = StyleSheet.create({
6767
container: {
@@ -104,4 +104,4 @@ const styles = StyleSheet.create({
104104
borderRadius: 3,
105105
margin: 3
106106
}
107-
});
107+
})

CollapsibleHeaderViewsExample/screens/WithoutSnap.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as React from 'react';
2-
import { NavigationScreenConfigProps } from 'react-navigation';
3-
import { StyleSheet, View, Text, TouchableOpacity, StatusBar } from 'react-native';
4-
import { CollapsibleHeaderScrollView } from 'react-native-collapsible-header-views';
5-
import { getStatusBarHeight } from 'react-native-iphone-x-helper';
1+
import * as React from 'react'
2+
import { NavigationScreenConfigProps } from 'react-navigation'
3+
import { StyleSheet, View, Text, TouchableOpacity, StatusBar } from 'react-native'
4+
import { CollapsibleHeaderScrollView } from 'react-native-collapsible-header-views'
5+
import { getStatusBarHeight } from 'react-native-iphone-x-helper'
66

77
const Header = ({ goBack }: { goBack: () => void }) => (
88
<View style={styles.header}>
@@ -13,7 +13,7 @@ const Header = ({ goBack }: { goBack: () => void }) => (
1313
</TouchableOpacity>
1414
<Text style={styles.title}>WITHOUT SNAP</Text>
1515
</View>
16-
);
16+
)
1717

1818
export const WithoutSnap = ({ navigation }: NavigationScreenConfigProps) => (
1919
<>
@@ -33,7 +33,7 @@ export const WithoutSnap = ({ navigation }: NavigationScreenConfigProps) => (
3333
<View style={styles.content} />
3434
</CollapsibleHeaderScrollView>
3535
</>
36-
);
36+
)
3737

3838
const styles = StyleSheet.create({
3939
content: {
@@ -62,4 +62,4 @@ const styles = StyleSheet.create({
6262
fontSize: 20,
6363
color: 'white'
6464
}
65-
});
65+
})

0 commit comments

Comments
 (0)