Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
16 kB
2
Indexable
Never
import React, { useEffect } from 'react';

import {
  createStackNavigator,
  createBottomTabNavigator, createSwitchNavigator ,createNavigationContainer
} from "react-navigation";

import HomeScreen from "../components/src/HomeScreen";
import Splashscreen from "../blocks/splashscreen/src/Splashscreen";
import OrderManagement from "../blocks/ordermanagement/src/OrderManagement";
import Notificationsettings from "../blocks/notificationsettings/src/Notificationsettings";
import NavigationMenu from "../blocks/navigationmenu/src/NavigationMenu";
import PhoneNumberInput from "../blocks/mobile-account-registration/src/PhoneNumberInput";
import AdditionalDetailForm from "../blocks/mobile-account-registration/src/AdditionalDetailForm";
import AdvancedSearch from "../blocks/advancedsearch/src/AdvancedSearch";
import HelpCentre1 from "../blocks/helpcentre/src/HelpCentre1";
import RuleBook from "../blocks/helpcentre/src/RuleBook"
import HelpCentreQA from "../blocks/helpcentre/src/HelpCentreQA";
import HelpCentreSub from "../blocks/helpcentre/src/HelpCentreSub";
import OTPInputAuth from "../blocks/otp-input-confirmation/src/OTPInputAuth";
import ContentFlag from "../blocks/contentflag/src/ContentFlag";
import Adminconsole2 from "../blocks/adminconsole2/src/Adminconsole2";
import Notifications from "../blocks/notifications/src/Notifications";
import Location from "../blocks/location/src/Location";
import UserStatus from "../blocks/userstatus/src/UserStatus";
import CountryCodeSelector from "../blocks/country-code-selector/src/CountryCodeSelector";
import CountryCodeSelectorTable from "../blocks/country-code-selector/src/CountryCodeSelectorTable";
import Catalogue from "../blocks/catalogue/src/Catalogue";
import Rolesandpermissions2 from "../blocks/rolesandpermissions2/src/Rolesandpermissions2";
import Pushnotifications from "../blocks/pushnotifications/src/Pushnotifications";
import Contactus from "../blocks/contactus/src/Contactus";
import Contactus1 from "../blocks/contactus/src/Contactus1";
import AddContactus from "../blocks/contactus/src/AddContactus";
import Emojis from "../blocks/emojis/src/Emojis";
import Settings2 from "../blocks/settings2/src/Settings2";
import Favourites from "../blocks/favourites/src/Favourites";
import AddFavourites from "../blocks/favourites/src/AddFavourites";
import Blockedusers from "../blocks/blockedusers/src/Blockedusers";
import AddBlockeduser from "../blocks/blockedusers/src/AddBlockeduser";
import PostCreation from "../blocks/postcreation/src/PostCreation";
import Posts from "../blocks/postcreation/src/Posts";
import PostDetails from "../blocks/postcreation/src/PostDetails";
import SocialMediaAccountLoginScreen from "../blocks/social-media-account-login/src/SocialMediaAccountLoginScreen";
import SocialMediaAccountRegistrationScreen from "../blocks/social-media-account-registration/src/SocialMediaAccountRegistrationScreen";
import EmailAccountLoginBlock from "../blocks/email-account-login/src/EmailAccountLoginBlock";
import ForgotPassword from "../blocks/forgot-password/src/ForgotPassword";
import ForgotPasswordOTP from "../blocks/forgot-password/src/ForgotPasswordOTP";
import NewPassword from "../blocks/forgot-password/src/NewPassword";
import Chat from "../blocks/chat/src/Chat";
import ViewChat from "../blocks/chat/src/ViewChat";
import Cfswipefeature2 from "../blocks/cfswipefeature2/src/Cfswipefeature2";
import ReportUser from '../blocks/cfswipefeature2/src/ReportUser';
import ImportExportData from "../blocks/importexportdata/src/ImportExportData";
import TermsConditions from "../blocks/termsconditions/src/TermsConditions";
import TermsConditions1 from "../blocks/termsconditions/src/TermsConditions1";
import PrivacyPolicy from "../blocks/termsconditions/src/PrivacyPolicy";
import TermsConditionsDetail from "../blocks/termsconditions/src/TermsConditionsDetail";
import TermsConditionsUsers from "../blocks/termsconditions/src/TermsConditionsUsers";
import BulkUploading from "../blocks/bulkuploading/src/BulkUploading";
import MobileAccountLoginBlock from "../blocks/mobile-account-login/src/MobileAccountLoginBlock";
import EmailAccountRegistration from "../blocks/email-account-registration/src/EmailAccountRegistration";
import Analytics from "../blocks/analytics/src/Analytics";
import Cfallinbutton from "../blocks/cfallinbutton/src/Cfallinbutton";
import Categoriessubcategories from "../blocks/categoriessubcategories/src/Categoriessubcategories";
import CustomisableUserProfiles from '../blocks/customisableuserprofiles/src/CustomisableUserProfiles';
import EditProfile from '../blocks/settings2/src/EditProfile';
import Cfonboardingguide from "../blocks/cfonboardingguide/src/Cfonboardingguide"
import Premium from "../blocks/inapppurchasing/src/Premium"
import PartnerPreferences from "../blocks/settings2/src/PatnerPreferences"
import About from "../blocks/settings2/src/About"
import Hobbies from "../blocks/settings2/src/Hobbies"
import WorkAndEducation from "../blocks/settings2/src/WorkAndEducation";
import Basics from "../blocks/settings2/src/Basics";
import  Faq  from '../blocks/helpcentre/src/Faq';
import NotificationSettings from "../blocks/settings2/src/NotificationSettings";

