/** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow strict-local */ import React, { useEffect } from 'react'; import messaging from '@react-native-firebase/messaging'; import { colors } from './src/assets/styles/colors-theme'; import { StyleSheet, ScrollView, View, Text, StatusBar, TouchableOpacity, } from 'react-native'; import SafeAreaView from 'react-native-safe-area-view'; import { Provider } from 'mobx-react'; import Store from './src/stores/index'; import { NavigationContainer, useFocusEffect } from '@react-navigation/native'; import { createStackNavigator, HeaderBackButton } from '@react-navigation/stack'; import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { Header, LearnMoreLinks, Colors, DebugInstructions, ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; import Icon from 'react-native-vector-icons/dist/MaterialCommunityIcons'; import SplashScreen from './src/pages/splash/splashScreen'; import Main from './src/pages/main/main'; import Search from './src/pages/search/search'; import Favorite from './src/pages/favorite/favorite'; import MyTabBar from './MyTabBar'; import Order from './src/pages/order/order'; import Profile from './src/pages/profile/profile'; import Setting from './src/pages/profile/Setting'; import AddName from './src/pages/profile/addName'; import CreditCard from './src/pages/profile/creditCard'; import AddressSetting from './src/pages/profile/addressSetting'; import BuyHistory from './src/pages/buyHistory/buyHistory'; import HistoryDetails from './src/pages/buyHistory/historyDetails'; import ProductsDetails from './src/pages/productsDetails/productsDetails'; import ShoppingCart from './src/pages/shoppingCart/shoppingCart'; import Signin from './src/pages/signin/signin'; import Signup from './src/pages/signup/signup'; import News from './src/pages/news/news'; import SignUpVerify from './src/pages/signup/signUpVerify'; import ForgotPassword from './src/pages/signup/forgotPassword'; import GroupDetails from './src/pages/group/groupDetails'; import RedeemGifts from './src/pages/group/redeemGifts'; import ManageMembers from './src/pages/group/manageMembers'; import SalesRecord from './src/pages/group/salesRecord'; import GroupList from './src/pages/group/groupList'; import RedeemRecord from './src/pages/profile/redeemRecord' import FullScreen from './src/pages/fullScreen/fullScreen' import Notification from './src/pages/notificaation/notification' import Tutorial from './src/pages/tutorial/tutorial' Icon.loadFont(); const Stack = createStackNavigator(); const BottomTab = createBottomTabNavigator(); import { inject, observer } from 'mobx-react'; @inject('appStore') @observer class Router extends React.Component { constructor(props) { super(props); this.store = props.appStore; // this.handleFrontNotification = this.handleFrontNotification.bind(this); } handleFrontNotification() { const unsubscribe = messaging().onMessage(async remoteMessage => { console.log('A new FCM message arrived!', JSON.stringify(remoteMessage)); }); } async componentDidMount() { this.messageListener = messaging().onMessage(async message => this.store.saveNotification(message)) } componentWillUnmount() { this.messageListener(); } BottomTabScreen = () => { return ( }> ); }; render() { return ( {!this.store.splash ? ( <> ) : ( <> )} ); } } const styles = StyleSheet.create({ scrollView: { backgroundColor: Colors.lighter, }, engine: { position: 'absolute', right: 0, }, body: { backgroundColor: Colors.white, }, sectionContainer: { marginTop: 32, paddingHorizontal: 24, }, sectionTitle: { fontSize: 24, fontWeight: '600', color: Colors.black, }, sectionDescription: { marginTop: 8, fontSize: 18, fontWeight: '400', color: Colors.dark, }, highlight: { fontWeight: '700', }, footer: { color: Colors.dark, fontSize: 12, fontWeight: '600', padding: 4, paddingRight: 12, textAlign: 'right', }, }); export default Router;