Files
notesnook/apps/mobile/native/index.js
Ammar Ahmed 89c2d45a4b mobile: reduce app size (#3068)
* mobile: reduce app size

* editor: substitute all @mdi/js icons at build time

* mobile: add script to tree shake icon font file

* mobile: fix icon loading

* mobile: remove html-entities dep

* mobile: add missing icon fonts

* mobile: include plain editor

* mobile: add missing fonts

* mobile: use webpack-bundle

* mobile: keep generated fonts in repo

* mobile: update fonts

* mobile: fix duplicate key warning

* mobile: update fonts

* mobile: disable gesure on reminder sheet

* mobile: update fonts

* mobile: reset session correctly on logout

* mobile: update icon fonts

* mobile: set button action on reminder sheet

* mobile: add missing icons

* mobile: fix crash

* mobile: fix right menus

* mobile: remove console.log

* mobile: disable bounce effect

* mobile: update deps

---------

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
2023-08-02 15:35:15 +05:00

68 lines
1.7 KiB
JavaScript

/* eslint-disable @typescript-eslint/no-var-requires */
import './globals.js';
import 'react-native-get-random-values';
import React from 'react';
import { AppRegistry, LogBox, Platform, UIManager } from 'react-native';
import Config from 'react-native-config';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import appJson from './app.json';
import Notifications from "../app/services/notifications";
import NetInfo from "@react-native-community/netinfo";
NetInfo.configure({
reachabilityUrl: "https://notesnook.com",
reachabilityTest: (response) => {
if (!response) return false;
return response?.status >= 200 && response?.status < 300;
}
});
Notifications.init();
const appName = appJson.name;
if (Config.isTesting) {
Date.prototype.toLocaleString = () => 'XX-XX-XX';
}
UIManager.setLayoutAnimationEnabledExperimental &&
UIManager.setLayoutAnimationEnabledExperimental(true);
if (__DEV__) {
console.warn = () => null;
LogBox.ignoreAllLogs();
}
let NotesnookShare;
let QuickNoteIOS;
const AppProvider = () => {
const App = require('../app/app.js').default;
return <App />;
};
AppRegistry.registerComponent(appName, () => AppProvider);
const ShareProvider = () => {
NotesnookShare = require('../share/index').default;
return Platform.OS === 'ios' ? (
<SafeAreaProvider>
<NotesnookShare quicknote={false} />
</SafeAreaProvider>
) : (
<NotesnookShare quicknote={false} />
);
};
AppRegistry.registerComponent('NotesnookShare', () => ShareProvider);
const QuickNoteProvider = () => {
QuickNoteIOS = require('../share/quick-note').default;
return (
<SafeAreaProvider>
<QuickNoteIOS />
</SafeAreaProvider>
);
};
AppRegistry.registerComponent('QuickNoteIOS', () => QuickNoteProvider);