unicorn-demo-app 8.2.1 → 8.2.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, {Component} from 'react';
|
|
2
2
|
import {View, StyleSheet, Alert, ScrollView} from 'react-native';
|
|
3
|
-
import {Colors, Text, FloatingButton, FloatingButtonLayouts} from 'react-native-ui-lib';
|
|
3
|
+
import {Colors, Text, FloatingButton, FloatingButtonLayouts, Keyboard} from 'react-native-ui-lib';
|
|
4
4
|
import {renderBooleanOption} from '../ExampleScreenPresenter';
|
|
5
5
|
|
|
6
6
|
interface State {
|
|
@@ -8,6 +8,7 @@ interface State {
|
|
|
8
8
|
showPrimary: boolean;
|
|
9
9
|
showSecondary: boolean;
|
|
10
10
|
showVertical: boolean;
|
|
11
|
+
withTrackingView: boolean;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export default class FloatingButtonScreen extends Component<{}, State> {
|
|
@@ -16,7 +17,8 @@ export default class FloatingButtonScreen extends Component<{}, State> {
|
|
|
16
17
|
showPrimary: true,
|
|
17
18
|
showSecondary: true,
|
|
18
19
|
showVertical: true,
|
|
19
|
-
fullWidth: false
|
|
20
|
+
fullWidth: false,
|
|
21
|
+
withTrackingView: false
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
notNow = () => {
|
|
@@ -30,7 +32,8 @@ export default class FloatingButtonScreen extends Component<{}, State> {
|
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
render() {
|
|
33
|
-
const {showSecondary, showVertical} = this.state;
|
|
35
|
+
const {showSecondary, showVertical, withTrackingView} = this.state;
|
|
36
|
+
const Container = withTrackingView ? Keyboard.KeyboardTrackingView : React.Fragment;
|
|
34
37
|
return (
|
|
35
38
|
<View style={styles.container}>
|
|
36
39
|
<Text text60 center $textDefault marginB-s4>
|
|
@@ -41,6 +44,7 @@ export default class FloatingButtonScreen extends Component<{}, State> {
|
|
|
41
44
|
{renderBooleanOption.call(this, 'Show Primary Button', 'showPrimary')}
|
|
42
45
|
{renderBooleanOption.call(this, 'Show Secondary Button', 'showSecondary')}
|
|
43
46
|
{renderBooleanOption.call(this, 'Button Layout Vertical', 'showVertical')}
|
|
47
|
+
{renderBooleanOption.call(this, 'With tracking view', 'withTrackingView')}
|
|
44
48
|
|
|
45
49
|
<ScrollView showsVerticalScrollIndicator={false}>
|
|
46
50
|
<View paddingT-20>
|
|
@@ -67,30 +71,32 @@ export default class FloatingButtonScreen extends Component<{}, State> {
|
|
|
67
71
|
</View>
|
|
68
72
|
</ScrollView>
|
|
69
73
|
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
74
|
+
<Container>
|
|
75
|
+
<FloatingButton
|
|
76
|
+
visible={this.state.showButton}
|
|
77
|
+
fullWidth={this.state.fullWidth}
|
|
78
|
+
button={
|
|
79
|
+
this.state.showPrimary
|
|
80
|
+
? {
|
|
81
|
+
label: 'Approve',
|
|
82
|
+
onPress: this.close
|
|
83
|
+
}
|
|
84
|
+
: undefined
|
|
85
|
+
}
|
|
86
|
+
secondaryButton={
|
|
87
|
+
showSecondary
|
|
88
|
+
? {
|
|
89
|
+
label: 'Not now',
|
|
90
|
+
onPress: this.notNow
|
|
91
|
+
}
|
|
92
|
+
: undefined
|
|
93
|
+
}
|
|
94
|
+
buttonLayout={showVertical ? FloatingButtonLayouts.VERTICAL : FloatingButtonLayouts.HORIZONTAL}
|
|
95
|
+
// bottomMargin={80}
|
|
96
|
+
// hideBackgroundOverlay
|
|
97
|
+
// withoutAnimation
|
|
98
|
+
/>
|
|
99
|
+
</Container>
|
|
94
100
|
</View>
|
|
95
101
|
);
|
|
96
102
|
}
|