unicorn-demo-app 6.2.0-snapshot.1908 → 6.2.1
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
|
@@ -3,6 +3,7 @@ import React, {Component} from 'react';
|
|
|
3
3
|
import {Alert} from 'react-native';
|
|
4
4
|
import {Colors, View, Text, Hint, Button, RadioGroup, RadioButton, Switch} from 'react-native-ui-lib';
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
const settingsIcon = require('../../assets/icons/settings.png');
|
|
7
8
|
const reactions = ['❤️', '😮', '😔', '😂', '😡'];
|
|
8
9
|
|
|
@@ -17,7 +18,7 @@ type HintScreenState = {
|
|
|
17
18
|
useSideTip?: boolean;
|
|
18
19
|
showCustomContent?: boolean;
|
|
19
20
|
showReactionStrip?: boolean;
|
|
20
|
-
enableShadow?: boolean
|
|
21
|
+
enableShadow?: boolean
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export default class HintsScreen extends Component<HintScreenProps, HintScreenState> {
|
|
@@ -46,11 +47,11 @@ export default class HintsScreen extends Component<HintScreenProps, HintScreenSt
|
|
|
46
47
|
|
|
47
48
|
onHintPressed = () => {
|
|
48
49
|
Alert.alert('Hint Pressed');
|
|
49
|
-
}
|
|
50
|
+
}
|
|
50
51
|
|
|
51
52
|
onReactionPress = () => {
|
|
52
53
|
Alert.alert('Reaction button pressed');
|
|
53
|
-
}
|
|
54
|
+
}
|
|
54
55
|
|
|
55
56
|
renderCustomContent() {
|
|
56
57
|
return (
|
|
@@ -88,9 +89,9 @@ export default class HintsScreen extends Component<HintScreenProps, HintScreenSt
|
|
|
88
89
|
enableShadow
|
|
89
90
|
} = this.state;
|
|
90
91
|
const targetFrame = {x: 140, y: 100, width: 10, height: 10};
|
|
91
|
-
const message = useShortMessage
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
const message = useShortMessage ?
|
|
93
|
+
'Add other cool and useful stuff.' :
|
|
94
|
+
'Add other cool and useful stuff through adding apps to your visitors to enjoy.';
|
|
94
95
|
|
|
95
96
|
return (
|
|
96
97
|
<View flex>
|
|
@@ -128,11 +129,8 @@ export default class HintsScreen extends Component<HintScreenProps, HintScreenSt
|
|
|
128
129
|
// edgeMargins={30}
|
|
129
130
|
// onBackgroundPress={() => this.setState({showHint: !showHint})}
|
|
130
131
|
customContent={
|
|
131
|
-
showCustomContent
|
|
132
|
-
? this.
|
|
133
|
-
: showReactionStrip
|
|
134
|
-
? this.renderReactionStrip()
|
|
135
|
-
: undefined
|
|
132
|
+
showCustomContent ?
|
|
133
|
+
this.renderCustomContent() : showReactionStrip ? this.renderReactionStrip() : undefined
|
|
136
134
|
}
|
|
137
135
|
color={!showCustomContent && showReactionStrip ? Colors.white : undefined}
|
|
138
136
|
removePaddings={!showCustomContent && showReactionStrip}
|
|
@@ -222,8 +220,8 @@ export default class HintsScreen extends Component<HintScreenProps, HintScreenSt
|
|
|
222
220
|
</View>
|
|
223
221
|
|
|
224
222
|
<View row centerV marginV-10>
|
|
225
|
-
<Switch
|
|
226
|
-
value={showReactionStrip}
|
|
223
|
+
<Switch
|
|
224
|
+
value={showReactionStrip}
|
|
227
225
|
onValueChange={value => this.setState({showReactionStrip: value, enableShadow: true})}
|
|
228
226
|
/>
|
|
229
227
|
<Text marginL-10>Show reaction strip</Text>
|
|
@@ -14,7 +14,6 @@ interface State {
|
|
|
14
14
|
asCarousel: boolean;
|
|
15
15
|
centerSelected: boolean;
|
|
16
16
|
fewItems: boolean;
|
|
17
|
-
initialIndex: number;
|
|
18
17
|
selectedIndex: number;
|
|
19
18
|
key: string | number;
|
|
20
19
|
items: TabControllerItemProps[];
|
|
@@ -27,7 +26,6 @@ class TabControllerScreen extends Component<{}, State> {
|
|
|
27
26
|
asCarousel: true,
|
|
28
27
|
centerSelected: false,
|
|
29
28
|
fewItems: false,
|
|
30
|
-
initialIndex: 0,
|
|
31
29
|
selectedIndex: 0,
|
|
32
30
|
key: Date.now(),
|
|
33
31
|
items: []
|
|
@@ -148,14 +146,14 @@ class TabControllerScreen extends Component<{}, State> {
|
|
|
148
146
|
}
|
|
149
147
|
|
|
150
148
|
render() {
|
|
151
|
-
const {key,
|
|
149
|
+
const {key, /* selectedIndex, */ asCarousel, centerSelected, fewItems, items} = this.state;
|
|
152
150
|
return (
|
|
153
151
|
<View flex bg-grey70>
|
|
154
152
|
<TabController
|
|
155
153
|
key={key}
|
|
156
154
|
asCarousel={asCarousel}
|
|
157
155
|
// selectedIndex={selectedIndex}
|
|
158
|
-
initialIndex={
|
|
156
|
+
initialIndex={0}
|
|
159
157
|
onChangeIndex={this.onChangeIndex}
|
|
160
158
|
items={items}
|
|
161
159
|
>
|
|
@@ -16,6 +16,26 @@ class TouchableOpacityScreen extends Component {
|
|
|
16
16
|
this.setState({longPressCounter: this.state.longPressCounter + 1});
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
renderExample(title, props) {
|
|
20
|
+
return (
|
|
21
|
+
<View row marginT-20 centerV>
|
|
22
|
+
<Text text70 marginR-20>
|
|
23
|
+
{title}
|
|
24
|
+
</Text>
|
|
25
|
+
<Incubator.TouchableOpacity
|
|
26
|
+
onPress={this.onPress}
|
|
27
|
+
onLongPress={this.onLongPress}
|
|
28
|
+
backgroundColor={Colors.blue30}
|
|
29
|
+
style={{alignItems: 'center', paddingHorizontal: 20, paddingVertical: 8, borderRadius: 50}}
|
|
30
|
+
activeOpacity={1}
|
|
31
|
+
{...props}
|
|
32
|
+
>
|
|
33
|
+
<Text white>Button</Text>
|
|
34
|
+
</Incubator.TouchableOpacity>
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
19
39
|
renderRNTouchableExample = () => {
|
|
20
40
|
return (
|
|
21
41
|
<View row centerV marginT-20>
|
|
@@ -47,7 +67,11 @@ class TouchableOpacityScreen extends Component {
|
|
|
47
67
|
LONG PRESS COUNTER: {longPressCounter}
|
|
48
68
|
</Text>
|
|
49
69
|
|
|
50
|
-
|
|
70
|
+
{this.renderExample('feedbackColor', {backgroundColor: Colors.red30, feedbackColor: Colors.red10})}
|
|
71
|
+
{this.renderExample('activeScale', {activeScale: 0.95})}
|
|
72
|
+
{this.renderExample('activeOpacity', {activeOpacity: 0.6})}
|
|
73
|
+
|
|
74
|
+
<Incubator.TouchableOpacity2
|
|
51
75
|
marginT-20
|
|
52
76
|
onPress={this.onPress}
|
|
53
77
|
onLongPress={this.onLongPress}
|
|
@@ -57,9 +81,9 @@ class TouchableOpacityScreen extends Component {
|
|
|
57
81
|
activeOpacity={1}
|
|
58
82
|
activeScale={0.98}
|
|
59
83
|
>
|
|
60
|
-
<Text white>
|
|
61
|
-
</Incubator.
|
|
62
|
-
<Incubator.
|
|
84
|
+
<Text white>TouchableOpacity2</Text>
|
|
85
|
+
</Incubator.TouchableOpacity2>
|
|
86
|
+
<Incubator.TouchableOpacity2
|
|
63
87
|
marginT-20
|
|
64
88
|
paddingH-20
|
|
65
89
|
paddingV-8
|
|
@@ -71,8 +95,8 @@ class TouchableOpacityScreen extends Component {
|
|
|
71
95
|
activeOpacity={1}
|
|
72
96
|
activeScale={0.98}
|
|
73
97
|
>
|
|
74
|
-
<Text white>
|
|
75
|
-
</Incubator.
|
|
98
|
+
<Text white>TouchableOpacity2 (without LongPress)</Text>
|
|
99
|
+
</Incubator.TouchableOpacity2>
|
|
76
100
|
{this.renderRNTouchableExample()}
|
|
77
101
|
</View>
|
|
78
102
|
);
|