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.

1 line
5.9 KiB

{"ast":null,"code":"import React from 'react';\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nimport Badge from \"./Badge\";\nexport default function TabBarIcon(_ref) {\n var _ = _ref.route,\n horizontal = _ref.horizontal,\n badge = _ref.badge,\n badgeStyle = _ref.badgeStyle,\n activeOpacity = _ref.activeOpacity,\n inactiveOpacity = _ref.inactiveOpacity,\n activeTintColor = _ref.activeTintColor,\n inactiveTintColor = _ref.inactiveTintColor,\n renderIcon = _ref.renderIcon,\n style = _ref.style;\n var size = 25;\n return React.createElement(View, {\n style: [horizontal ? styles.iconHorizontal : styles.iconVertical, style]\n }, React.createElement(View, {\n style: [styles.icon, {\n opacity: activeOpacity\n }]\n }, renderIcon({\n focused: true,\n size: size,\n color: activeTintColor\n })), React.createElement(View, {\n style: [styles.icon, {\n opacity: inactiveOpacity\n }]\n }, renderIcon({\n focused: false,\n size: size,\n color: inactiveTintColor\n })), React.createElement(Badge, {\n visible: badge != null,\n style: [styles.badge, horizontal ? styles.badgeHorizontal : styles.badgeVertical, badgeStyle],\n size: size * 3 / 4\n }, badge));\n}\nvar styles = StyleSheet.create({\n icon: {\n position: 'absolute',\n alignSelf: 'center',\n alignItems: 'center',\n justifyContent: 'center',\n height: '100%',\n width: '100%',\n minWidth: 25\n },\n iconVertical: {\n flex: 1\n },\n iconHorizontal: {\n height: '100%',\n marginTop: 3\n },\n badge: {\n position: 'absolute',\n left: 3\n },\n badgeVertical: {\n top: 3\n },\n badgeHorizontal: {\n top: 7\n }\n});","map":{"version":3,"sources":["TabBarIcon.tsx"],"names":["React","Badge","TabBarIcon","route","_","horizontal","badge","badgeStyle","activeOpacity","inactiveOpacity","activeTintColor","inactiveTintColor","renderIcon","style","size","styles","iconHorizontal","iconVertical","icon","opacity","focused","color","badgeHorizontal","badgeVertical","StyleSheet","create","position","alignSelf","alignIt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A,CAAC,KAAK,EAAA;IACJ,OAAO,EAAEL,KAAK,IAAI,IAAK;IACvB,KAAK,EAAE,CACLS,MAAM,CAACT,KAAK,EACZD,UAAU,GAAGU,MAAM,CAACO,eAAe,GAAGP,MAAM,CAACQ,aAAa,EAC1DhB,UAAU,CACV;IACF,IAAI,EAAGO,IAAI,GAAG,CAAC,GAAI;EAAE,CAAA,EAEpBR,KAAK,CACA,CACH;AAEX;AAEA,IAAMS,MAAM,GAAGS,UAAU,CAACC,MAAM,CAAC;EAC/BP,IAAI,EAAE;IAIJQ,QAAQ,EAAE,UAAU;IACpBC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,MAAM,EAAE,MAAM;IACdC,KAAK,EAAE,MAAM;IAEbC,QAAQ,EAAE;EACZ,CAAC;EACDf,YAAY,EAAE;IACZgB,IAAI,EAAE;EACR,CAAC;EACDjB,cAAc,EAAE;IACdc,MAAM,EAAE,MAAM;IACdI,SAAS,EAAE;EACb,CAAC;EACD5B,KAAK,EAAE;IACLoB,QAAQ,EAAE,UAAU;IACpBS,IAAI,EAAE;EACR,CAAC;EACDZ,aAAa,EAAE;IACba,GAAG,EAAE;EACP,CAAC;EACDd,eAAe,EAAE;IACfc,GAAG,EAAE;EACP;AACF,CAAC,CAAC","sourceRoot":"../../src","sourcesContent":["import React from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport Badge from './Badge';\nexport default function TabBarIcon(_ref) {\n let {\n route: _,\n horizontal,\n badge,\n badgeStyle,\n activeOpacity,\n inactiveOpacity,\n activeTintColor,\n inactiveTintColor,\n renderIcon,\n style\n } = _ref;\n const size = 25;\n\n // We render the icon twice at the same position on top of each other:\n // active and inactive one, so we can fade between them.\n return /*#__PURE__*/React.createElement(View, {\n style: [horizontal ? styles.iconHorizontal : styles.iconVertical, style]\n }, /*#__PURE__*/React.createElement(View, {\n style: [styles.icon, {\n opacity: activeOpacity\n }]\n }, renderIcon({\n focused: true,\n size,\n color: activeTintColor\n })), /*#__PURE__*/React.createElement(View, {\n style: [styles.icon, {\n opacity: inactiveOpacity\n }]\n }, renderIcon({\n focused: false,\n size,\n color: inactiveTintColor\n })), /*#__PURE__*/React.createElement(Badge, {\n visible: badge != null,\n style: [styles.badge, horizontal ? styles.badgeHorizontal : styles.badgeVertical, badgeStyle],\n size: size * 3 / 4\n }, badge));\n}\nconst styles = StyleSheet.create({\n icon: {\n // We render the icon twice at the same position on top of each other:\n // active and inactive one, so we can fade between them:\n // Cover the whole iconContainer:\n position: 'absolute',\n alignSelf: 'center',\n alignItems: 'center',\n justifyContent: 'center',\n height: '100%',\n width: '100%',\n // Workaround for react-native >= 0.54 layout bug\n minWidth: 25\n },\n iconVertical: {\n flex: 1\n },\n iconHorizontal: {\n height: '100%',\n marginTop: 3\n },\n badge: {\n position: 'absolute',\n left: 3\n },\n badgeVertical: {\n top: 3\n },\n badgeHorizontal: {\n top: 7\n }\n});\n//# sourceMappingURL=TabBarIcon.js.map"]},"metadata":{},"sourceType":"module"}