unicorn-demo-app 7.28.0 → 7.29.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unicorn-demo-app",
3
- "version": "7.28.0",
3
+ "version": "7.29.0",
4
4
  "main": "src/index.js",
5
5
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
6
6
  "license": "MIT",
@@ -18,7 +18,8 @@ const segments: Record<string, Array<SegmentedControlItemProps>> = {
18
18
  fifth: [{label: 'Full'}, {label: 'Width'}],
19
19
  sixth: [{label: 'Full'}, {label: 'Width'}, {label: 'With'}, {label: 'A'}, {label: 'Very Long Segment'}],
20
20
  seventh: [{label: '$'}, {label: '%'}],
21
- eighth: [{label: 'Plus', iconSource: Assets.icons.plusSmall}, {label: 'Minus', iconSource: Assets.icons.minusSmall}, {label: 'Check', iconSource: Assets.icons.checkSmall}]
21
+ eighth: [{label: 'Plus', iconSource: Assets.icons.plusSmall}, {label: 'Minus', iconSource: Assets.icons.minusSmall}, {label: 'Check', iconSource: Assets.icons.checkSmall}],
22
+ ninth: [{label: 'with'}, {label: 'a'}, {label: 'label'}]
22
23
  };
23
24
 
24
25
  const SegmentedControlScreen = () => {
@@ -87,6 +88,15 @@ const SegmentedControlScreen = () => {
87
88
  style={styles.customStyle}
88
89
  segmentsStyle={styles.customSegmentsStyle}
89
90
  />
91
+ <Text marginT-s4 center>
92
+ With a label
93
+ </Text>
94
+ <SegmentedControl
95
+ containerStyle={styles.container}
96
+ segments={segments.ninth}
97
+ preset={screenPreset}
98
+ label="Control label"
99
+ />
90
100
  </View>
91
101
  </View>
92
102
  );
@@ -3,7 +3,6 @@ import React, {Component} from 'react';
3
3
  import {ScrollView} from 'react-native';
4
4
  import {Colors, View, Text, Button, StackAggregator} from 'react-native-ui-lib';
5
5
 
6
-
7
6
  const TEXTS = [
8
7
  'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
9
8
  'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
@@ -12,28 +11,28 @@ const TEXTS = [
12
11
  ];
13
12
 
14
13
  export default class StackAggregatorScreen extends Component {
15
- state = {
14
+ state = {
16
15
  contents: TEXTS,
17
16
  collapsed: true
18
17
  };
19
18
 
20
19
  onItemPress = (index: number) => {
21
20
  console.warn('item pressed: ', index);
22
- }
21
+ };
23
22
 
24
23
  onPress = (index: number) => {
25
24
  console.warn('item\'s button pressed: ', index);
26
- }
25
+ };
27
26
 
28
27
  refreshItems = () => {
29
28
  const newItems = _.clone(this.state.contents);
30
29
  newItems.push('New Item');
31
30
  this.setState({contents: newItems});
32
- }
31
+ };
33
32
 
34
33
  toggleCollapsed = () => {
35
34
  this.setState({collapsed: !this.state.collapsed});
36
- }
35
+ };
37
36
 
38
37
  renderItem = (_: string, index: number) => {
39
38
  return (
@@ -42,7 +41,7 @@ export default class StackAggregatorScreen extends Component {
42
41
  <Text>{this.state.contents[index]}</Text>
43
42
  </View>
44
43
  );
45
- }
44
+ };
46
45
 
47
46
  render() {
48
47
  const {collapsed} = this.state;
@@ -53,18 +52,18 @@ export default class StackAggregatorScreen extends Component {
53
52
  <Button link label={collapsed ? 'Open Stack' : 'Close Stack'} onPress={this.toggleCollapsed}/>
54
53
  <Button link label="Update content" onPress={this.refreshItems}/>
55
54
  </View>
56
- <Text center grey40 text90 marginT-20>Thu, 10 Dec, 11:29</Text>
57
- <StackAggregator
58
- containerStyle={{marginTop: 12}}
59
- onItemPress={this.onItemPress}
60
- collapsed={collapsed}
61
- >
55
+ <Text center grey40 text90 marginT-20>
56
+ Thu, 10 Dec, 11:29
57
+ </Text>
58
+ <StackAggregator containerStyle={{marginTop: 12}} onItemPress={this.onItemPress} collapsed={collapsed}>
62
59
  {_.map(this.state.contents, (item, index) => {
63
60
  return this.renderItem(item, index);
64
61
  })}
65
62
  </StackAggregator>
66
63
 
67
- <Text center grey40 text90 marginT-20>Thu, 11 Dec, 13:03</Text>
64
+ <Text center grey40 text90 marginT-20>
65
+ Thu, 11 Dec, 13:03
66
+ </Text>
68
67
  <StackAggregator
69
68
  containerStyle={{marginTop: 12}}
70
69
  onItemPress={this.onItemPress}