You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.js 807B

12345678910111213141516171819202122232425262728293031
  1. import React from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import { Platform } from 'react-native';
  4. import { IconClose } from '../../base/icons';
  5. import HeaderNavigationButton from './components/HeaderNavigationButton';
  6. /**
  7. * Close icon/text button based on platform.
  8. *
  9. * @param {Function} goBack - Goes back to the previous screen function.
  10. * @returns {React.Component}
  11. */
  12. export function screenHeaderCloseButton(goBack: Function) {
  13. const { t } = useTranslation();
  14. if (Platform.OS === 'ios') {
  15. return (
  16. <HeaderNavigationButton
  17. label = { t('dialog.close') }
  18. onPress = { goBack } />
  19. );
  20. }
  21. return (
  22. <HeaderNavigationButton
  23. onPress = { goBack }
  24. src = { IconClose } />
  25. );
  26. }