Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb7c16d

Browse files
committed
feat: init with sdk-33, hooks rocks 🎉
0 parents  commitbb7c16d

23 files changed

+6994
-0
lines changed

‎.gitignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/**/*
2+
.expo/*
3+
npm-debug.*
4+
*.jks
5+
*.p12
6+
*.key
7+
*.mobileprovision

‎.watchmanconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

‎App.js‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
importReactfrom'react';
2+
import{Platform,StatusBar,StyleSheet,View}from'react-native';
3+
import{AppLoading,Asset,Font,Icon}from'expo';
4+
importAppNavigatorfrom'./navigation/AppNavigator';
5+
6+
exportdefaultclassAppextendsReact.Component{
7+
state={
8+
isLoadingComplete:false,
9+
};
10+
11+
render(){
12+
if(!this.state.isLoadingComplete&&!this.props.skipLoadingScreen){
13+
return(
14+
<AppLoading
15+
startAsync={this._loadResourcesAsync}
16+
onError={this._handleLoadingError}
17+
onFinish={this._handleFinishLoading}
18+
/>
19+
);
20+
}else{
21+
return(
22+
<Viewstyle={styles.container}>
23+
{Platform.OS==='ios'&&<StatusBarbarStyle="default"/>}
24+
<AppNavigator/>
25+
</View>
26+
);
27+
}
28+
}
29+
30+
_loadResourcesAsync=async()=>{
31+
returnPromise.all([
32+
Asset.loadAsync([
33+
require('./assets/images/robot-dev.png'),
34+
require('./assets/images/robot-prod.png'),
35+
]),
36+
Font.loadAsync({
37+
// This is the font that we are using for our tab bar
38+
...Icon.Ionicons.font,
39+
// We include SpaceMono because we use it in HomeScreen.js. Feel free
40+
// to remove this if you are not using it in your app
41+
'space-mono':require('./assets/fonts/SpaceMono-Regular.ttf'),
42+
}),
43+
]);
44+
};
45+
46+
_handleLoadingError=error=>{
47+
// In this case, you might want to report the error to your error
48+
// reporting service, for example Sentry
49+
console.warn(error);
50+
};
51+
52+
_handleFinishLoading=()=>{
53+
this.setState({isLoadingComplete:true});
54+
};
55+
}
56+
57+
conststyles=StyleSheet.create({
58+
container:{
59+
flex:1,
60+
backgroundColor:'#fff',
61+
},
62+
});

‎__tests__/App-test.js‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import'react-native';
2+
importReactfrom'react';
3+
importAppfrom'../App';
4+
importrendererfrom'react-test-renderer';
5+
importNavigationTestUtilsfrom'react-navigation/NavigationTestUtils';
6+
7+
describe('App snapshot',()=>{
8+
jest.useFakeTimers();
9+
beforeEach(()=>{
10+
NavigationTestUtils.resetInternalState();
11+
});
12+
13+
it('renders the loading screen',async()=>{
14+
consttree=renderer.create(<App/>).toJSON();
15+
expect(tree).toMatchSnapshot();
16+
});
17+
18+
it('renders the root without loading screen',async()=>{
19+
consttree=renderer.create(<AppskipLoadingScreen/>).toJSON();
20+
expect(tree).toMatchSnapshot();
21+
});
22+
});

‎app.json‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"expo": {
3+
"name":"coderplanets",
4+
"slug":"coderplanets_mobile",
5+
"privacy":"public",
6+
"sdkVersion":"33.0.0",
7+
"platforms": [
8+
"ios",
9+
"android"
10+
],
11+
"version":"1.0.0",
12+
"orientation":"portrait",
13+
"icon":"./assets/images/icon.png",
14+
"splash": {
15+
"image":"./assets/images/splash.png",
16+
"resizeMode":"contain",
17+
"backgroundColor":"#ffffff"
18+
},
19+
"updates": {
20+
"fallbackToCacheTimeout":0
21+
},
22+
"assetBundlePatterns": [
23+
"**/*"
24+
],
25+
"ios": {
26+
"supportsTablet":true
27+
}
28+
}
29+
}

‎assets/fonts/SpaceMono-Regular.ttf‎

91.1 KB
Binary file not shown.

‎assets/images/icon.png‎

2.91 KB
Loading

‎assets/images/robot-dev.png‎

12.6 KB
Loading

‎assets/images/robot-prod.png‎

11.8 KB
Loading

‎assets/images/splash.png‎

7.01 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp