@tarojs/router-rn 3.5.0-canary.1 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,44 +1,44 @@
1
- // eslint-disable-next-line no-use-before-define
2
1
  import * as React from 'react'
3
2
  import {
4
- View,
5
- Text,
6
3
  Image,
7
- StyleSheet,
8
4
  ImageSourcePropType,
9
- ViewStyle,
10
- TextStyle
5
+ StyleSheet,
6
+ Text,
7
+ TextStyle,
8
+ View,
9
+ ViewStyle
11
10
  } from 'react-native'
11
+
12
12
  import Badge from './Badge'
13
13
 
14
14
  export interface TabBarOptions {
15
- activeTintColor: string,
16
- inactiveTintColor: string,
17
- activeBackgroundColor: string,
18
- inactiveBackgroundColor: string,
19
- tabStyle?: ViewStyle,
20
- labelStyle?: TextStyle,
21
- showLabel?: boolean,
22
- allowFontScaling?: boolean,
23
- keyboardHidesTabBar?: boolean,
15
+ activeTintColor: string
16
+ inactiveTintColor: string
17
+ activeBackgroundColor: string
18
+ inactiveBackgroundColor: string
19
+ tabStyle?: ViewStyle
20
+ labelStyle?: TextStyle
21
+ showLabel?: boolean
22
+ allowFontScaling?: boolean
23
+ keyboardHidesTabBar?: boolean
24
24
  safeAreaInsets?: Record<string, number>
25
25
  style?: ViewStyle
26
26
  }
27
27
 
28
28
  export interface TabOptions {
29
- tabBarVisible?: boolean,
30
- tabBarBadge?: boolean,
31
- tabBarBadgeStyle?: Record<string, any>,
29
+ tabBarVisible?: boolean
30
+ tabBarBadge?: boolean
31
+ tabBarBadgeStyle?: Record<string, any>
32
32
  }
33
33
  interface TabBarItemProps extends TabBarOptions{
34
- badge: number | string,
35
- showRedDot: boolean,
36
- label: string,
37
- horizontal: boolean,
38
- labelColor: string,
34
+ badge: number | string
35
+ showRedDot: boolean
36
+ label: string
37
+ horizontal: boolean
38
+ labelColor: string
39
39
  iconSource: ImageSourcePropType
40
- size?: number,
41
- userOptions?: TabOptions
40
+ size?: number
41
+ tabOptions?: TabOptions
42
42
  }
43
43
 
44
44
  const styles = StyleSheet.create({
@@ -97,7 +97,6 @@ const styles = StyleSheet.create({
97
97
  })
98
98
 
99
99
  export default class TabBarItem extends React.PureComponent<TabBarItemProps> {
100
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
101
100
  render () {
102
101
  const {
103
102
  label,
@@ -107,13 +106,13 @@ export default class TabBarItem extends React.PureComponent<TabBarItemProps> {
107
106
  size = 20,
108
107
  labelColor,
109
108
  iconSource,
110
- userOptions,
109
+ tabOptions,
111
110
  tabStyle = {},
112
111
  labelStyle = {},
113
112
  allowFontScaling = true,
114
113
  showLabel = true
115
114
  } = this.props
116
- const tabBarBadgeStyle = userOptions?.tabBarBadgeStyle || {}
115
+ const tabBarBadgeStyle = tabOptions?.tabBarBadgeStyle || {}
117
116
  return (
118
117
  <View style={[styles.tabItem, styles.itemHorizontal, tabStyle]}>
119
118
  <View style={styles.icon}>