unicorn-demo-app 6.1.2 → 6.2.0
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 +1 -1
- package/src/index.js +5 -2
- package/src/screens/MenuStructure.js +1 -0
- package/src/screens/componentScreens/CarouselScreen.tsx +3 -3
- package/src/screens/componentScreens/IconScreen.tsx +43 -0
- package/src/screens/componentScreens/SectionsWheelPickerScreen.tsx +1 -0
- package/src/screens/componentScreens/index.js +1 -0
- package/src/screens/incubatorScreens/PanViewScreen.tsx +2 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -66,6 +66,9 @@ module.exports = {
|
|
|
66
66
|
get HintsScreen() {
|
|
67
67
|
return require('./screens/componentScreens/HintsScreen').default;
|
|
68
68
|
},
|
|
69
|
+
get IconScreen() {
|
|
70
|
+
return require('./screens/componentScreens/IconScreen').default;
|
|
71
|
+
},
|
|
69
72
|
get ImageScreen() {
|
|
70
73
|
return require('./screens/componentScreens/ImageScreen').default;
|
|
71
74
|
},
|
|
@@ -235,10 +238,10 @@ module.exports = {
|
|
|
235
238
|
return require('./screens/realExamples/ListActions/ListActionsScreen').default;
|
|
236
239
|
},
|
|
237
240
|
get ProductPage() {
|
|
238
|
-
return require('./screens/realExamples/ProductPage');
|
|
241
|
+
return require('./screens/realExamples/ProductPage').default;
|
|
239
242
|
},
|
|
240
243
|
get Twitter() {
|
|
241
|
-
return require('./screens/realExamples/Twitter');
|
|
244
|
+
return require('./screens/realExamples/Twitter').default;
|
|
242
245
|
},
|
|
243
246
|
// wrapperScreens
|
|
244
247
|
get TouchableOpacityScreen() {
|
|
@@ -33,6 +33,7 @@ export const navigationData = {
|
|
|
33
33
|
{title: 'Connection Status Bar', tags: 'connection status bar', screen: 'unicorn.components.ConnectionStatusBar'},
|
|
34
34
|
{title: 'Chip', tags: 'chip', screen: 'unicorn.components.ChipScreen'},
|
|
35
35
|
{title: 'ExpandableSection', tags: 'expandable section', screen: 'unicorn.components.ExpandableSectionScreen'},
|
|
36
|
+
{title: 'Icon', tags: 'image icon assets', screen: 'unicorn.components.IconScreen'},
|
|
36
37
|
// {title: 'Overlays', tags: 'overlay image', screen: 'unicorn.components.OverlaysScreen'},
|
|
37
38
|
{title: 'Page Control', tags: 'page', screen: 'unicorn.components.PageControlScreen'},
|
|
38
39
|
{title: 'ProgressBar', tags: 'progress bar animated', screen: 'unicorn.animations.ProgressBarScreen'},
|
|
@@ -36,6 +36,7 @@ interface State {
|
|
|
36
36
|
|
|
37
37
|
class CarouselScreen extends Component<Props, State> {
|
|
38
38
|
carousel = React.createRef<typeof Carousel>();
|
|
39
|
+
private dimensionsChangeListener: any;
|
|
39
40
|
|
|
40
41
|
constructor(props: Props) {
|
|
41
42
|
super(props);
|
|
@@ -51,11 +52,11 @@ class CarouselScreen extends Component<Props, State> {
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
componentDidMount() {
|
|
54
|
-
Constants.addDimensionsEventListener(this.onOrientationChange);
|
|
55
|
+
this.dimensionsChangeListener = Constants.addDimensionsEventListener(this.onOrientationChange);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
componentWillUnmount() {
|
|
58
|
-
Constants.removeDimensionsEventListener(this.onOrientationChange);
|
|
59
|
+
Constants.removeDimensionsEventListener(this.dimensionsChangeListener || this.onOrientationChange);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
onOrientationChange = () => {
|
|
@@ -116,7 +117,6 @@ class CarouselScreen extends Component<Props, State> {
|
|
|
116
117
|
pageControlProps={{onPagePress: this.onPagePress, limitShownPages}}
|
|
117
118
|
// showCounter
|
|
118
119
|
allowAccessibleLayout
|
|
119
|
-
loop
|
|
120
120
|
>
|
|
121
121
|
{_.map([...Array(numberOfPagesShown)], (item, index) => (
|
|
122
122
|
<Page style={{backgroundColor: BACKGROUND_COLORS[index]}} key={index}>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {Assets, View, Icon, Text, Slider, Switch, GradientSlider} from 'react-native-ui-lib';
|
|
3
|
+
|
|
4
|
+
const IconScreen = () => {
|
|
5
|
+
const [size, setSize] = useState(24);
|
|
6
|
+
const [customSize, setCustomSize] = useState(false);
|
|
7
|
+
const [color, setColor] = useState<string | number>();
|
|
8
|
+
const [customColor, setCustomColor] = useState(false);
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<View padding-page>
|
|
12
|
+
<Text h1 marginB-s4>
|
|
13
|
+
Icon Screen
|
|
14
|
+
</Text>
|
|
15
|
+
<View center>
|
|
16
|
+
<Icon
|
|
17
|
+
margin-30
|
|
18
|
+
size={customSize ? size : undefined}
|
|
19
|
+
tintColor={customColor ? color as string : undefined}
|
|
20
|
+
source={Assets.icons.search}
|
|
21
|
+
/>
|
|
22
|
+
</View>
|
|
23
|
+
|
|
24
|
+
<View marginB-s3 row>
|
|
25
|
+
<Text marginR-s2>Custom Size</Text>
|
|
26
|
+
<Switch value={customSize} onValueChange={setCustomSize}/>
|
|
27
|
+
</View>
|
|
28
|
+
<Slider maximumValue={100} value={24} step={1} onValueChange={setSize}/>
|
|
29
|
+
<Text marginB-50 marginT-s2>
|
|
30
|
+
Custom size: {size}
|
|
31
|
+
</Text>
|
|
32
|
+
|
|
33
|
+
<View marginB-s3 row>
|
|
34
|
+
<Text marginR-s2>Custom Color</Text>
|
|
35
|
+
<Switch value={customColor} onValueChange={setCustomColor}/>
|
|
36
|
+
</View>
|
|
37
|
+
<GradientSlider type={GradientSlider.types.HUE} color={color as string} onValueChange={setColor}/>
|
|
38
|
+
<Text marginT-s2>Custom color: {color || '#000000'}</Text>
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default IconScreen;
|
|
@@ -102,6 +102,7 @@ const SectionsWheelPickerScreen = () => {
|
|
|
102
102
|
<SegmentedControl
|
|
103
103
|
segments={[{label: '1 section'}, {label: '2 sections'}, {label: '3 sections'}]}
|
|
104
104
|
onChangeIndex={onChangeIndex}
|
|
105
|
+
throttleTime={400}
|
|
105
106
|
/>
|
|
106
107
|
<Text text50 marginV-20>
|
|
107
108
|
Pick a duration
|
|
@@ -20,6 +20,7 @@ export function registerScreens(registrar) {
|
|
|
20
20
|
registrar('unicorn.components.ChipsInputScreen', () => require('./ChipsInputScreen').default);
|
|
21
21
|
registrar('unicorn.components.HapticScreen', () => require('./HapticScreen').default);
|
|
22
22
|
registrar('unicorn.components.HintsScreen', () => require('./HintsScreen').default);
|
|
23
|
+
registrar('unicorn.components.IconScreen', () => require('./IconScreen').default);
|
|
23
24
|
registrar('unicorn.components.ImageScreen', () => require('./ImageScreen').default);
|
|
24
25
|
registrar('unicorn.components.ProgressiveImageScreen', () => require('./ProgressiveImageScreen').default);
|
|
25
26
|
registrar('unicorn.components.KeyboardAwareScrollViewScreen', () => require('./KeyboardAwareScrollViewScreen').default);
|
|
@@ -80,7 +80,7 @@ class PanViewScreen extends Component {
|
|
|
80
80
|
<PanView
|
|
81
81
|
directions={[PanView.directions.DOWN]}
|
|
82
82
|
dismissible
|
|
83
|
-
|
|
83
|
+
animateToOrigin
|
|
84
84
|
// threshold={{y: 10}}
|
|
85
85
|
containerStyle={styles.panView}
|
|
86
86
|
onDismiss={this.onDialogDismissed}
|
|
@@ -113,7 +113,7 @@ class PanViewScreen extends Component {
|
|
|
113
113
|
<PanView
|
|
114
114
|
directions={[PanView.directions.LEFT, PanView.directions.DOWN, PanView.directions.RIGHT]}
|
|
115
115
|
dismissible
|
|
116
|
-
|
|
116
|
+
animateToOrigin
|
|
117
117
|
directionLock
|
|
118
118
|
threshold={{y: 10}}
|
|
119
119
|
containerStyle={styles.panView}
|