Skip to content

Commit 6db8bcf

Browse files
committed
chore: rm warnings by follow hint
1 parent 027a9e4 commit 6db8bcf

File tree

6 files changed

+117
-51
lines changed

6 files changed

+117
-51
lines changed

.agignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
./node_modules/**/*
2+
.expo/*
3+
npm-debug.*
4+
*.jks
5+
*.p12
6+
*.key
7+
*.mobileprovision
8+
yarn.lock

App.js

+17-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
import React from 'react';
2-
import { Platform, StatusBar, StyleSheet, View } from 'react-native';
3-
import { AppLoading, Asset, Font, Icon } from 'expo';
4-
import AppNavigator from './navigation/AppNavigator';
1+
import React from 'react'
2+
import { Platform, StatusBar, StyleSheet, View } from 'react-native'
3+
import { AppLoading } from 'expo'
4+
import { Asset } from 'expo-asset'
5+
import * as Font from 'expo-font'
6+
import * as Icon from '@expo/vector-icons'
7+
import AppNavigator from './navigation/AppNavigator'
58

69
export default class App extends React.Component {
710
state = {
811
isLoadingComplete: false,
9-
};
12+
}
1013

1114
render() {
1215
if (!this.state.isLoadingComplete && !this.props.skipLoadingScreen) {
@@ -16,14 +19,14 @@ export default class App extends React.Component {
1619
onError={this._handleLoadingError}
1720
onFinish={this._handleFinishLoading}
1821
/>
19-
);
22+
)
2023
} else {
2124
return (
2225
<View style={styles.container}>
2326
{Platform.OS === 'ios' && <StatusBar barStyle="default" />}
2427
<AppNavigator />
2528
</View>
26-
);
29+
)
2730
}
2831
}
2932

@@ -40,23 +43,23 @@ export default class App extends React.Component {
4043
// to remove this if you are not using it in your app
4144
'space-mono': require('./assets/fonts/SpaceMono-Regular.ttf'),
4245
}),
43-
]);
44-
};
46+
])
47+
}
4548

4649
_handleLoadingError = error => {
4750
// In this case, you might want to report the error to your error
4851
// reporting service, for example Sentry
49-
console.warn(error);
50-
};
52+
console.warn(error)
53+
}
5154

5255
_handleFinishLoading = () => {
53-
this.setState({ isLoadingComplete: true });
54-
};
56+
this.setState({ isLoadingComplete: true })
57+
}
5558
}
5659

5760
const styles = StyleSheet.create({
5861
container: {
5962
flex: 1,
6063
backgroundColor: '#fff',
6164
},
62-
});
65+
})

components/TabBarIcon.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
2-
import { Icon } from 'expo';
1+
import React from 'react'
2+
import * as Icon from '@expo/vector-icons'
33

4-
import Colors from '../constants/Colors';
4+
import Colors from '../constants/Colors'
55

66
export default class TabBarIcon extends React.Component {
77
render() {
@@ -10,8 +10,10 @@ export default class TabBarIcon extends React.Component {
1010
name={this.props.name}
1111
size={26}
1212
style={{ marginBottom: -3 }}
13-
color={this.props.focused ? Colors.tabIconSelected : Colors.tabIconDefault}
13+
color={
14+
this.props.focused ? Colors.tabIconSelected : Colors.tabIconDefault
15+
}
1416
/>
15-
);
17+
)
1618
}
17-
}
19+
}

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
},
1313
"dependencies": {
1414
"@expo/samples": "2.1.1",
15+
"@expo/vector-icons": "^9.0.0",
1516
"expo": "^33.0.0",
17+
"expo-asset": "^5.0.1",
18+
"expo-font": "~5.0.1",
1619
"react": "16.8.3",
1720
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
1821
"react-navigation": "^3.11.0"

screens/HomeScreen.js

+46-29
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React from 'react'
22
import {
33
Image,
44
Platform,
@@ -7,20 +7,23 @@ import {
77
Text,
88
TouchableOpacity,
99
View,
10-
} from 'react-native';
11-
import { WebBrowser } from 'expo';
10+
} from 'react-native'
11+
import { WebBrowser } from 'expo'
1212

13-
import { MonoText } from '../components/StyledText';
13+
import { MonoText } from '../components/StyledText'
1414

1515
export default class HomeScreen extends React.Component {
1616
static navigationOptions = {
1717
header: null,
18-
};
18+
}
1919

2020
render() {
2121
return (
2222
<View style={styles.container}>
23-
<ScrollView style={styles.container} contentContainerStyle={styles.contentContainer}>
23+
<ScrollView
24+
style={styles.container}
25+
contentContainerStyle={styles.contentContainer}
26+
>
2427
<View style={styles.welcomeContainer}>
2528
<Image
2629
source={
@@ -35,33 +38,44 @@ export default class HomeScreen extends React.Component {
3538
<View style={styles.getStartedContainer}>
3639
{this._maybeRenderDevelopmentModeWarning()}
3740

38-
<Text style={styles.getStartedText}>Get started by opening</Text>
41+
<Text style={styles.getStartedText}>CPS 客户端</Text>
3942

40-
<View style={[styles.codeHighlightContainer, styles.homeScreenFilename]}>
41-
<MonoText style={styles.codeHighlightText}>screens/HomeScreen.js</MonoText>
43+
<View
44+
style={[styles.codeHighlightContainer, styles.homeScreenFilename]}
45+
>
46+
<MonoText style={styles.codeHighlightText}>
47+
screens/HomeScreen.js
48+
</MonoText>
4249
</View>
43-
44-
<Text style={styles.getStartedText}>
45-
Change this text and your app will automatically reload.
46-
</Text>
4750
</View>
4851

4952
<View style={styles.helpContainer}>
50-
<TouchableOpacity onPress={this._handleHelpPress} style={styles.helpLink}>
51-
<Text style={styles.helpLinkText}>Help, it didn’t automatically reload!</Text>
53+
<TouchableOpacity
54+
onPress={this._handleHelpPress}
55+
style={styles.helpLink}
56+
>
57+
<Text style={styles.helpLinkText}>
58+
Help, it didn’t automatically reload!
59+
</Text>
5260
</TouchableOpacity>
5361
</View>
5462
</ScrollView>
5563

5664
<View style={styles.tabBarInfoContainer}>
57-
<Text style={styles.tabBarInfoText}>This is a tab bar. You can edit it in:</Text>
65+
<Text style={styles.tabBarInfoText}>
66+
This is a tab bar. You can edit it in:
67+
</Text>
5868

59-
<View style={[styles.codeHighlightContainer, styles.navigationFilename]}>
60-
<MonoText style={styles.codeHighlightText}>navigation/MainTabNavigator.js</MonoText>
69+
<View
70+
style={[styles.codeHighlightContainer, styles.navigationFilename]}
71+
>
72+
<MonoText style={styles.codeHighlightText}>
73+
navigation/MainTabNavigator.js
74+
</MonoText>
6175
</View>
6276
</View>
6377
</View>
64-
);
78+
)
6579
}
6680

6781
_maybeRenderDevelopmentModeWarning() {
@@ -70,32 +84,34 @@ export default class HomeScreen extends React.Component {
7084
<Text onPress={this._handleLearnMorePress} style={styles.helpLinkText}>
7185
Learn more
7286
</Text>
73-
);
87+
)
7488

7589
return (
7690
<Text style={styles.developmentModeText}>
77-
Development mode is enabled, your app will be slower but you can use useful development
78-
tools. {learnMoreButton}
91+
Development mode is enabled, your app will be slower but you can use
92+
useful development tools. {learnMoreButton}
7993
</Text>
80-
);
94+
)
8195
} else {
8296
return (
8397
<Text style={styles.developmentModeText}>
8498
You are not in development mode, your app will run at full speed.
8599
</Text>
86-
);
100+
)
87101
}
88102
}
89103

90104
_handleLearnMorePress = () => {
91-
WebBrowser.openBrowserAsync('https://docs.expo.io/versions/latest/guides/development-mode');
92-
};
105+
WebBrowser.openBrowserAsync(
106+
'https://docs.expo.io/versions/latest/guides/development-mode'
107+
)
108+
}
93109

94110
_handleHelpPress = () => {
95111
WebBrowser.openBrowserAsync(
96112
'https://docs.expo.io/versions/latest/guides/up-and-running.html#can-t-see-your-changes'
97-
);
98-
};
113+
)
114+
}
99115
}
100116

101117
const styles = StyleSheet.create({
@@ -142,6 +158,7 @@ const styles = StyleSheet.create({
142158
},
143159
getStartedText: {
144160
fontSize: 17,
161+
fontWeight: 'bold',
145162
color: 'rgba(96,100,109, 1)',
146163
lineHeight: 24,
147164
textAlign: 'center',
@@ -185,4 +202,4 @@ const styles = StyleSheet.create({
185202
fontSize: 14,
186203
color: '#2e78b7',
187204
},
188-
});
205+
})

yarn.lock

+35-2
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,13 @@
773773
dependencies:
774774
lodash "^4.17.4"
775775

776+
"@expo/vector-icons@^9.0.0":
777+
version "9.0.0"
778+
resolved "https://registry.npmjs.org/@expo/vector-icons/-/vector-icons-9.0.0.tgz#7f18e21d3edc8b99b76d7d1b8e26b212393e08b3"
779+
dependencies:
780+
lodash "^4.17.4"
781+
react-native-vector-icons "6.0.0"
782+
776783
"@expo/websql@^1.0.1":
777784
version "1.0.1"
778785
resolved "https://registry.npmjs.org/@expo/websql/-/websql-1.0.1.tgz#fff0cf9c1baa1f70f9e1d658b7c39a420d9b10a9"
@@ -2202,7 +2209,7 @@ expo-app-loader-provider@~5.0.1:
22022209
version "5.0.1"
22032210
resolved "https://registry.npmjs.org/expo-app-loader-provider/-/expo-app-loader-provider-5.0.1.tgz#56f531e189de8407bdf257d5753ccec43dd253f7"
22042211

2205-
expo-asset@~5.0.1:
2212+
expo-asset@^5.0.1, expo-asset@~5.0.1:
22062213
version "5.0.1"
22072214
resolved "https://registry.npmjs.org/expo-asset/-/expo-asset-5.0.1.tgz#02445aeb695b8449cb7239e11fc3a8d34e6c86ce"
22082215
dependencies:
@@ -3908,7 +3915,7 @@ lodash.throttle@^4.1.1:
39083915
version "4.1.1"
39093916
resolved "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
39103917

3911-
lodash@^4.16.2, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@^4.5.0, lodash@^4.6.0, lodash@^4.6.1:
3918+
lodash@^4.0.0, lodash@^4.16.2, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@^4.5.0, lodash@^4.6.0, lodash@^4.6.1:
39123919
version "4.17.11"
39133920
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
39143921

@@ -5158,6 +5165,14 @@ react-native-tab-view@^1.4.1:
51585165
dependencies:
51595166
prop-types "^15.6.1"
51605167

5168+
5169+
version "6.0.0"
5170+
resolved "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-6.0.0.tgz#3a7076dbe244ea94c6d5e92802a870e64a4283c5"
5171+
dependencies:
5172+
lodash "^4.0.0"
5173+
prop-types "^15.6.2"
5174+
yargs "^8.0.2"
5175+
51615176
51625177
version "2.6.0"
51635178
resolved "https://registry.npmjs.org/react-native-view-shot/-/react-native-view-shot-2.6.0.tgz#3b23675826f67658366352c4b97b59a6aded2f43"
@@ -6463,6 +6478,24 @@ yargs@^12.0.2:
64636478
y18n "^3.2.1 || ^4.0.0"
64646479
yargs-parser "^11.1.1"
64656480

6481+
yargs@^8.0.2:
6482+
version "8.0.2"
6483+
resolved "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360"
6484+
dependencies:
6485+
camelcase "^4.1.0"
6486+
cliui "^3.2.0"
6487+
decamelize "^1.1.1"
6488+
get-caller-file "^1.0.1"
6489+
os-locale "^2.0.0"
6490+
read-pkg-up "^2.0.0"
6491+
require-directory "^2.1.1"
6492+
require-main-filename "^1.0.1"
6493+
set-blocking "^2.0.0"
6494+
string-width "^2.0.0"
6495+
which-module "^2.0.0"
6496+
y18n "^3.2.1"
6497+
yargs-parser "^7.0.0"
6498+
64666499
yargs@^9.0.0:
64676500
version "9.0.1"
64686501
resolved "https://registry.npmjs.org/yargs/-/yargs-9.0.1.tgz#52acc23feecac34042078ee78c0c007f5085db4c"

0 commit comments

Comments
 (0)