b25ebb32c1865095d3118d8d36db3a1c.json 42.6 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _extends2=_interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));var _objectWithoutProperties2=_interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));var _classCallCheck2=_interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));var _createClass2=_interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));var _possibleConstructorReturn2=_interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));var _getPrototypeOf3=_interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));var _inherits2=_interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));var _react=_interopRequireDefault(require(\"react\"));var _Animated=_interopRequireDefault(require(\"react-native-web/dist/exports/Animated\"));var _TouchableWithoutFeedback=_interopRequireDefault(require(\"react-native-web/dist/exports/TouchableWithoutFeedback\"));var _StyleSheet=_interopRequireDefault(require(\"react-native-web/dist/exports/StyleSheet\"));var _View=_interopRequireDefault(require(\"react-native-web/dist/exports/View\"));var _Keyboard=_interopRequireDefault(require(\"react-native-web/dist/exports/Keyboard\"));var _Platform=_interopRequireDefault(require(\"react-native-web/dist/exports/Platform\"));var _reactNativeSafeAreaView=_interopRequireDefault(require(\"react-native-safe-area-view\"));var _reactNavigation=require(\"react-navigation\");var _CrossFadeIcon=_interopRequireDefault(require(\"./CrossFadeIcon\"));var _withDimensions=_interopRequireDefault(require(\"../utils/withDimensions\"));var _jsxFileName=\"/Users/satya/Workspace/Callstack/react-navigation-tabs/src/views/BottomTabBar.tsx\";var majorVersion=parseInt(_Platform.default.Version,10);var isIos=_Platform.default.OS==='ios';var isIOS11=majorVersion>=11&&isIos;var DEFAULT_MAX_TAB_ITEM_WIDTH=125;var TouchableWithoutFeedbackWrapper=function(_React$Component){(0,_inherits2.default)(TouchableWithoutFeedbackWrapper,_React$Component);function TouchableWithoutFeedbackWrapper(){(0,_classCallCheck2.default)(this,TouchableWithoutFeedbackWrapper);return(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf3.default)(TouchableWithoutFeedbackWrapper).apply(this,arguments));}(0,_createClass2.default)(TouchableWithoutFeedbackWrapper,[{key:\"render\",value:function render(){var _this$props=this.props,route=_this$props.route,focused=_this$props.focused,onPress=_this$props.onPress,onLongPress=_this$props.onLongPress,testID=_this$props.testID,accessibilityLabel=_this$props.accessibilityLabel,accessibilityRole=_this$props.accessibilityRole,accessibilityStates=_this$props.accessibilityStates,rest=(0,_objectWithoutProperties2.default)(_this$props,[\"route\",\"focused\",\"onPress\",\"onLongPress\",\"testID\",\"accessibilityLabel\",\"accessibilityRole\",\"accessibilityStates\"]);return _react.default.createElement(_TouchableWithoutFeedback.default,{onPress:onPress,onLongPress:onLongPress,testID:testID,hitSlop:{left:15,right:15,top:0,bottom:5},accessibilityLabel:accessibilityLabel,accessibilityRole:accessibilityRole,accessibilityStates:accessibilityStates,__source:{fileName:_jsxFileName,lineNumber:49}},_react.default.createElement(_View.default,(0,_extends2.default)({},rest,{__source:{fileName:_jsxFileName,lineNumber:58}})));}}]);return TouchableWithoutFeedbackWrapper;}(_react.default.Component);var TabBarBottom=function(_React$Component2){(0,_inherits2.default)(TabBarBottom,_React$Component2);function TabBarBottom(){var _getPrototypeOf2;var _this;(0,_classCallCheck2.default)(this,TabBarBottom);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=(0,_possibleConstructorReturn2.default)(this,(_getPrototypeOf2=(0,_getPrototypeOf3.default)(TabBarBottom)).call.apply(_getPrototypeOf2,[this].concat(args)));_this.state={layout:{height:0,width:0},keyboard:false,visible:new _Animated.default.Value(1)};_this._handleKeyboardShow=function(){return _this.setState({keyboard:true},function(){return _Animated.default.timing(_this.state.visible,{toValue:0,duration:150,useNativeDriver:true}).start();});};_this._handleKeyboardHide=function(){return _Animated.default.timing(_this.state.visible,{toValue:1,duration:100,useNativeDriver:true}).start(function(){_this.setState({keyboard:false});});};_this._handleLayout=function(e){var layout=_this.state.layout;var _e$nativeEvent$layout=e.nativeEvent.layout,height=_e$nativeEvent$layout.height,width=_e$nativeEvent$layout.width;if(height===layout.height&&width===layout.width){return;}_this.setState({layout:{height:height,width:width}});};_this._getActiveTintColor=function(){var activeTintColor=_this.props.activeTintColor;if(!activeTintColor){return;}else if(typeof activeTintColor==='string'){return activeTintColor;}return activeTintColor[_this.context];};_this._getInactiveTintColor=function(){var inactiveTintColor=_this.props.inactiveTintColor;if(!inactiveTintColor){return;}else if(typeof inactiveTintColor==='string'){return inactiveTintColor;}return inactiveTintColor[_this.context];};_this._getActiveBackgroundColor=function(){var activeBackgroundColor=_this.props.activeBackgroundColor;if(!activeBackgroundColor){return;}else if(typeof activeBackgroundColor==='string'){return activeBackgroundColor;}return activeBackgroundColor[_this.context];};_this._getInactiveBackgroundColor=function(){var inactiveBackgroundColor=_this.props.inactiveBackgroundColor;if(!inactiveBackgroundColor){return;}else if(typeof inactiveBackgroundColor==='string'){return inactiveBackgroundColor;}return inactiveBackgroundColor[_this.context];};_this._renderLabel=function(_ref){var route=_ref.route,focused=_ref.focused;var _this$props2=_this.props,labelStyle=_this$props2.labelStyle,showLabel=_this$props2.showLabel,showIcon=_this$props2.showIcon,allowFontScaling=_this$props2.allowFontScaling;if(showLabel===false){return null;}var activeTintColor=_this._getActiveTintColor();var inactiveTintColor=_this._getInactiveTintColor();var label=_this.props.getLabelText({route:route});var tintColor=focused?activeTintColor:inactiveTintColor;var horizontal=_this._shouldUseHorizontalLabels();if(typeof label==='string'){return _react.default.createElement(_Animated.default.Text,{numberOfLines:1,style:[styles.label,{color:tintColor},showIcon&&horizontal?styles.labelBeside:styles.labelBeneath,labelStyle],allowFontScaling:allowFontScaling,__source:{fileName:_jsxFileName,lineNumber:217}},label);}if(typeof label==='function'){return label({focused:focused,tintColor:tintColor,orientation:horizontal?'horizontal':'vertical'});}return label;};_this._renderIcon=function(_ref2){var route=_ref2.route,focused=_ref2.focused;var _this$props3=_this.props,renderIcon=_this$props3.renderIcon,showIcon=_this$props3.showIcon,showLabel=_this$props3.showLabel;if(showIcon===false){return null;}var horizontal=_this._shouldUseHorizontalLabels();var activeTintColor=_this._getActiveTintColor();var inactiveTintColor=_this._getInactiveTintColor();var activeOpacity=focused?1:0;var inactiveOpacity=focused?0:1;return _react.default.createElement(_CrossFadeIcon.default,{route:route,horizontal:horizontal,activeOpacity:activeOpacity,inactiveOpacity:inactiveOpacity,activeTintColor:activeTintColor,inactiveTintColor:inactiveTintColor,renderIcon:renderIcon,style:[styles.iconWithExplicitHeight,showLabel===false&&!horizontal&&styles.iconWithoutLabel,showLabel!==false&&!horizontal&&styles.iconWithLabel],__source:{fileName:_jsxFileName,lineNumber:264}});};_this._shouldUseHorizontalLabels=function(){var routes=_this.props.navigation.state.routes;var _this$props4=_this.props,isLandscape=_this$props4.isLandscape,dimensions=_this$props4.dimensions,adaptive=_this$props4.adaptive,tabStyle=_this$props4.tabStyle,labelPosition=_this$props4.labelPosition;if(labelPosition){var position;if(typeof labelPosition==='string'){position=labelPosition;}else{position=labelPosition({deviceOrientation:isLandscape?'horizontal':'vertical'});}if(position){return position==='beside-icon';}}if(!adaptive){return false;}if(_Platform.default.isPad){var maxTabItemWidth=DEFAULT_MAX_TAB_ITEM_WIDTH;var flattenedStyle=_StyleSheet.default.flatten(tabStyle);if(flattenedStyle){if(typeof flattenedStyle.width==='number'){maxTabItemWidth=flattenedStyle.width;}else if(typeof flattenedStyle.maxWidth==='number'){maxTabItemWidth=flattenedStyle.maxWidth;}}return routes.length*maxTabItemWidth<=dimensions.width;}else{return isLandscape;}};return _this;}(0,_createClass2.default)(TabBarBottom,[{key:\"componentDidMount\",value:function componentDidMount(){if(_Platform.default.OS==='ios'){_Keyboard.default.addListener('keyboardWillShow',this._handleKeyboardShow);_Keyboard.default.addListener('keyboardWillHide',this._handleKeyboardHide);}else{_Keyboard.default.addListener('keyboardDidShow',this._handleKeyboardShow);_Keyboard.default.addListener('keyboardDidHide',this._handleKeyboardHide);}}},{key:\"componentWillUnmount\",value:function componentWillUnmount(){if(_Platform.default.OS==='ios'){_Keyboard.default.removeListener('keyboardWillShow',this._handleKeyboardShow);_Keyboard.default.removeListener('keyboardWillHide',this._handleKeyboardHide);}else{_Keyboard.default.removeListener('keyboardDidShow',this._handleKeyboardShow);_Keyboard.default.removeListener('keyboardDidHide',this._handleKeyboardHide);}}},{key:\"render\",value:function render(){var _this2=this;var _this$props5=this.props,navigation=_this$props5.navigation,keyboardHidesTabBar=_this$props5.keyboardHidesTabBar,onTabPress=_this$props5.onTabPress,onTabLongPress=_this$props5.onTabLongPress,safeAreaInset=_this$props5.safeAreaInset,style=_this$props5.style,tabStyle=_this$props5.tabStyle;var routes=navigation.state.routes;var isDark=this.context==='dark';var activeBackgroundColor=this._getActiveBackgroundColor();var inactiveBackgroundColor=this._getInactiveBackgroundColor();var _StyleSheet$flatten=_StyleSheet.default.flatten(style||{}),position=_StyleSheet$flatten.position,top=_StyleSheet$flatten.top,_StyleSheet$flatten$l=_StyleSheet$flatten.left,left=_StyleSheet$flatten$l===void 0?0:_StyleSheet$flatten$l,_StyleSheet$flatten$b=_StyleSheet$flatten.bottom,bottom=_StyleSheet$flatten$b===void 0?0:_StyleSheet$flatten$b,_StyleSheet$flatten$r=_StyleSheet$flatten.right,right=_StyleSheet$flatten$r===void 0?0:_StyleSheet$flatten$r,margin=_StyleSheet$flatten.margin,marginTop=_StyleSheet$flatten.marginTop,marginLeft=_StyleSheet$flatten.marginLeft,marginBottom=_StyleSheet$flatten.marginBottom,marginRight=_StyleSheet$flatten.marginRight,marginHorizontal=_StyleSheet$flatten.marginHorizontal,marginVertical=_StyleSheet$flatten.marginVertical,innerStyle=(0,_objectWithoutProperties2.default)(_StyleSheet$flatten,[\"position\",\"top\",\"left\",\"bottom\",\"right\",\"margin\",\"marginTop\",\"marginLeft\",\"marginBottom\",\"marginRight\",\"marginHorizontal\",\"marginVertical\"]);var containerStyle={position:position,top:top,left:left,bottom:bottom,right:right,margin:margin,marginTop:marginTop,marginLeft:marginLeft,marginBottom:marginBottom,marginRight:marginRight,marginHorizontal:marginHorizontal,marginVertical:marginVertical};var tabBarStyle=[styles.tabBar,isDark?styles.tabBarDark:styles.tabBarLight,this._shouldUseHorizontalLabels()&&!_Platform.default.isPad?styles.tabBarCompact:styles.tabBarRegular,innerStyle];return _react.default.createElement(_Animated.default.View,{style:[styles.container,keyboardHidesTabBar?{transform:[{translateY:this.state.visible.interpolate({inputRange:[0,1],outputRange:[this.state.layout.height,0]})}],position:this.state.keyboard?'absolute':null}:null,containerStyle],pointerEvents:keyboardHidesTabBar&&this.state.keyboard?'none':'auto',onLayout:this._handleLayout,__source:{fileName:_jsxFileName,lineNumber:389}},_react.default.createElement(_reactNativeSafeAreaView.default,{style:tabBarStyle,forceInset:safeAreaInset,__source:{fileName:_jsxFileName,lineNumber:415}},routes.map(function(route,index){var focused=index===navigation.state.index;var scene={route:route,focused:focused};var accessibilityLabel=_this2.props.getAccessibilityLabel({route:route});var accessibilityRole=_this2.props.getAccessibilityRole({route:route});var accessibilityStates=_this2.props.getAccessibilityStates(scene);var testID=_this2.props.getTestID({route:route});var backgroundColor=focused?activeBackgroundColor:inactiveBackgroundColor;var ButtonComponent=_this2.props.getButtonComponent({route:route})||TouchableWithoutFeedbackWrapper;return _react.default.createElement(ButtonComponent,{key:route.key,route:route,focused:focused,onPress:function onPress(){return onTabPress({route:route});},onLongPress:function onLongPress(){return onTabLongPress({route:route});},testID:testID,accessibilityLabel:accessibilityLabel,accessibilityRole:accessibilityRole,accessibilityStates:accessibilityStates,style:[styles.tab,{backgroundColor:backgroundColor},_this2._shouldUseHorizontalLabels()?styles.tabLandscape:styles.tabPortrait,tabStyle],__source:{fileName:_jsxFileName,lineNumber:442}},_this2._renderIcon(scene),_this2._renderLabel(scene));})));}}]);return TabBarBottom;}(_react.default.Component);TabBarBottom.defaultProps={keyboardHidesTabBar:true,activeTintColor:{light:'#007AFF',dark:'#fff'},inactiveTintColor:{light:'#8e8e93',dark:'#7f7f7f'},activeBackgroundColor:'transparent',inactiveBackgroundColor:'transparent',showLabel:true,showIcon:true,allowFontScaling:true,adaptive:isIOS11,safeAreaInset:{bottom:'always',top:'never'}};TabBarBottom.contextType=_reactNavigation.ThemeContext;var DEFAULT_HEIGHT=49;var COMPACT_HEIGHT=29;var styles=_StyleSheet.default.create({tabBar:{borderTopWidth:_StyleSheet.default.hairlineWidth,flexDirection:'row'},tabBarLight:{backgroundColor:_reactNavigation.ThemeColors.light.header,borderTopColor:_reactNavigation.ThemeColors.light.headerBorder},tabBarDark:{backgroundColor:_reactNavigation.ThemeColors.dark.header,borderTopColor:_reactNavigation.ThemeColors.dark.headerBorder},container:{elevation:8},tabBarCompact:{height:COMPACT_HEIGHT},tabBarRegular:{height:DEFAULT_HEIGHT},tab:{flex:1,alignItems:isIos?'center':'stretch'},tabPortrait:{justifyContent:'flex-end',flexDirection:'column'},tabLandscape:{justifyContent:'center',flexDirection:'row'},iconWithoutLabel:{flex:1},iconWithLabel:{flex:1},iconWithExplicitHeight:{height:_Platform.default.isPad?DEFAULT_HEIGHT:COMPACT_HEIGHT},label:{textAlign:'center',backgroundColor:'transparent'},labelBeneath:{fontSize:11,marginBottom:1.5},labelBeside:{fontSize:12,marginLeft:20}});var _default=(0,_withDimensions.default)(TabBarBottom);exports.default=_default;","map":{"version":3,"sources":["BottomTabBar.tsx"],"names":["majorVersion","parseInt","Platform","isIos","isIOS11","DEFAULT_MAX_TAB_ITEM_WIDTH","TouchableWithoutFeedbackWrapper","React","Component","route","focused","onPress","onLongPress","testID","accessibilityLabel","accessibilityRole","accessibilityStates","rest","left","right","top","bottom","TabBarBottom","defaultProps","keyboardHidesTabBar","activeTintColor","light","dark","inactiveTintColor","activeBackgroundColor","inactiveBackgroundColor","showLabel","showIcon","allowFontScaling","adaptive","safeAreaInset","contextType","ThemeContext","state","layout","height","width","keyboard","visible","Animated","Keyboard","_handleKeyboardShow","toValue","duration","useNativeDriver","_handleKeyboardHide","_handleLayout","e","_getActiveTintColor","_getInactiveTintColor","_getActiveBackgroundColor","_getInactiveBackgroundColor","_renderLabel","labelStyle","label","tintColor","horizontal","styles","color","orientation","_renderIcon","renderIcon","activeOpacity","inactiveOpacity","_shouldUseHorizontalLabels","routes","isLandscape","dimensions","tabStyle","labelPosition","position","deviceOrientation","maxTabItemWidth","flattenedStyle","StyleSheet","navigation","onTabPress","onTabLongPress","style","isDark","margin","marginTop","marginLeft","marginBottom","marginRight","marginHorizontal","marginVertical","innerStyle","containerStyle","tabBarStyle","transform","translateY","inputRange","outputRange","index","scene","backgroundColor","ButtonComponent","DEFAULT_HEIGHT","COMPACT_HEIGHT","tabBar","borderTopWidth","flexDirection","tabBarLight","ThemeColors","borderTopColor","tabBarDark","container","elevation","tabBarCompact","tabBarRegular","tab","flex","alignItems","tabPortrait","justifyContent","tabLandscape","iconWithoutLabel","iconWithLabel","iconWithExplicitHeight","textAlign","labelBeneath","fontSize","labelBeside","withDimensions"],"mappings":"6zBAAA,oD,4iBAUA,4FACA,iDAEA,sEACA,+E,qGASA,GAAMA,CAAAA,YAAY,CAAGC,QAAQ,CAACC,kBAAD,OAAA,CAA7B,EAA6B,CAA7B,CACA,GAAMC,CAAAA,KAAK,CAAGD,kBAAAA,EAAAA,GAAd,KAAA,CACA,GAAME,CAAAA,OAAO,CAAGJ,YAAY,EAAZA,EAAAA,EAAhB,KAAA,CAEA,GAAMK,CAAAA,0BAA0B,CAAhC,GAAA,CAEMC,GAAAA,CAAAA,+B,4bAGK,CAAA,GAAA,CAAA,WAAA,CAaH,KAbG,KAAA,CAGLG,KAHK,CAAA,WAAA,CAAA,KAAA,CAKLC,OALK,CAAA,WAAA,CAAA,OAAA,CAMLC,OANK,CAAA,WAAA,CAAA,OAAA,CAOLC,WAPK,CAAA,WAAA,CAAA,WAAA,CAQLC,MARK,CAA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YASnB,CATmB,CAa/BG,SAAS,CAAE,CACTC,SAAS,CAdoB,CAapB,CAboB,CAgB/BC,aAAa,CAAE,CACb1E,MAAM,CAjBuB,cAgBhB,CAhBgB,CAmB/B2E,aAAa,CAAE,CACb3E,MAAM,CApBuB,cAmBhB,CAnBgB,CAsB/B4E,GAAG,CAAE,CACHC,IAAI,CADD,CAAA,CAEHC,UAAU,CAAEnH,KAAK,CAAA,QAAA,CAxBY,SAsB1B,CAtB0B,CA0B/BoH,WAAW,CAAE,CACXC,cAAc,CADH,UAAA,CAEXb,aAAa,CA5BgB,QA0BlB,CA1BkB,CA8B/Bc,YAAY,CAAE,CACZD,cAAc,CADF,QAAA,CAEZb,aAAa,CAhCgB,KA8BjB,CA9BiB,CAkC/Be,gBAAgB,CAAE,CAChBL,IAAI,CAnCyB,CAkCb,CAlCa,CAqC/BM,aAAa,CAAE,CACbN,IAAI,CAtCyB,CAqChB,CArCgB,CAwC/BO,sBAAsB,CAAE,CAEtBpF,MAAM,CAAEtC,kBAAAA,KAAAA,CAAAA,cAAAA,CA1CqB,cAwCP,CAxCO,CA4C/ByD,KAAK,CAAE,CACLkE,SAAS,CADJ,QAAA,CAELxB,eAAe,CA9Cc,aA4CxB,CA5CwB,CAgD/ByB,YAAY,CAAE,CACZC,QAAQ,CADI,EAAA,CAEZvC,YAAY,CAlDiB,GAgDjB,CAhDiB,CAoD/BwC,WAAW,CAAE,CACXD,QAAQ,CADG,EAAA,CAEXxC,UAAU,CAtDd,EAoDe,CApDkB,CAAlBR,CAAf,C,aA0DekD,4BAAf,YAAeA,C","sourcesContent":["import React from 'react';\nimport {\n  Animated,\n  TouchableWithoutFeedback,\n  StyleSheet,\n  View,\n  Keyboard,\n  Platform,\n  LayoutChangeEvent,\n} from 'react-native';\nimport SafeAreaView from 'react-native-safe-area-view';\nimport { ThemeColors, ThemeContext, NavigationRoute } from 'react-navigation';\n\nimport CrossFadeIcon from './CrossFadeIcon';\nimport withDimensions from '../utils/withDimensions';\nimport { BottomTabBarProps, ButtonComponentProps } from '../types';\n\ntype State = {\n  layout: { height: number; width: number };\n  keyboard: boolean;\n  visible: Animated.Value;\n};\n\nconst majorVersion = parseInt(Platform.Version as string, 10);\nconst isIos = Platform.OS === 'ios';\nconst isIOS11 = majorVersion >= 11 && isIos;\n\nconst DEFAULT_MAX_TAB_ITEM_WIDTH = 125;\n\nclass TouchableWithoutFeedbackWrapper extends React.Component<\n  ButtonComponentProps\n> {\n  render() {\n    const {\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n      route,\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n      focused,\n      onPress,\n      onLongPress,\n      testID,\n      accessibilityLabel,\n      accessibilityRole,\n      accessibilityStates,\n      ...rest\n    } = this.props;\n\n    return (\n      <TouchableWithoutFeedback\n        onPress={onPress}\n        onLongPress={onLongPress}\n        testID={testID}\n        hitSlop={{ left: 15, right: 15, top: 0, bottom: 5 }}\n        accessibilityLabel={accessibilityLabel}\n        accessibilityRole={accessibilityRole}\n        accessibilityStates={accessibilityStates}\n      >\n        <View {...rest} />\n      </TouchableWithoutFeedback>\n    );\n  }\n}\n\nclass TabBarBottom extends React.Component<BottomTabBarProps, State> {\n  static defaultProps = {\n    keyboardHidesTabBar: true,\n    activeTintColor: {\n      light: '#007AFF',\n      dark: '#fff',\n    },\n    inactiveTintColor: {\n      light: '#8e8e93',\n      dark: '#7f7f7f',\n    },\n    activeBackgroundColor: 'transparent',\n    inactiveBackgroundColor: 'transparent',\n    showLabel: true,\n    showIcon: true,\n    allowFontScaling: true,\n    adaptive: isIOS11,\n    safeAreaInset: { bottom: 'always', top: 'never' } as React.ComponentProps<\n      typeof SafeAreaView\n    >['forceInset'],\n  };\n\n  // eslint-disable-next-line react/sort-comp\n  static contextType = ThemeContext;\n\n  state = {\n    layout: { height: 0, width: 0 },\n    keyboard: false,\n    visible: new Animated.Value(1),\n  };\n\n  componentDidMount() {\n    if (Platform.OS === 'ios') {\n      Keyboard.addListener('keyboardWillShow', this._handleKeyboardShow);\n      Keyboard.addListener('keyboardWillHide', this._handleKeyboardHide);\n    } else {\n      Keyboard.addListener('keyboardDidShow', this._handleKeyboardShow);\n      Keyboard.addListener('keyboardDidHide', this._handleKeyboardHide);\n    }\n  }\n\n  componentWillUnmount() {\n    if (Platform.OS === 'ios') {\n      Keyboard.removeListener('keyboardWillShow', this._handleKeyboardShow);\n      Keyboard.removeListener('keyboardWillHide', this._handleKeyboardHide);\n    } else {\n      Keyboard.removeListener('keyboardDidShow', this._handleKeyboardShow);\n      Keyboard.removeListener('keyboardDidHide', this._handleKeyboardHide);\n    }\n  }\n\n  // @ts-ignore\n  context: 'light' | 'dark';\n\n  _handleKeyboardShow = () =>\n    this.setState({ keyboard: true }, () =>\n      Animated.timing(this.state.visible, {\n        toValue: 0,\n        duration: 150,\n        useNativeDriver: true,\n      }).start()\n    );\n\n  _handleKeyboardHide = () =>\n    Animated.timing(this.state.visible, {\n      toValue: 1,\n      duration: 100,\n      useNativeDriver: true,\n    }).start(() => {\n      this.setState({ keyboard: false });\n    });\n\n  _handleLayout = (e: LayoutChangeEvent) => {\n    const { layout } = this.state;\n    const { height, width } = e.nativeEvent.layout;\n\n    if (height === layout.height && width === layout.width) {\n      return;\n    }\n\n    this.setState({\n      layout: {\n        height,\n        width,\n      },\n    });\n  };\n\n  _getActiveTintColor = () => {\n    let { activeTintColor } = this.props;\n    if (!activeTintColor) {\n      return;\n    } else if (typeof activeTintColor === 'string') {\n      return activeTintColor;\n    }\n\n    return activeTintColor[this.context];\n  };\n\n  _getInactiveTintColor = () => {\n    let { inactiveTintColor } = this.props;\n    if (!inactiveTintColor) {\n      return;\n    } else if (typeof inactiveTintColor === 'string') {\n      return inactiveTintColor;\n    }\n\n    return inactiveTintColor[this.context];\n  };\n\n  _getActiveBackgroundColor = () => {\n    let { activeBackgroundColor } = this.props;\n    if (!activeBackgroundColor) {\n      return;\n    } else if (typeof activeBackgroundColor === 'string') {\n      return activeBackgroundColor;\n    }\n\n    return activeBackgroundColor[this.context];\n  };\n\n  _getInactiveBackgroundColor = () => {\n    let { inactiveBackgroundColor } = this.props;\n    if (!inactiveBackgroundColor) {\n      return;\n    } else if (typeof inactiveBackgroundColor === 'string') {\n      return inactiveBackgroundColor;\n    }\n\n    return inactiveBackgroundColor[this.context];\n  };\n\n  _renderLabel = ({\n    route,\n    focused,\n  }: {\n    route: NavigationRoute;\n    focused: boolean;\n  }) => {\n    const { labelStyle, showLabel, showIcon, allowFontScaling } = this.props;\n\n    if (showLabel === false) {\n      return null;\n    }\n\n    const activeTintColor = this._getActiveTintColor();\n    const inactiveTintColor = this._getInactiveTintColor();\n    const label = this.props.getLabelText({ route });\n    const tintColor = focused ? activeTintColor : inactiveTintColor;\n    const horizontal = this._shouldUseHorizontalLabels();\n\n    if (typeof label === 'string') {\n      return (\n        <Animated.Text\n          numberOfLines={1}\n          style={[\n            styles.label,\n            { color: tintColor },\n            showIcon && horizontal ? styles.labelBeside : styles.labelBeneath,\n            labelStyle,\n          ]}\n          allowFontScaling={allowFontScaling}\n        >\n          {label}\n        </Animated.Text>\n      );\n    }\n\n    if (typeof label === 'function') {\n      return label({\n        focused,\n        tintColor,\n        orientation: horizontal ? 'horizontal' : 'vertical',\n      });\n    }\n\n    return label;\n  };\n\n  _renderIcon = ({\n    route,\n    focused,\n  }: {\n    route: NavigationRoute;\n    focused: boolean;\n  }) => {\n    const { renderIcon, showIcon, showLabel } = this.props;\n\n    if (showIcon === false) {\n      return null;\n    }\n\n    const horizontal = this._shouldUseHorizontalLabels();\n\n    const activeTintColor = this._getActiveTintColor();\n    const inactiveTintColor = this._getInactiveTintColor();\n    const activeOpacity = focused ? 1 : 0;\n    const inactiveOpacity = focused ? 0 : 1;\n\n    return (\n      <CrossFadeIcon\n        route={route}\n        horizontal={horizontal}\n        activeOpacity={activeOpacity}\n        inactiveOpacity={inactiveOpacity}\n        activeTintColor={activeTintColor}\n        inactiveTintColor={inactiveTintColor}\n        renderIcon={renderIcon}\n        style={[\n          styles.iconWithExplicitHeight,\n          showLabel === false && !horizontal && styles.iconWithoutLabel,\n          showLabel !== false && !horizontal && styles.iconWithLabel,\n        ]}\n      />\n    );\n  };\n\n  _shouldUseHorizontalLabels = () => {\n    const { routes } = this.props.navigation.state;\n    const {\n      isLandscape,\n      dimensions,\n      adaptive,\n      tabStyle,\n      labelPosition,\n    } = this.props;\n\n    if (labelPosition) {\n      let position;\n      if (typeof labelPosition === 'string') {\n        position = labelPosition;\n      } else {\n        position = labelPosition({\n          deviceOrientation: isLandscape ? 'horizontal' : 'vertical',\n        });\n      }\n\n      if (position) {\n        return position === 'beside-icon';\n      }\n    }\n\n    if (!adaptive) {\n      return false;\n    }\n\n    // @ts-ignore\n    if (Platform.isPad) {\n      let maxTabItemWidth = DEFAULT_MAX_TAB_ITEM_WIDTH;\n\n      const flattenedStyle = StyleSheet.flatten(tabStyle);\n\n      if (flattenedStyle) {\n        if (typeof flattenedStyle.width === 'number') {\n          maxTabItemWidth = flattenedStyle.width;\n        } else if (typeof flattenedStyle.maxWidth === 'number') {\n          maxTabItemWidth = flattenedStyle.maxWidth;\n        }\n      }\n\n      return routes.length * maxTabItemWidth <= dimensions.width;\n    } else {\n      return isLandscape;\n    }\n  };\n\n  render() {\n    const {\n      navigation,\n      keyboardHidesTabBar,\n      onTabPress,\n      onTabLongPress,\n      safeAreaInset,\n      style,\n      tabStyle,\n    } = this.props;\n\n    const { routes } = navigation.state;\n    const isDark = this.context === 'dark';\n\n    const activeBackgroundColor = this._getActiveBackgroundColor();\n    const inactiveBackgroundColor = this._getInactiveBackgroundColor();\n\n    const {\n      position,\n      top,\n      left = 0,\n      bottom = 0,\n      right = 0,\n      margin,\n      marginTop,\n      marginLeft,\n      marginBottom,\n      marginRight,\n      marginHorizontal,\n      marginVertical,\n      ...innerStyle\n    } = StyleSheet.flatten(style || {});\n\n    const containerStyle = {\n      position,\n      top,\n      left,\n      bottom,\n      right,\n      margin,\n      marginTop,\n      marginLeft,\n      marginBottom,\n      marginRight,\n      marginHorizontal,\n      marginVertical,\n    };\n\n    const tabBarStyle = [\n      styles.tabBar,\n      isDark ? styles.tabBarDark : styles.tabBarLight,\n      // @ts-ignore\n      this._shouldUseHorizontalLabels() && !Platform.isPad\n        ? styles.tabBarCompact\n        : styles.tabBarRegular,\n      innerStyle,\n    ];\n\n    return (\n      <Animated.View\n        style={[\n          styles.container,\n          keyboardHidesTabBar\n            ? {\n                // When the keyboard is shown, slide down the tab bar\n                transform: [\n                  {\n                    translateY: this.state.visible.interpolate({\n                      inputRange: [0, 1],\n                      outputRange: [this.state.layout.height, 0],\n                    }),\n                  },\n                ],\n                // Absolutely position the tab bar so that the content is below it\n                // This is needed to avoid gap at bottom when the tab bar is hidden\n                position: this.state.keyboard ? 'absolute' : null,\n              }\n            : null,\n          containerStyle,\n        ]}\n        pointerEvents={\n          keyboardHidesTabBar && this.state.keyboard ? 'none' : 'auto'\n        }\n        onLayout={this._handleLayout}\n      >\n        <SafeAreaView style={tabBarStyle} forceInset={safeAreaInset}>\n          {routes.map((route, index) => {\n            const focused = index === navigation.state.index;\n            const scene = { route, focused };\n            const accessibilityLabel = this.props.getAccessibilityLabel({\n              route,\n            });\n\n            const accessibilityRole = this.props.getAccessibilityRole({\n              route,\n            });\n\n            const accessibilityStates = this.props.getAccessibilityStates(\n              scene\n            );\n\n            const testID = this.props.getTestID({ route });\n\n            const backgroundColor = focused\n              ? activeBackgroundColor\n              : inactiveBackgroundColor;\n\n            const ButtonComponent =\n              this.props.getButtonComponent({ route }) ||\n              TouchableWithoutFeedbackWrapper;\n\n            return (\n              <ButtonComponent\n                key={route.key}\n                route={route}\n                focused={focused}\n                onPress={() => onTabPress({ route })}\n                onLongPress={() => onTabLongPress({ route })}\n                testID={testID}\n                accessibilityLabel={accessibilityLabel}\n                accessibilityRole={accessibilityRole}\n                accessibilityStates={accessibilityStates}\n                style={[\n                  styles.tab,\n                  { backgroundColor },\n                  this._shouldUseHorizontalLabels()\n                    ? styles.tabLandscape\n                    : styles.tabPortrait,\n                  tabStyle,\n                ]}\n              >\n                {this._renderIcon(scene)}\n                {this._renderLabel(scene)}\n              </ButtonComponent>\n            );\n          })}\n        </SafeAreaView>\n      </Animated.View>\n    );\n  }\n}\n\nconst DEFAULT_HEIGHT = 49;\nconst COMPACT_HEIGHT = 29;\n\nconst styles = StyleSheet.create({\n  tabBar: {\n    borderTopWidth: StyleSheet.hairlineWidth,\n    flexDirection: 'row',\n  },\n  tabBarLight: {\n    backgroundColor: ThemeColors.light.header,\n    borderTopColor: ThemeColors.light.headerBorder,\n  },\n  tabBarDark: {\n    backgroundColor: ThemeColors.dark.header,\n    borderTopColor: ThemeColors.dark.headerBorder,\n  },\n  container: {\n    elevation: 8,\n  },\n  tabBarCompact: {\n    height: COMPACT_HEIGHT,\n  },\n  tabBarRegular: {\n    height: DEFAULT_HEIGHT,\n  },\n  tab: {\n    flex: 1,\n    alignItems: isIos ? 'center' : 'stretch',\n  },\n  tabPortrait: {\n    justifyContent: 'flex-end',\n    flexDirection: 'column',\n  },\n  tabLandscape: {\n    justifyContent: 'center',\n    flexDirection: 'row',\n  },\n  iconWithoutLabel: {\n    flex: 1,\n  },\n  iconWithLabel: {\n    flex: 1,\n  },\n  iconWithExplicitHeight: {\n    // @ts-ignore\n    height: Platform.isPad ? DEFAULT_HEIGHT : COMPACT_HEIGHT,\n  },\n  label: {\n    textAlign: 'center',\n    backgroundColor: 'transparent',\n  },\n  labelBeneath: {\n    fontSize: 11,\n    marginBottom: 1.5,\n  },\n  labelBeside: {\n    fontSize: 12,\n    marginLeft: 20,\n  },\n});\n\nexport default withDimensions(TabBarBottom);\n"]},"metadata":{},"sourceType":"script"}