unicorn-demo-app 6.2.0-snapshot.1908 → 7.0.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 +2 -2
- package/scripts/{jenkinsRelease.js → bkRelease.js} +32 -22
- package/src/screens/componentScreens/CarouselScreen.tsx +1 -0
- package/src/screens/componentScreens/HintsScreen.tsx +11 -13
- package/src/screens/componentScreens/TabControllerScreen/index.tsx +2 -4
- package/src/screens/incubatorScreens/TouchableOpacityScreen.js +30 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unicorn-demo-app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"author": "Ethan Sharabi <ethan.shar@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"release": "node ./scripts/release.js",
|
|
16
|
-
"
|
|
16
|
+
"bkRelease": "node ./scripts/bkRelease.js"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"react-native-ui-lib": "*",
|
|
@@ -2,12 +2,22 @@ const exec = require('shell-utils').exec;
|
|
|
2
2
|
const semver = require('semver');
|
|
3
3
|
const _ = require('lodash');
|
|
4
4
|
const p = require('path');
|
|
5
|
+
const cp = require('child_process');
|
|
5
6
|
|
|
6
7
|
// Workaround JS
|
|
7
|
-
const isRelease = process.env.RELEASE_BUILD === 'true';
|
|
8
|
-
const branch = process.env.BRANCH;
|
|
9
8
|
|
|
10
|
-
const
|
|
9
|
+
const isRelease = process.env.BUILDKITE_MESSAGE.match(/^release$/i);
|
|
10
|
+
let VERSION;
|
|
11
|
+
if (isRelease) {
|
|
12
|
+
VERSION = cp.execSync(`buildkite-agent meta-data get version`).toString();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// const isRelease = process.env.RELEASE_BUILD === 'true';
|
|
18
|
+
// const branch = process.env.BRANCH;
|
|
19
|
+
|
|
20
|
+
// const ONLY_ON_BRANCH = `origin/${branch || 'master'}`;
|
|
11
21
|
const VERSION_TAG = isRelease ? 'latest' : 'snapshot';
|
|
12
22
|
const VERSION_INC = 'patch';
|
|
13
23
|
|
|
@@ -15,37 +25,37 @@ function run() {
|
|
|
15
25
|
if (!validateEnv()) {
|
|
16
26
|
return;
|
|
17
27
|
}
|
|
18
|
-
setupGit();
|
|
28
|
+
// setupGit();
|
|
19
29
|
createNpmRc();
|
|
20
30
|
versionTagAndPublish();
|
|
21
31
|
}
|
|
22
32
|
|
|
23
33
|
function validateEnv() {
|
|
24
|
-
if (!process.env.
|
|
34
|
+
if (!process.env.CI) {
|
|
25
35
|
throw new Error('releasing is only available from CI');
|
|
26
36
|
}
|
|
27
37
|
|
|
28
|
-
if (!process.env.JENKINS_MASTER) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
38
|
+
// if (!process.env.JENKINS_MASTER) {
|
|
39
|
+
// console.log('not publishing on a different build');
|
|
40
|
+
// return false;
|
|
41
|
+
// }
|
|
32
42
|
|
|
33
|
-
if (process.env.GIT_BRANCH !== ONLY_ON_BRANCH) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
43
|
+
// if (process.env.GIT_BRANCH !== ONLY_ON_BRANCH) {
|
|
44
|
+
// console.log(`not publishing on branch ${process.env.GIT_BRANCH}`);
|
|
45
|
+
// return false;
|
|
46
|
+
// }
|
|
37
47
|
|
|
38
48
|
return true;
|
|
39
49
|
}
|
|
40
50
|
|
|
41
|
-
function setupGit() {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
51
|
+
// function setupGit() {
|
|
52
|
+
// exec.execSyncSilent('git config --global push.default simple');
|
|
53
|
+
// exec.execSyncSilent(`git config --global user.email "${process.env.GIT_EMAIL}"`);
|
|
54
|
+
// exec.execSyncSilent(`git config --global user.name "${process.env.GIT_USER}"`);
|
|
55
|
+
// const remoteUrl = new RegExp('https?://(\\S+)').exec(exec.execSyncRead('git remote -v'))[1];
|
|
56
|
+
// exec.execSyncSilent(`git remote add deploy "https://${process.env.GIT_USER}:${process.env.GIT_TOKEN}@${remoteUrl}"`);
|
|
57
|
+
// // exec.execSync(`git checkout ${ONLY_ON_BRANCH}`);
|
|
58
|
+
// }
|
|
49
59
|
|
|
50
60
|
function createNpmRc() {
|
|
51
61
|
exec.execSync('rm -f package-lock.json');
|
|
@@ -57,7 +67,7 @@ function versionTagAndPublish() {
|
|
|
57
67
|
const currentPublished = findCurrentPublishedVersion();
|
|
58
68
|
console.log(`current published version: ${currentPublished}`);
|
|
59
69
|
|
|
60
|
-
const version = isRelease ?
|
|
70
|
+
const version = isRelease ? VERSION : `${currentPublished}-snapshot.${process.env.BUILDKITE_BUILD_NUMBER}`;
|
|
61
71
|
console.log(`Publishing version: ${version}`);
|
|
62
72
|
|
|
63
73
|
tryPublishAndTag(version);
|
|
@@ -117,6 +117,7 @@ class CarouselScreen extends Component<Props, State> {
|
|
|
117
117
|
pageControlProps={{onPagePress: this.onPagePress, limitShownPages}}
|
|
118
118
|
// showCounter
|
|
119
119
|
allowAccessibleLayout
|
|
120
|
+
loop
|
|
120
121
|
>
|
|
121
122
|
{_.map([...Array(numberOfPagesShown)], (item, index) => (
|
|
122
123
|
<Page style={{backgroundColor: BACKGROUND_COLORS[index]}} key={index}>
|
|
@@ -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
|
);
|