"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactI18next = require("react-i18next");
var _reactNative = require("react-native");
var _theme = require("../../contexts/theme");
var _testable = require("../../utils/testable");
var _IconButton = _interopRequireWildcard(require("../buttons/IconButton"));
var _ThemedText = require("../texts/ThemedText");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
// Used for modals that we want to look like regular screens
const FauxHeader = ({
  title,
  onBackPressed
}) => {
  const {
    ColorPallet,
    Spacing,
    NavigationTheme
  } = (0, _theme.useTheme)();
  const {
    t
  } = (0, _reactI18next.useTranslation)();
  const styles = _reactNative.StyleSheet.create({
    header: {
      backgroundColor: NavigationTheme.colors.primary,
      elevation: 0,
      shadowOffset: {
        width: 0,
        height: 6
      },
      shadowRadius: 6,
      shadowColor: ColorPallet.grayscale.black,
      shadowOpacity: 0.15,
      zIndex: 2,
      borderWidth: 0,
      flexDirection: 'row',
      alignItems: 'stretch',
      minHeight: _reactNative.Platform.OS === 'ios' ? 44 : 56
    },
    left: {
      justifyContent: 'center',
      alignItems: 'flex-start'
    },
    titleContainer: {
      marginHorizontal: Spacing.md,
      justifyContent: 'center',
      alignItems: 'center',
      flexShrink: 1,
      maxWidth: '68%',
      width: '100%'
    },
    title: {
      textAlign: 'center'
    },
    right: {
      justifyContent: 'center',
      alignItems: 'flex-end'
    }
  });
  return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styles.header
  }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styles.left
  }, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
    buttonLocation: _IconButton.ButtonLocation.Left,
    accessibilityLabel: t('Global.Back'),
    testID: (0, _testable.testIdWithKey)('BackButton'),
    onPress: onBackPressed,
    icon: "chevron-left"
  })), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styles.titleContainer
  }, /*#__PURE__*/_react.default.createElement(_ThemedText.ThemedText, {
    variant: 'headerTitle',
    numberOfLines: 1,
    ellipsizeMode: "tail",
    style: styles.title
  }, title)), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
    style: styles.right
  }));
};
var _default = exports.default = FauxHeader;
//# sourceMappingURL=FauxHeader.js.map