
import { Navigation, ScreenVisibilityListener } from 'react-native-navigation';
import History from './history-request/History';
import ListOptions from './drawer/ListOptions';
import OptionsMenu from './optionMenu/OptionsMenu';
import Requester from './history-request/Requester';
import HistoryRequester from './history-request/HistoryRequester';
import UserAccount from './account/UserAccount'
import SplashScreen from './splashscreen/SplashScreen';
import Main from './login/LoginMain';
import Connect from './login/Connect';
import App from './home/Home';
import Notifications from './notifications/Notifications'
import Configurations from './configurations/Configurations'
import TypeChoiser from './login/TypeChoiser'
import CreateAccount from './login/createAccount'
import HistoryItemDetails from './history-request/HistoryItemDetails'
import DateFilterHistoryDemand from './modals/DateFilterHistoryDemand'
import SuperViseurGroupeHome from './groupes/SuperViseurGroupeHome'
import ConfirmCode from './login/confirmCode'
import ForgottenPassword from './login/ForgottenPassword'
import Help from './help/Help'
import CreateUserStep2 from './login/createUserStep2'
import LoadinModal from './modals/LoadinModal'
import ActivateAccount from "./login/ActivateAccount";
import NotificationBuilder from "./notifications/NotificationBuilder";
import AddNetwork from "./account/AddNetwork";
import GenerateNetworkForGeo from "./account/GenerateNetworkForGeo";
import HelpMenu from "./help/HelpMenu";
import UpdateInformations from "./account/UpdateInformations";
import InterticielAds from "./ads/InterticielAds";
import IntersticielAds from "./ads/IntersticielAds";
import WalletDetail from './wallet/WalletDetail';
import walletDepot from './wallet/WalletDepot';
import WalletRetrait from './wallet/WalletRetrait';
import WalletSelect from './wallet/WalletSelect';
import CreateIdentification from './identification/createIdentification';
import DemandGroupNanoCredit from './nano-credit/DemandGroupNanoCredit';
import MyHistory from './history-request/MyHistory';
let route = require('./../route.json')
export function registerScreens() {

     Navigation.registerComponent(route.discover, () => Connect);
     Navigation.registerComponent(route.first, () => App);
     Navigation.registerComponent(route.splashscreen, () => SplashScreen);
     Navigation.registerComponent(route.drawer, () => ListOptions);
     Navigation.registerComponent(route.historiques, () => History);
     Navigation.registerComponent(route.options, () => OptionsMenu);
     Navigation.registerComponent(route.login, () => Connect);
     Navigation.registerComponent(route.credrequester, () => HistoryRequester);
     Navigation.registerComponent(route.useraccount, () => UserAccount);
     Navigation.registerComponent(route.notification, () => Notifications);
     Navigation.registerComponent(route.configurations, () => Configurations);
     Navigation.registerComponent(route.typeaccountcreate, () => TypeChoiser);
     Navigation.registerComponent(route.simpleusercreate, () => CreateAccount);
     Navigation.registerComponent(route.createIdentification, () => CreateIdentification);
     Navigation.registerComponent(route.historyItemDetails, () => HistoryItemDetails);
     Navigation.registerComponent(route.modalhistoryfilter, () => DateFilterHistoryDemand);
     Navigation.registerComponent(route.superviseurgroup, () => SuperViseurGroupeHome);
     Navigation.registerComponent(route.forgotpass, () => ForgottenPassword);
     Navigation.registerComponent(route.confirmcode, () => ConfirmCode);
     Navigation.registerComponent(route.help, () => Help);
     Navigation.registerComponent(route.modaloading, () => LoadinModal)
     Navigation.registerComponent(route.activateaccount, () => ActivateAccount)
     Navigation.registerComponent(route.notificationView, () => NotificationBuilder)
     Navigation.registerComponent(route.creationstep2, () => CreateUserStep2)
     Navigation.registerComponent(route.addNetwork, () => AddNetwork);
     Navigation.registerComponent(route.generateNetwork, () => GenerateNetworkForGeo);
     Navigation.registerComponent(route.helpmenu, () => HelpMenu);
     Navigation.registerComponent(route.updateinfo, () => UpdateInformations);
     Navigation.registerComponent(route.notification, () => Notifications);
     Navigation.registerComponent(route.demandGroupNanoCreditDetail, () => DemandGroupNanoCredit);
     /*      Navigation.registerComponent(route.walletDetail, () => WalletDetail);
          Navigation.registerComponent(route.walletDepot, () => walletDepot);
          Navigation.registerComponent(route.walletRetrait, () => WalletRetrait);
          Navigation.registerComponent(route.walletSelect, () => WalletSelect); */
}

export function registerScreenVisibilityListener() {
     new ScreenVisibilityListener({
          willAppear: ({ screen }) => console.log(`Displaying screen ${screen}`),
          didAppear: ({ screen, startTime, endTime, commandType }) => console.log('screenVisibility', `Screen ${screen} displayed in ${endTime - startTime} millis [${commandType}]`),
          willDisappear: ({ screen }) => console.log(`Screen will disappear ${screen}`),
          didDisappear: ({ screen }) => console.log(`Screen disappeared ${screen}`)
     }).register();
}