NavHeaderBar.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. import * as RootNavigation from "../navigation/RootNavigation.js";
  14. const BackIcon = props => <Icon {...props} fill='#fff' name='arrow-back' />;
  15. export default function NavHeaderBar(props) {
  16. const theme = useTheme();
  17. const renderBackAction = () => (
  18. <TopNavigationAction
  19. icon={BackIcon}
  20. onPress={() => RootNavigation.goBack()}
  21. />
  22. );
  23. const { accessoryRight } = props;
  24. return (
  25. <TopNavigation
  26. alignment='center'
  27. title={props.title}
  28. accessoryLeft={props.back != false && renderBackAction}
  29. accessoryRight={accessoryRight}
  30. />
  31. );
  32. }
  33. const styles = StyleSheet.create({
  34. container: {
  35. height: 45,
  36. },
  37. });