import { Image, Platform, Text } from 'react-native';
import RNSC from "react-native-splash-screen";

const DiscoverStack = createStackNavigator({
  Home: { screen: Cfswipefeature2, navigationOptions: { header: null, title: "Home" } },
});

const ChatStack = createStackNavigator({
  Chat: { screen: Chat, navigationOptions: { title: "Chat" } },
  
});

const HelpCenterStack = createStackNavigator({
  HelpCentre1: { screen: HelpCentre1, navigationOptions: { title: "HelpCentre1",header:null, } },
});

const ProfileStack = createStackNavigator({
  InfoPage: { screen: CustomisableUserProfiles, navigationOptions: { header: null, title: "Info" } },
  Settings2: { screen: Settings2, navigationOptions: { header: null, title: "Settings2" } },
  EditProfile: { screen: EditProfile, navigationOptions: { title: "EditProfile", header: null, } },
  About: { screen: About, navigationOptions: { title: "About", header: null } },

  Basics: { screen: Basics, navigationOptions: { title: "Basics", header: null } },

  Hobbies: { screen: Hobbies, navigationOptions: { title: "Hobbies", header: null } },

  WorkAndEducation: { screen: WorkAndEducation, navigationOptions: { title: "Work And Education", header: null } },

  PartnerPreferences: { screen: PartnerPreferences, navigationOptions: { title: "PartnerPreferences", header: null } },

  Premium: { screen: Premium, navigationOptions: { title: "Premium", header: null } },

  NotificationSettings: { screen: NotificationSettings, navigationOptions: { title: "Notification settings", header: null } },
});

const DashboardBottomTabs = createBottomTabNavigator(
  {
    Discover: DiscoverStack,
    Chat: ChatStack,
    HelpCenter: HelpCenterStack,
    Profile: ProfileStack,
  },
  {
    navigationOptions: ({ navigation }:{navigation: {state:{routeName: string}}}) => ({
      tabBarIcon: ({ focused }:{focused: boolean}) => {
        const { routeName } = navigation.state;
        let iconName;

        if (routeName === 'Discover') {
          iconName = focused ? require('./assets/icon/discover.png') : require('./assets/icon/discover.png');
        } else if (routeName === 'Chat') {
          iconName = focused ? require('./assets/icon/chat.png') : require('./assets/icon/chat.png');
        } else if (routeName === 'HelpCenter') {
          iconName = focused ? require('./assets/icon/help.png') : require('./assets/icon/help.png');
        } else if (routeName === 'Profile') {
          iconName = focused ? require('./assets/icon/profile.png') : require('./assets/icon/profile.png');
        }

        return <Image source={iconName} style={{ width: 30, height: 30, tintColor: focused ? '#FF7CF2' : '#94a3b8' }} />;
      },
    }),
    initialRouteName: 'Discover',
    tabBarPosition: 'bottom',
    tabBarOptions: {
      activeTintColor: '#FF7CF2',
      inactiveTintColor: '#94a3b8', 
      style:{
        paddingVertical:12,
        borderColor: "#fff",
        borderWidth:0,
        height: 67,
      }     
    },
    animationEnabled: false,
    swipeEnabled: false,

  }

);

