Skip to content

Commit

Permalink
Merge pull request #106 from KhalisFoundation/dev
Browse files Browse the repository at this point in the history
Even with Dev
  • Loading branch information
amitojsingh authored Sep 28, 2022
2 parents 96732b4 + ed45504 commit b409c10
Show file tree
Hide file tree
Showing 719 changed files with 45,272 additions and 122,736 deletions.
29 changes: 29 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"extends": [
"airbnb",
"prettier",
"plugin:prettier/recommended",
"eslint-config-prettier"
],
"parser": "babel-eslint",
"rules": {
"import/no-unresolved": "off",
"global-require": 0,
"react/jsx-no-bind": 0,
"prefer-destructuring": ["error", { "object": true, "array": false }],
"react/jsx-filename-extension": [
1,
{
"extensions": [".js", ".jsx"]
}
],
"prettier/prettier": [
"error",
{
"trailingComma": "es5",
"printWidth": 100
}
]
},
"plugins": ["prettier"]
}
76 changes: 40 additions & 36 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,70 @@
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Ignore polyfills
.*/Libraries/polyfills/.*
; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

; Ignore metro
.*/node_modules/metro/.*
[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/interface.js
node_modules/react-native/flow/
node_modules/react-native/flow-github/

[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

munge_underscores=true

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\)$' -> 'RelativeImageStub'

module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
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'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.86.0
^0.113.0
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IntelliJ
#
Expand All @@ -29,6 +28,7 @@ build/
.gradle
local.properties
*.iml
*.hprof

# node.js
#
Expand All @@ -40,6 +40,7 @@ yarn-error.log
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
Expand All @@ -54,3 +55,6 @@ buck-out/

# Bundle artifact
*.jsbundle

# CocoaPods
/ios/Pods/
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"git.ignoreLimitWarning": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"prettier.semi": true,
"javascript.format.semicolons": "insert",
"prettier.printWidth": 100,
}
1 change: 0 additions & 1 deletion .watchmanconfig

This file was deleted.

90 changes: 46 additions & 44 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from "react";
import { BackHandler, Alert } from "react-native";
import SafeAreaView from 'react-native-safe-area-view';

import { createStackNavigator, createAppContainer } from "react-navigation";
import { BackHandler, Alert, AppRegistry, AppState } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";
import * as React from "react";
import HomeScreen from "./screens/Home";
import FolderBaniScreen from "./screens/FolderBani";
import SettingsScreen from "./screens/Settings";
Expand All @@ -14,45 +13,24 @@ import AboutScreen from "./screens/About";
import ReaderScreen from "./screens/Reader";
import BookmarksScreen from "./screens/Bookmarks";
import createStore from "./config/store";
import FirebaseNotification from "./utils/firebaseNotification";
import NotificationsManager from "./utils/notifications";

const RootStack = createStackNavigator(
{
Home: {
screen: HomeScreen
},
FolderBani: {
screen: FolderBaniScreen
},
Settings: {
screen: SettingsScreen
},
Reader: {
screen: ReaderScreen
},
Bookmarks: {
screen: BookmarksScreen
},
EditBaniOrder: {
screen: EditBaniOrderScreen
},
ReminderOptions: {
screen: ReminderOptionsScreen
},
About: {
screen: AboutScreen
}
},
{
headerMode: "none"
}
);
const AppContainer = createAppContainer(RootStack);
const Stack = createNativeStackNavigator();

const { store, persistor } = createStore();

export default class App extends React.Component {
componentDidMount() {
this.notificationHandler();
BackHandler.addEventListener("hardwareBackPress", this.handleBackPress);
// AppStateIOS.addEventListener("change", (state) => console.log("AppStateIOS changed to", state));
AppState.addEventListener("change", (state) => {
if (state === "active") {
const notification = new NotificationsManager();
notification.resetBadgeCount();
}
});
}

componentWillUnmount() {
Expand All @@ -63,24 +41,48 @@ export default class App extends React.Component {
Alert.alert(
"Exit Sundar Gutka",
"Are you sure you want to exit?",
[
{ text: "Cancel" },
{ text: "Exit", onPress: () => BackHandler.exitApp() }
],
[{ text: "Cancel" }, { text: "Exit", onPress: () => BackHandler.exitApp() }],
{ cancelable: true }
);
return true;
};

notificationHandler = () => {
const firebaseNotifaction = new FirebaseNotification();
firebaseNotifaction.checkPermission();
firebaseNotifaction.backgroundMessageHandler();
firebaseNotifaction.foregroundMessage();
firebaseNotifaction.handleNotification();
const notification = new NotificationsManager();
notification.listenReminders();
// notification.listenReminders();
};

render() {
const notification = new NotificationsManager();
notification.resetBadgeCount();
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<SafeAreaView style={{ flex: 1 }} forceInset={{ vertical: 'never' }}>
<AppContainer />
</SafeAreaView>
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerShown: false,
}}
>
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="FolderBani" component={FolderBaniScreen} />
<Stack.Screen name="Settings" component={SettingsScreen} />
<Stack.Screen name="Reader" component={ReaderScreen} />
<Stack.Screen name="Bookmarks" component={BookmarksScreen} />
<Stack.Screen name="EditBaniOrder" component={EditBaniOrderScreen} />
<Stack.Screen name="ReminderOptions" component={ReminderOptionsScreen} />
<Stack.Screen name="About" component={AboutScreen} />
</Stack.Navigator>
</NavigationContainer>
</PersistGate>
</Provider>
);
}
}
AppRegistry.registerHeadlessTask("RNFirebaseMessagingService", () => this.notificationHandler);
Loading

0 comments on commit b409c10

Please sign in to comment.