secullum-react-native-ui 4.15.1 → 4.15.2-beta.2

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.
@@ -14,6 +14,7 @@ export interface DetailsLine {
14
14
  }
15
15
  export interface DetailsProperties {
16
16
  title: string;
17
+ titleNativeId?: string;
17
18
  lines: Array<DetailsLine>;
18
19
  lineTitleStyle?: StyleProp<TextStyle>;
19
20
  lineValueStyle?: StyleProp<TextStyle>;
@@ -84,12 +84,12 @@ class Details extends React.Component {
84
84
  };
85
85
  }
86
86
  render() {
87
- const { title, lines } = this.props;
87
+ const { title, lines, titleNativeId } = this.props;
88
88
  const styles = this.getStyles();
89
89
  return (React.createElement(React.Fragment, null,
90
90
  React.createElement(Card_1.Card, null,
91
91
  React.createElement(Card_1.Card.Section, null,
92
- React.createElement(react_native_1.Text, { style: styles.title }, title))),
92
+ React.createElement(react_native_1.Text, { nativeID: titleNativeId, testID: (0, test_1.getTestID)(titleNativeId), style: styles.title }, title))),
93
93
  lines.map(this.renderLine)));
94
94
  }
95
95
  }
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { NativeEventSubscription } from 'react-native';
2
3
  import DrawerLayout from 'react-native-drawer-layout';
3
4
  import { MenuProperties } from './Menu';
4
5
  export declare type MenuMobileProperties = MenuProperties & {
@@ -12,6 +13,7 @@ export interface MenuMobileState {
12
13
  }
13
14
  export declare class MenuMobile extends React.Component<MenuMobileProperties, MenuMobileState> {
14
15
  state: MenuMobileState;
16
+ backButtonHandlerSubscription: NativeEventSubscription | null;
15
17
  drawer: DrawerLayout | null;
16
18
  componentDidMount(): void;
17
19
  componentWillUnmount(): void;
@@ -13,6 +13,7 @@ class MenuMobile extends React.Component {
13
13
  this.state = {
14
14
  opened: false
15
15
  };
16
+ this.backButtonHandlerSubscription = null;
16
17
  this.drawer = null;
17
18
  this.handleBackButton = () => {
18
19
  if (this.state.opened) {
@@ -73,10 +74,12 @@ class MenuMobile extends React.Component {
73
74
  };
74
75
  }
75
76
  componentDidMount() {
76
- react_native_1.BackHandler.addEventListener('hardwareBackPress', this.handleBackButton);
77
+ this.backButtonHandlerSubscription = react_native_1.BackHandler.addEventListener('hardwareBackPress', this.handleBackButton);
77
78
  }
78
79
  componentWillUnmount() {
79
- react_native_1.BackHandler.removeEventListener('hardwareBackPress', this.handleBackButton);
80
+ if (this.backButtonHandlerSubscription) {
81
+ this.backButtonHandlerSubscription.remove();
82
+ }
80
83
  }
81
84
  render() {
82
85
  const theme = (0, theme_1.getTheme)();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secullum-react-native-ui",
3
- "version": "4.15.1",
3
+ "version": "4.15.2-beta.2",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "files": [