NavHeaderBar.js 952 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. return (
  24. <TopNavigation
  25. alignment='center'
  26. title={props.title}
  27. accessoryLeft={props.back != false && renderBackAction}
  28. />
  29. );
  30. }
  31. const styles = StyleSheet.create({
  32. container: {
  33. height: 45,
  34. },
  35. });