NavHeaderBar.js 951 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import React from "react";
  2. import {
  3. Button,
  4. Layout,
  5. useTheme,
  6. Text,
  7. TopNavigation,
  8. TopNavigationAction,
  9. Icon,
  10. } from "@ui-kitten/components";
  11. import { useModel } from "flooks";
  12. import { Image, StyleSheet } from "react-native";
  13. const BackIcon = (props) => <Icon {...props} fill='#fff' name='arrow-back' />;
  14. export default function NavHeaderBar(props) {
  15. const theme = useTheme();
  16. const { registerInfo } = useModel("userModel", true);
  17. const { backRouter } = useModel("routersModel", true);
  18. const renderBackAction = () => (
  19. <TopNavigationAction icon={BackIcon} onPress={backRouter} />
  20. );
  21. return (
  22. <TopNavigation
  23. alignment='center'
  24. title={props.title}
  25. accessoryLeft={props.back != false && renderBackAction}
  26. />
  27. );
  28. }
  29. const styles = StyleSheet.create({
  30. container: {
  31. height: 45,
  32. },
  33. });