Skip to content

Commit f4c7198

Browse files
author
sarthakpranesh
committed
Shifted to react native cli
1 parent 84d3f35 commit f4c7198

File tree

91 files changed

+10887
-13127
lines changed

Some content is hidden

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

91 files changed

+10887
-13127
lines changed

.buckconfig

+6
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

.eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};

.expo-shared/assets.json

-3
This file was deleted.

.flowconfig

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore polyfills
9+
node_modules/react-native/Libraries/polyfills/.*
10+
11+
; These should not be required directly
12+
; require from fbjs/lib instead: require('fbjs/lib/warning')
13+
node_modules/warning/.*
14+
15+
; Flow doesn't support platforms
16+
.*/Libraries/Utilities/LoadingView.js
17+
18+
[untyped]
19+
.*/node_modules/@react-native-community/cli/.*/.*
20+
21+
[include]
22+
23+
[libs]
24+
node_modules/react-native/interface.js
25+
node_modules/react-native/flow/
26+
27+
[options]
28+
emoji=true
29+
30+
esproposal.optional_chaining=enable
31+
esproposal.nullish_coalescing=enable
32+
33+
module.file_ext=.js
34+
module.file_ext=.json
35+
module.file_ext=.ios.js
36+
37+
munge_underscores=true
38+
39+
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
40+
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
41+
42+
suppress_type=$FlowIssue
43+
suppress_type=$FlowFixMe
44+
suppress_type=$FlowFixMeProps
45+
suppress_type=$FlowFixMeState
46+
47+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
48+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
49+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
50+
51+
[lints]
52+
sketchy-null-number=warn
53+
sketchy-null-mixed=warn
54+
sketchy-number=warn
55+
untyped-type-import=warn
56+
nonstrict-import=warn
57+
deprecated-type=warn
58+
unsafe-getters-setters=warn
59+
inexact-spread=warn
60+
unnecessary-invariant=warn
61+
signature-verification-failure=warn
62+
deprecated-utility=error
63+
64+
[strict]
65+
deprecated-type
66+
nonstrict-import
67+
sketchy-null
68+
unclear-type
69+
unsafe-getters-setters
70+
untyped-import
71+
untyped-type-import
72+
73+
[version]
74+
^0.113.0

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

.gitignore

+59-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,59 @@
1-
node_modules
2-
yarn*
3-
.expo
4-
google-services.json
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+
24+
# Android/IntelliJ
25+
#
26+
build/
27+
.idea
28+
.gradle
29+
local.properties
30+
*.iml
31+
32+
# node.js
33+
#
34+
node_modules/
35+
npm-debug.log
36+
yarn-error.log
37+
38+
# BUCK
39+
buck-out/
40+
\.buckd/
41+
*.keystore
42+
!debug.keystore
43+
44+
# fastlane
45+
#
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47+
# screenshots whenever they are needed.
48+
# For more information about the recommended setup visit:
49+
# https://docs.fastlane.tools/best-practices/source-control/
50+
51+
*/fastlane/report.xml
52+
*/fastlane/Preview.html
53+
*/fastlane/screenshots
54+
55+
# Bundle artifact
56+
*.jsbundle
57+
58+
# CocoaPods
59+
/ios/Pods/

.prettierrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
bracketSpacing: false,
3+
jsxBracketSameLine: true,
4+
singleQuote: true,
5+
trailingComma: 'all',
6+
};

.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

App.js

+36-90
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,50 @@
1-
import React, { Component } from 'react';
2-
import { createSwitchNavigator, createAppContainer } from 'react-navigation';
3-
import { createStackNavigator } from 'react-navigation-stack';
4-
import { Asset } from 'expo-asset'; // for preloading assets
5-
import { AppLoading } from 'expo'; // till the time assets and other things are being loaded show the loading indicator
1+
import {createSwitchNavigator, createAppContainer} from 'react-navigation';
2+
import {createStackNavigator} from 'react-navigation-stack';
63

74
// importing Firebase
85
import * as firebase from './src/configs/firebase';
96

107
// importing local db
11-
import { getUserDataAsync } from './src/utils/localDb';
8+
// import {getUserDataAsync} from './src/utils/localDb';
129

1310
// importing Screens
1411
import LoginScreen from './src/screens/LoginScreen';
1512
import Main from './src/screens/Main';
1613
import ProfileScreen from './src/screens/ProfileScreen';
1714
import MainSettingsScreen from './src/screens/MainSettingsScreen';
1815

