Components

ProfileEmailInvitesScreen

<ProfileEmailInvitesScreen />

Constructor

# <ProfileEmailInvitesScreen />

You can use this component to display the Profile Email Invites Screen in your custom screen.

Properties:
Name Type Attributes Description
redirectScreen String <optional>

After sending an email invite, the current screen will redirect to ProfileScreen by default. Use this prop to change its redirect navigation.

Example

Display groups which the logged-in user is a member of

//In custom_code/components/MyCustomScreen.js...
import React from 'react';
import { Text, View, StyleSheet } from "react-native"
import EmailInviteTabsScreen from "@src/containers/Custom/Profile/EmailInviteTabsScreen";
import { backButtonProfile } from "@src/utils";

const MyCustomScreen = (props) => {

 if (!props.isFocused)
   return null;

 return (
   <>
     <EmailInviteTabsScreen
       //In the given example, a "book" route is registered using the addNavigationRoute() hook.
       //Therefore, you can use it to redirect back to the custom screen by choosing it as the redirectScreen's value
       redirectScreen="book"
       {...props}
     />
   </>
 )
}

const navigationOptions = ({ navigation, screenProps }) => {

 const { t, platform, global } = screenProps;

 let headerLeft = backButtonProfile({
   navigation,
   global: screenProps.global,
   name: "John"
 });

 let headerRight = null;
 if (platform === "android") {
   headerRight = <View style={global.headerFakeRight} />;
 }

 return {
   headerTitle: (
     <Text
       ellipsizeMode="tail"
       numberOfLines={1}
       style={global.appHeaderTitle}
     >
       {t("profile:emailInvites")} of John
     </Text>
   ),
   headerStyle: {
     ...StyleSheet.flatten(global.header),
     ...StyleSheet.flatten(global.headerBorder)
   },
   tabBarVisible: false,
   headerLeft: headerLeft,
   headerRight
 };
};

MyCustomScreen.navigationOptions = navigationOptions;

export default MyCustomScreen;

//In custom_code/index.js...

...

import MyCustomScreen from "./components/MyCustomScreen";
export const applyCustomCode = externalCodeSetup => {

 externalCodeSetup.navigationApi.addNavigationRoute(
   "book",
   "BookScreen",
   MyCustomScreen,
   "All"
 );
 externalCodeSetup.navigationApi.addNavigationRoute(
   "book",
   "BookScreen",
   MyCustomScreen,
   "Main"
 );
}