Skip to content

Commit 4d681a7

Browse files
committed
feat: initial commit
0 parents  commit 4d681a7

File tree

77 files changed

+14795
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+14795
-0
lines changed

.buckconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint'],
6+
overrides: [
7+
{
8+
files: ['*.ts', '*.tsx'],
9+
rules: {
10+
'@typescript-eslint/no-shadow': ['error'],
11+
'no-shadow': 'off',
12+
'no-undef': 'off',
13+
},
14+
},
15+
],
16+
};

.gitignore

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
ios/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
35+
# node.js
36+
#
37+
node_modules/
38+
npm-debug.log
39+
yarn-error.log
40+
41+
# BUCK
42+
buck-out/
43+
\.buckd/
44+
*.keystore
45+
!debug.keystore
46+
47+
# fastlane
48+
#
49+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
50+
# screenshots whenever they are needed.
51+
# For more information about the recommended setup visit:
52+
# https://docs.fastlane.tools/best-practices/source-control/
53+
54+
**/fastlane/report.xml
55+
**/fastlane/Preview.html
56+
**/fastlane/screenshots
57+
**/fastlane/test_output
58+
59+
# Bundle artifact
60+
*.jsbundle
61+
62+
# Ruby / CocoaPods
63+
/ios/Pods/
64+
/vendor/bundle/
65+
66+
.pnp.*
67+
.yarn/*
68+
!.yarn/patches
69+
!.yarn/plugins
70+
!.yarn/releases
71+
!.yarn/sdks
72+
!.yarn/versions

.node-version

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

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

.ruby-version

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

.watchmanconfig

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

.yarn/releases/yarn-3.3.1.cjs

Lines changed: 823 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-3.3.1.cjs

App.tsx

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/**
2+
* Sample React Native App
3+
* https://github.com/facebook/react-native
4+
*
5+
* Generated with the TypeScript template
6+
* https://github.com/react-native-community/react-native-template-typescript
7+
*
8+
* @format
9+
*/
10+
11+
import React, {useEffect, useState} from 'react';
12+
import {Modal, StyleSheet, Text, View} from 'react-native';
13+
import {NavigationContainer} from '@react-navigation/native';
14+
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
15+
import {createStackNavigator} from '@react-navigation/stack';
16+
import {GestureHandlerRootView} from 'react-native-gesture-handler';
17+
18+
const Tab = createBottomTabNavigator();
19+
const HomeStack = createStackNavigator();
20+
const CrashStack = createStackNavigator();
21+
22+
function HomeScreen() {
23+
return (
24+
<View style={styles.container}>
25+
<Text>Home screen</Text>
26+
</View>
27+
);
28+
}
29+
30+
function Home() {
31+
return (
32+
<HomeStack.Navigator>
33+
<HomeStack.Screen name="HomeScreen" component={HomeScreen} />
34+
</HomeStack.Navigator>
35+
);
36+
}
37+
38+
function CrashScreen() {
39+
const [showModal, setShowModal] = useState(true);
40+
41+
useEffect(() => {
42+
setTimeout(() => {
43+
setShowModal(false);
44+
}, 1000);
45+
}, []);
46+
47+
if (showModal) {
48+
return (
49+
<Modal>
50+
<View style={styles.container}>
51+
<Text>Loading</Text>
52+
</View>
53+
</Modal>
54+
);
55+
}
56+
57+
return (
58+
<View style={styles.container}>
59+
<Text>Crash screen</Text>
60+
</View>
61+
);
62+
}
63+
64+
function Crash() {
65+
return (
66+
<CrashStack.Navigator>
67+
<CrashStack.Screen name="CrashScreen" component={CrashScreen} />
68+
</CrashStack.Navigator>
69+
);
70+
}
71+
72+
function App() {
73+
return (
74+
<GestureHandlerRootView style={{flex: 1}}>
75+
<NavigationContainer>
76+
<Tab.Navigator>
77+
<Tab.Screen name="Home" component={Home} />
78+
<Tab.Screen name="Crash" component={Crash} />
79+
</Tab.Navigator>
80+
</NavigationContainer>
81+
</GestureHandlerRootView>
82+
);
83+
}
84+
85+
const styles = StyleSheet.create({
86+
container: {
87+
flex: 1,
88+
justifyContent: 'center',
89+
alignItems: 'center',
90+
},
91+
});
92+
93+
export default App;

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby '2.7.5'
5+
6+
gem 'cocoapods', '~> 1.11', '>= 1.11.2'

__tests__/App-test.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
6+
import React from 'react';
7+
import App from '../App';
8+
9+
// Note: test renderer must be required after react-native.
10+
import renderer from 'react-test-renderer';
11+
12+
it('renders correctly', () => {
13+
renderer.create(<App />);
14+
});

android/app/_BUCK

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# To learn about Buck see [Docs](https://buckbuild.com/).
2+
# To run your application with Buck:
3+
# - install Buck
4+
# - `npm start` - to start the packager
5+
# - `cd android`
6+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8+
# - `buck install -r android/app` - compile, install and run application
9+
#
10+
11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
13+
lib_deps = []
14+
15+
create_aar_targets(glob(["libs/*.aar"]))
16+
17+
create_jar_targets(glob(["libs/*.jar"]))
18+
19+
android_library(
20+
name = "all-libs",
21+
exported_deps = lib_deps,
22+
)
23+
24+
android_library(
25+
name = "app-code",
26+
srcs = glob([
27+
"src/main/java/**/*.java",
28+
]),
29+
deps = [
30+
":all-libs",
31+
":build_config",
32+
":res",
33+
],
34+
)
35+
36+
android_build_config(
37+
name = "build_config",
38+
package = "com.reactnativescreenscrash",
39+
)
40+
41+
android_resource(
42+
name = "res",
43+
package = "com.reactnativescreenscrash",
44+
res = "src/main/res",
45+
)
46+
47+
android_binary(
48+
name = "app",
49+
keystore = "//android/keystores:debug",
50+
manifest = "src/main/AndroidManifest.xml",
51+
package_type = "debug",
52+
deps = [
53+
":app-code",
54+
],
55+
)

0 commit comments

Comments
 (0)