来源

集装箱/自定义/博客.ts

导入{MapProps,Compose}从“重新回顾”;导入blogfilter从“../../components/blog/blogfilter”;导入“../../navigators/reacont-navigation-addons/withactivecallbacks”的ideactiveCallbacks;从“反应导航”导入{withnavigation};从“prop-types”导入proptypes;const screentitle =“博客:标题”;const buildfilterprops = props =>({screentitle,showsearch:true,disbeinlinefilter:true,... props});const mappropshoc = mapprops(buildfilterprops);/ ** *您可以使用此组件在自定义屏幕中显示博客屏幕。* @Component * @Example <标题>使用Rest Navigation选项卡显示博客和活动列表屏幕 * //在custom_code / components / mycustomscreen.js ... * *导入从“Rack”反应; * import { View, Text } from 'react-native'; * import { createAppContainer } from 'react-navigation'; * import { createMaterialTopTabNavigator } from 'react-navigation-tabs'; * import { createStackNavigator } from 'react-navigation-stack'; * * import BlogScreen from "@src/containers/Custom/BlogScreen"; * import ActivitiesScreen from "@src/containers/Custom/ActivitiesScreen"; * * const MyCustomScreen = (props) => ( *  * *  *  Hello {props.screenProps.auth.user.user_nicename}!  *  * *  *  * ) * * const Tabs = createMaterialTopTabNavigator( * { * MyBlog: { * screen: MyCustomScreen, * navigationOptions: { * tabBarLabel: ({ tintColor }) => ( *  * Blog *  * ) * } * }, * MyActivity: { * screen: ActivitiesScreen, * navigationOptions: { * tabBarLabel: ({ tintColor }) => ( *  * Activities *  * ) * } * } * }, * { * initialRouteName: 'MyBlog', * swipeEnabled: true, * tabBarOptions: { * style: { * height: 45, * backgroundColor: '#fff', * marginTop: 50 * }, * indicatorStyle: { * backgroundColor: 'red', * }, * activeTintColor: 'black', * inactiveTintColor: 'gray', * }, * }, * ); * * const MyCustomScreenNavigator = createStackNavigator({ * Tabs: { * screen: Tabs, * navigationOptions: { * header: null * } * } * }); * * MyCustomScreenNavigator.navigationOptions = { * header: null * } * * export default MyCustomScreenNavigator; * * //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" * ); * * } */ export const BlogScreen = compose( mapPropsHoc, withNavigation, withActiveCallBacks )(BlogFilter); BlogScreen.propTypes = { /** * List screen title. Default comes from translation files in BuddyBoss site */ screenTitle: PropTypes.string, /** * Use `false` to hide search box */ showSearch: PropTypes.bool, /** * Use `true` to hide title of the screen */ hideTitle: PropTypes.bool, /** * Use `true` to hide filters in the screen */ hideFilters: PropTypes.bool, /** * Use `true` to hide the screen title container */ hideNavigationHeader: PropTypes.bool, /** * Define header height */ headerHeight: PropTypes.number }; export default BlogScreen;
Baidu