Header.js 820 B

123456789101112131415161718192021222324252627
  1. /* eslint-disable react/style-prop-object */
  2. import * as React from 'react';
  3. import { View } from 'react-native';
  4. import { StatusBar } from 'expo-status-bar';
  5. import { Appbar } from 'react-native-paper';
  6. import { goBack } from '../navigation/RootNavigation';
  7. export default function Header({ title, noBack }) {
  8. return (
  9. <>
  10. <StatusBar backgroundColor="#FFC21C" style="light" translucent />
  11. <Appbar.Header dark>
  12. {!noBack && <Appbar.BackAction onPress={goBack} />}
  13. <Appbar.Content
  14. title={title || ''}
  15. titleStyle={{ textAlign: 'center', fontSize: 16 }}
  16. />
  17. {!noBack && (
  18. <Appbar.Action
  19. icon={() => <View style={{ width: 24, height: 24 }} />}
  20. />
  21. )}
  22. </Appbar.Header>
  23. </>
  24. );
  25. }