@momo-kits/foundation 0.75.1-beta.10 → 0.75.1-beta.12

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.
package/Layout/Card.tsx CHANGED
@@ -115,20 +115,20 @@ const Card: React.FC<CardProps> = ({children, style}) => {
115
115
  return element;
116
116
  };
117
117
 
118
- const styles: any = style ?? {};
119
-
120
118
  return (
121
119
  <GridContext.Provider value={gridContext}>
122
120
  <View
123
121
  accessibilityLabel={`Card`}
124
- style={{
125
- ...styles,
126
- width: widthSection,
127
- marginHorizontal: gridContext.margin,
128
- padding: 12,
129
- flexDirection: 'row',
130
- flexWrap: 'wrap',
131
- }}>
122
+ style={[
123
+ style,
124
+ {
125
+ width: widthSection,
126
+ marginHorizontal: gridContext.margin,
127
+ padding: 12,
128
+ flexDirection: 'row',
129
+ flexWrap: 'wrap',
130
+ },
131
+ ]}>
132
132
  {renderView(validateChildren(children, [Item]))}
133
133
  {GRIDVIEW && renderOverlay()}
134
134
  </View>
package/Layout/Item.tsx CHANGED
@@ -33,22 +33,22 @@ const Item: React.FC<ItemProps> = ({
33
33
  );
34
34
  };
35
35
 
36
- const styles: any = style ?? {};
37
-
38
36
  return (
39
37
  <View
40
38
  accessibilityLabel={`Item`}
41
- style={{
42
- ...styles,
43
- width: grid.getSizeSpan(widthSpan),
44
- height: heightSpan ? grid.getSizeSpan(heightSpan) : undefined,
45
- overflow: 'hidden',
46
- margin: undefined,
47
- marginTop: undefined,
48
- marginBottom: undefined,
49
- marginLeft: undefined,
50
- marginRight: undefined,
51
- }}>
39
+ style={[
40
+ style,
41
+ {
42
+ width: grid.getSizeSpan(widthSpan),
43
+ height: heightSpan ? grid.getSizeSpan(heightSpan) : undefined,
44
+ overflow: 'hidden',
45
+ margin: undefined,
46
+ marginTop: undefined,
47
+ marginBottom: undefined,
48
+ marginLeft: undefined,
49
+ marginRight: undefined,
50
+ },
51
+ ]}>
52
52
  {children}
53
53
  {GRIDVIEW && renderOverlay()}
54
54
  </View>
@@ -21,12 +21,18 @@ const ScreenContainer: React.FC<ScreenContainerProps> = ({
21
21
  let marginHeader = 0;
22
22
  let handleScroll;
23
23
  let imageAnimatedStyle = {};
24
+ let opacity;
24
25
  let Component: any = View;
25
26
  if (scrollable) {
26
27
  Component = Animated.ScrollView;
27
28
  }
28
29
  if (scrollY) {
29
30
  marginHeader = useHeaderHeight();
31
+ opacity = scrollY?.interpolate({
32
+ inputRange: [0, 100],
33
+ outputRange: [1, 0],
34
+ extrapolate: 'clamp',
35
+ });
30
36
  imageAnimatedStyle = {
31
37
  transform: [
32
38
  {
@@ -80,6 +86,7 @@ const ScreenContainer: React.FC<ScreenContainerProps> = ({
80
86
  uri: headerBackground,
81
87
  }}
82
88
  style={{
89
+ opacity: opacity ?? 1,
83
90
  aspectRatio: 1.3,
84
91
  ...imageAnimatedStyle,
85
92
  }}
@@ -5,15 +5,16 @@ import {Icon} from '../Icon';
5
5
 
6
6
  const Tab = createBottomTabNavigator();
7
7
 
8
- const BottomTab: FC<BottomTabProps> = ({tabs}) => {
8
+ const BottomTab: FC<BottomTabProps> = ({tabs, listeners}) => {
9
9
  return (
10
10
  <Tab.Navigator>
11
11
  {tabs.map((item, index) => {
12
12
  return (
13
13
  <Tab.Screen
14
- key={`${item.label}-${index}`}
15
- name={item.label}
14
+ key={item.name}
15
+ name={item.name}
16
16
  component={item.screen}
17
+ listeners={listeners}
17
18
  options={{
18
19
  tabBarLabel: item.label,
19
20
  tabBarBadge: item?.badgeLabel,
@@ -82,7 +82,9 @@ const HeaderTitle: React.FC<any> = props => {
82
82
  return (
83
83
  <Animated.Text
84
84
  {...props}
85
- accessibilityLabel={`HeaderTitle/${props.children}`}
85
+ accessibilityLabel={`accessibilityLabel/HeaderTitle/${props.children}`}
86
+ testID={`testID/HeaderTitle/${props.children}`}
87
+ nativeID={`nativeID/HeaderTitle/${props.children}`}
86
88
  style={[
87
89
  styles.title,
88
90
  {fontFamily: `${theme.font}-Bold`, opacity, color: props.tintColor},
@@ -339,7 +341,8 @@ const HeaderToolkitAction: React.FC<any> = ({tintColor}) => {
339
341
  </TouchableOpacity>
340
342
  <View style={[styles.divider, {backgroundColor: tintColor}]} />
341
343
  <TouchableOpacity
342
- accessibilityLabel={'Toolkit/Close'}
344
+ accessibilityLabel={`accessibilityLabel/Toolkit/Close`}
345
+ testID={`testID/HeaderTitle/Toolkit/Close`}
343
346
  onPress={onClose}>
344
347
  <Icon
345
348
  color={tintColor}
@@ -2,6 +2,7 @@ import {Animated, ScrollViewProps, ViewProps} from 'react-native';
2
2
  import React from 'react';
3
3
  import Navigator from './Navigator';
4
4
  import {PopupNotifyProps} from '../Popup/types';
5
+ import {ScreenListeners} from '@react-navigation/core/lib/typescript/src/types';
5
6
 
6
7
  export type Theme = {
7
8
  dark: boolean;
@@ -146,6 +147,7 @@ export type HeaderToolkitProps = {
146
147
  };
147
148
 
148
149
  export type BottomTabItemProps = {
150
+ name: string;
149
151
  label: string;
150
152
  icon: string;
151
153
  showDot?: boolean;
@@ -155,4 +157,8 @@ export type BottomTabItemProps = {
155
157
 
156
158
  export type BottomTabProps = {
157
159
  tabs: BottomTabItemProps[];
160
+ listeners: {
161
+ tabPress?: any;
162
+ focus?: any;
163
+ };
158
164
  };
@@ -26,7 +26,7 @@ const getTintColor = (theme: Theme): any => {
26
26
 
27
27
  const getStackOptions = (theme: Theme): StackNavigationOptions => {
28
28
  return {
29
- headerTitleAlign: 'center',
29
+ headerTitleAlign: 'left',
30
30
  headerTitle: HeaderTitle,
31
31
  headerBackground: HeaderBackground,
32
32
  headerLeft: (props: any) => <HeaderLeft {...props} />,
@@ -37,7 +37,7 @@ const getStackOptions = (theme: Theme): StackNavigationOptions => {
37
37
 
38
38
  const getDialogOptions = (theme: Theme): StackNavigationOptions => {
39
39
  return {
40
- headerTitleAlign: 'center',
40
+ headerTitleAlign: 'left',
41
41
  headerTitle: HeaderTitle,
42
42
  headerLeft: (props: any) => <HeaderLeft {...props} />,
43
43
  headerBackground: HeaderBackground,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.75.1-beta.10",
3
+ "version": "0.75.1-beta.12",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -38,4 +38,4 @@
38
38
  },
39
39
  "author": "@momo-kits/foundation",
40
40
  "license": "ISC"
41
- }
41
+ }