const AuthStack = createStackNavigator({
  Splashscreen: 
  { screen: Splashscreen, navigationOptions: { header: null, title: "Splashscreen" } },
  EmailAccountLoginBlock:
   { screen: EmailAccountLoginBlock, navigationOptions: { header: null, title: "EmailAccountLoginBlock" } },
   EmailAccountRegistration:
  { screen: EmailAccountRegistration, navigationOptions: { header: null, title: "EmailAccountRegistration" } },
});


const HomeStack = createStackNavigator({
  BottomNavigation: { screen: DashboardBottomTabs, navigationOptions: { header: null, title: "DashboardBottomTabs" } },
  // FAQ:{screen:Faq,navigationOption:{header:null,title:"FAQ"}},
  OrderManagement: { screen: OrderManagement, navigationOptions: { title: "OrderManagement" } },
  Notificationsettings: { screen: Notificationsettings, navigationOptions: { title: "Notificationsettings" } },
  NavigationMenu: { screen: NavigationMenu, navigationOptions: { title: "NavigationMenu" } },
  PhoneNumberInput: { screen: PhoneNumberInput, navigationOptions: { title: "PhoneNumberInput" } },
  AdditionalDetailForm: { screen: AdditionalDetailForm, navigationOptions: { title: "AdditionalDetailForm" } },
  AdvancedSearch: { screen: AdvancedSearch, navigationOptions: { title: "AdvancedSearch" } },
  HelpCentreQA: { screen: HelpCentreQA, navigationOptions: { title: "HelpCentreQA" } },
  HelpCentreSub: { screen: HelpCentreSub, navigationOptions: { title: "HelpCentreSub" } },
  OTPInputAuth: { screen: OTPInputAuth, navigationOptions: { header: null, title: "OTPInputAuth" } },
  ContentFlag: { screen: ContentFlag, navigationOptions: { title: "ContentFlag" } },
  Adminconsole2: { screen: Adminconsole2, navigationOptions: { title: "Adminconsole2" } },
  Notifications: { screen: Notifications, navigationOptions: { title: "Notifications" } },
  Location: { screen: Location, navigationOptions: { title: "Location" } },
  UserStatus: { screen: UserStatus, navigationOptions: { title: "UserStatus" } },
  CountryCodeSelector: { screen: CountryCodeSelector, navigationOptions: { title: "CountryCodeSelector" } },
  CountryCodeSelectorTable: { screen: CountryCodeSelectorTable, navigationOptions: { title: "CountryCodeSelectorTable" } },
  Catalogue: { screen: Catalogue, navigationOptions: { title: "Catalogue" } },
  Rolesandpermissions2: { screen: Rolesandpermissions2, navigationOptions: { title: "Rolesandpermissions2" } },
  Pushnotifications: { screen: Pushnotifications, navigationOptions: { title: "Pushnotifications" } },
  Contactus: { screen: Contactus, navigationOptions: { title: "Contact Us",header:null } },
  Contactus1: { screen: Contactus1, navigationOptions: { title: "Contact Us1",header:null } },
  AddContactus: { screen: AddContactus, navigationOptions: { title: "AddContactus" } },
  Emojis: { screen: Emojis, navigationOptions: { title: "Emojis" } },
  Settings2: { screen: Settings2, navigationOptions: {header:null, title: "Settings2" } },
  Favourites: { screen: Favourites, navigationOptions: { title: "Favourites" } },
  AddFavourites: { screen: AddFavourites, navigationOptions: { title: "AddFavourites" } },
  Blockedusers: { screen: Blockedusers, navigationOptions: { title: "Blockedusers" } },
  AddBlockeduser: { screen: AddBlockeduser, navigationOptions: { title: "AddBlockeduser" } },
  PostCreation: { screen: PostCreation, navigationOptions: { title: "PostCreation" } },
  Posts: { screen: Posts, navigationOptions: { title: "Posts" } },
  PostDetails: { screen: PostDetails, navigationOptions: { title: "PostDetails" } },
  SocialMediaAccountLoginScreen: { screen: SocialMediaAccountLoginScreen, navigationOptions: { title: "SocialMediaAccountLoginScreen" } },
  SocialMediaAccountRegistrationScreen: { screen: SocialMediaAccountRegistrationScreen, navigationOptions: { title: "SocialMediaAccountRegistrationScreen" } },
  EmailAccountLoginBlock: { screen: EmailAccountLoginBlock, navigationOptions: { header: null, title: "EmailAccountLoginBlock" } },
  ForgotPassword: { screen: ForgotPassword, navigationOptions: { header: null, title: "ForgotPassword" } },
  ForgotPasswordOTP: { screen: ForgotPasswordOTP, navigationOptions: { title: "ForgotPasswordOTP" } },
  NewPassword: { screen: NewPassword, navigationOptions: { header: null, title: "NewPassword" } },
  ViewChat: { screen: ViewChat, navigationOptions: { title: "ViewChat" } },
  Cfswipefeature2: { screen: Cfswipefeature2, navigationOptions: { title: "Cfswipefeature2" } },
  ImportExportData: { screen: ImportExportData, navigationOptions: { title: "ImportExportData" } },
  TermsConditions: { screen: TermsConditions, navigationOptions: { title: "Terms and Conditions", } },
  TermsConditions1: { screen: TermsConditions1, navigationOptions: { title: "Terms and Conditions",header: null } },
  PrivacyPolicy: { screen: PrivacyPolicy, navigationOptions: { title: "Privacy Policy",header: null } },
  TermsConditionsDetail: { screen: TermsConditionsDetail, navigationOptions: { title: "TermsConditionsDetail" } },
  TermsConditionsUsers: { screen: TermsConditionsUsers, navigationOptions: { title: "TermsConditionsUsers" } },
  BulkUploading: { screen: BulkUploading, navigationOptions: { title: "BulkUploading" } },
  MobileAccountLoginBlock: { screen: MobileAccountLoginBlock, navigationOptions: { title: "MobileAccountLoginBlock" } },
  Analytics: { screen: Analytics, navigationOptions: { title: "Analytics" } },
  Cfallinbutton: { screen: Cfallinbutton, navigationOptions: { title: "Cfallinbutton" } },
  CustomisableUserProfiles: { screen: CustomisableUserProfiles, navigationOptions: { title: "CustomisableUserProfiles", header: null,  } },
  Categoriessubcategories: { screen: Categoriessubcategories, navigationOptions: { title: "Categoriessubcategories" } },
  Cfonboardingguide: {screen: Cfonboardingguide, navigationOptions: { title: "Cfonboardingguide", header: null, }},
  EditProfile: {screen: EditProfile, navigationOptions: { title: "EditProfile", header: null, }},
  Premium: {screen: Premium, navigationOptions: { title: "Premium", header: null}},
  PartnerPreferences: {screen: PartnerPreferences, navigationOptions: { title: "PartnerPreferences", header: null}},
  About: {screen: About, navigationOptions: { title: "About", header: null}},
  Hobbies: {screen: Hobbies, navigationOptions: { title: "Hobbies", header: null}},
  WorkAndEducation: {screen: WorkAndEducation, navigationOptions: { title: "Work And Education", header: null}},
  Report: {screen: ReportUser, navigationOptions: { title: "ReportUser", header: null}},
  Basics: {screen: Basics, navigationOptions: { title: "Basics", header: null}},
  NotificationSettings: {screen: NotificationSettings, navigationOptions: { title: "Notification settings", header: null}},
  HelpCentre1: { screen: HelpCentre1, navigationOptions: { title: "HelpCentre1",header:null, } },
  FAQ:{screen:Faq,navigationOptions:{title:"FAQ",header:null,}},
  // TermsConditions: { screen: TermsConditions, navigationOptions: { title: "TermsConditions" } },
  RuleBook: {
    screen: RuleBook,
    navigationOptions:{title:"RuleBook",header:null,}
  }
});

if (!HomeScreen.instance) {
  const defaultProps = {
    navigation: null,
    id: "HomeScreen"
  };
  const homeScreen = new HomeScreen(defaultProps);
}
const AppContainer = createNavigationContainer(
  createSwitchNavigator(
    {
      Auth: AuthStack,
      Main: DashboardBottomTabs,
      Home:HomeStack
    },
    {
      initialRouteName: 'Auth'
    }
  )
);
export function App() {
  useEffect(()=>{
    if(Platform.OS === 'ios'){
      RNSC.hide()
    }
  })
  return (
    <AppContainer />
  );
};
Leave a Comment