19-
import LoginScreenTemp from './src/screens/LoginScreenTemp';
20-
21-
function cacheImages(images) {
22-
return images.map(image => {
23-
if (typeof image === 'string') {
24-
return Image.prefetch(image);
25-
} else {
26-
return Asset.fromModule(image).downloadAsync();
27-
}
28-
});
29-
}
30-
31-
class UserStarting extends Component {
32-
constructor(props) {
33-
super(props);
34-
this.state={
35-
isReady: false,
36-
}
37-
}
38-
39-
isUserLoggedIn = async () => {
40-
41-
console.log(user);
42-
return user;
43-
}
44-
45-
async componentDidMount() {
46-
try {
47-
const user = await getUserDataAsync();
48-
if(user) {
49-
this.props.navigation.navigate("Main", { user })
50-
}
51-
} catch(err) {
52-
console.log(err);
53-
}
54-
}
55-
56-
async _loadAssetsAsync() {
57-
const imageAssets = cacheImages([
58-
require('./assets/bg.jpg'),
59-
]);
60-
await Promise.all([...imageAssets]);
61-
}
62-
63-
render() {
64-
if (!this.state.isReady) {
65-
return (
66-
<AppLoading
67-
startAsync={this._loadAssetsAsync}
68-
onFinish={() => this.setState({ isReady: true })}
69-
onError={console.warn}
70-
/>
71-
);
72-
}
73-
return (
74-
<LoginScreenTemp {...this.props} />
75-
);
76-
}
77-
}
78-
79-
const settingsStack = createStackNavigator({
80-
ProfileScreen,
81-
MainSettingsScreen,
82-
}, {
83-
initialRouteName: 'ProfileScreen',
84-
backBehavior: 'initialRoute',
85-
headerMode: 'none',
86-
})
87-
88-
const mainAppStack = createStackNavigator({
89-
Main,
90-
settingsStack,
91-
}, {
92-
initialRouteName: 'Main',
93-
backBehavior: 'initialRoute',
94-
headerMode: 'none',
95-
});
96-
97-
const defaultApp = createSwitchNavigator({
98-
UserStarting,
99-
mainAppStack,
100-
}, {
101-
initialRouteName: "UserStarting",
102-
})
16+
const settingsStack = createStackNavigator(
17+
{
18+
ProfileScreen,
19+
MainSettingsScreen,
20+
},
21+
{
22+
initialRouteName: 'ProfileScreen',
23+
backBehavior: 'initialRoute',
24+
headerMode: 'none',
25+
},
26+
);
27+
28+
const mainAppStack = createStackNavigator(
29+
{
30+
Main,
31+
settingsStack,
32+
},
33+
{
34+
initialRouteName: 'Main',
35+
backBehavior: 'initialRoute',
36+
headerMode: 'none',
37+
},
38+
);
39+
40+
const defaultApp = createSwitchNavigator(
41+
{
42+
LoginScreen,
43+
mainAppStack,
44+
},
45+
{
46+
initialRouteName: 'LoginScreen',
47+
},
48+
);
10349

10450
export default createAppContainer(defaultApp);

README.md

-2
This file was deleted.

__tests__/App.js __tests__/App-test.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @format
3+
*/
4+
15
import 'react-native';
26
import React from 'react';
37
import App from '../App';
-1 Bytes
Binary file not shown.
-23 Bytes
Binary file not shown.
-466 KB
Binary file not shown.
-29 Bytes
Binary file not shown.
Binary file not shown.

android/.gradle/4.10.1/gc.properties

Whitespace-only changes.
Binary file not shown.
Binary file not shown.
-19 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
-27 Bytes
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#Mon Jan 06 16:37:15 PST 2020
2-
gradle.version=4.10.1
1+
#Mon Apr 06 11:08:49 IST 2020
2+
gradle.version=6.0.1
Binary file not shown.

android/.gradle/vcsWorkingDirs/gc.properties

Whitespace-only changes.

android/app/BUCK

+6-16
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,13 @@
88
# - `buck install -r android/app` - compile, install and run application
99
#
1010

11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
1113
lib_deps = []
1214

13-
for jarfile in glob(['libs/*.jar']):
14-
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15-
lib_deps.append(':' + name)
16-
prebuilt_jar(
17-
name = name,
18-
binary_jar = jarfile,
19-
)
15+
create_aar_targets(glob(["libs/*.aar"]))
2016

21-
for aarfile in glob(['libs/*.aar']):
22-
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23-
lib_deps.append(':' + name)
24-
android_prebuilt_aar(
25-
name = name,
26-
aar = aarfile,
27-
)
17+
create_jar_targets(glob(["libs/*.jar"]))
2818

2919
android_library(
3020
name = "all-libs",
@@ -45,12 +35,12 @@ android_library(
4535

4636
android_build_config(
4737
name = "build_config",
48-
package = "com.loginscreen",
38+
package = "com.cosmos",
4939
)
5040

5141
android_resource(
5242
name = "res",
53-
package = "com.loginscreen",
43+
package = "com.cosmos",
5444
res = "src/main/res",
5545
)
5646

0 commit comments

Comments
 (0)