Skip to content

Commit 3aa246d

Browse files
committed
Merge branch 'master' into release
2 parents 67bb209 + cebae6c commit 3aa246d

File tree

116 files changed

+642
-4012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+642
-4012
lines changed

demo/src/index.js

+3-12
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,15 @@ module.exports = {
130130
return require('./screens/componentScreens/TextScreen').default;
131131
},
132132
// TODO: fix Expo issues (navigation) before un-commenting
133-
// get TextFieldScreen() {
134-
// return require('./screens/componentScreens/TextFieldScreen').default;
135-
// },
133+
get TextFieldScreen() {
134+
return require('./screens/componentScreens/TextFieldScreen').default;
135+
},
136136
get TourScreen() {
137137
return require('./screens/componentScreens/TourScreen').default;
138138
},
139139
get FeatureHighlightScreen() {
140140
return require('./screens/componentScreens/FeatureHighlightScreen').default;
141141
},
142-
get WheelPickerDialogScreen() {
143-
return require('./screens/componentScreens/WheelPickerDialogScreen').default;
144-
},
145142
get SliderScreen() {
146143
return require('./screens/componentScreens/SliderScreen').default;
147144
},
@@ -173,9 +170,6 @@ module.exports = {
173170
get SafeAreaSpacerViewScreen() {
174171
return require('./screens/nativeComponentScreens/SafeAreaSpacerViewScreen').default;
175172
},
176-
get WheelPickerViewScreen() {
177-
return require('./screens/nativeComponentScreens/WheelPickerViewScreen').default;
178-
},
179173
// Full Screen components
180174
get EmptyStateScreen() {
181175
return require('./screens/componentScreens/EmptyStateScreen').default;
@@ -221,9 +215,6 @@ module.exports = {
221215
return require('./screens/componentScreens/ProgressBarScreen').default;
222216
},
223217
// Incubator
224-
get IncubatorTextFieldScreen() {
225-
return require('./screens/incubatorScreens/IncubatorTextFieldScreen').default;
226-
},
227218
get PanViewScreen() {
228219
return require('./screens/incubatorScreens/PanViewScreen').default;
229220
},

demo/src/screens/MenuStructure.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export const navigationData = {
4343
screen: 'unicorn.components.SharedTransitionScreen'
4444
},
4545
{title: 'Stack Aggregator', tags: 'stack aggregator', screen: 'unicorn.components.StackAggregatorScreen'},
46-
{title: 'Wheel Picker Dialog', tags: 'wheel picker dialog', screen: 'unicorn.components.WheelPickerDialogScreen'},
4746
{title: 'Marquee', tags: 'sliding text', screen: 'unicorn.components.MarqueeScreen'}
4847
]
4948
},
@@ -71,8 +70,12 @@ export const navigationData = {
7170
{title: 'Stepper', tags: 'stepper form', screen: 'unicorn.components.StepperScreen'},
7271
{title: 'Slider', tags: 'slider', screen: 'unicorn.components.SliderScreen'},
7372
{title: 'Switch', tags: 'switch toggle', screen: 'unicorn.components.SwitchScreen'},
74-
{title: 'ChipsInput', tags: 'chips tags input form', screen: 'unicorn.components.ChipsInputScreen'},
75-
{title: 'Masked Inputs', tags: 'text input form mask', screen: 'unicorn.components.MaskedInputScreen'}
73+
{title: 'Masked Inputs', tags: 'text input form mask', screen: 'unicorn.components.MaskedInputScreen'},
74+
{
75+
title: 'WheelPicker',
76+
tags: 'wheel picker spinner',
77+
screen: 'unicorn.components.WheelPickerScreen'
78+
}
7679
]
7780
},
7881
Overlays: {
@@ -141,7 +144,6 @@ export const navigationData = {
141144
tags: 'native overlay',
142145
screen: 'unicorn.nativeComponents.HighlightOverlayViewScreen'
143146
},
144-
{title: 'Wheel Picker', tags: 'wheel picker', screen: 'unicorn.nativeComponents.WheelPickerViewScreen'},
145147
{title: 'SafeArea Spacer', tags: 'native safe area', screen: 'unicorn.nativeComponents.SafeAreaSpacerViewScreen'},
146148
{
147149
title: 'KeyboardTracking (iOS)',
@@ -175,21 +177,15 @@ export const navigationData = {
175177
title: 'Incubator (Experimental)',
176178
screens: [
177179
{title: 'Calendar', tags: 'calendar', screen: 'unicorn.components.IncubatorCalendarScreen'},
178-
{title: 'ChipsInput (New)', tags: 'chips input', screen: 'unicorn.components.IncubatorChipsInputScreen'},
180+
{title: 'ChipsInput', tags: 'chips input', screen: 'unicorn.components.ChipsInputScreen'},
179181
{title: 'Native TouchableOpacity', tags: 'touchable native', screen: 'unicorn.incubator.TouchableOpacityScreen'},
180182
{title: 'Dialog (New)', tags: 'dialog modal popup alert', screen: 'unicorn.incubator.IncubatorDialogScreen'},
181-
{title: 'TextField (New)', tags: 'text field input', screen: 'unicorn.components.IncubatorTextFieldScreen'},
182183
{title: 'Toast (New)', tags: 'toast', screen: 'unicorn.components.IncubatorToastScreen'},
183184
{
184185
title: 'ExpandableOverlay',
185186
tags: 'text field expandable input picker',
186187
screen: 'unicorn.components.IncubatorExpandableOverlayScreen'
187188
},
188-
{
189-
title: 'WheelPicker (Incubator)',
190-
tags: 'wheel picker spinner experimental',
191-
screen: 'unicorn.incubator.WheelPickerScreen'
192-
},
193189
{title: 'Pan View', tags: 'pan swipe drag', screen: 'unicorn.incubator.PanViewScreen'}
194190
]
195191
},

demo/src/screens/componentScreens/ChipScreen.tsx

+2-60
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import _ from 'lodash';
21
import React, {Component} from 'react';
32
import {Alert} from 'react-native';
4-
import {Chip, Colors, Spacings, Text, Typography, View, Incubator, WheelPickerDialog, Image} from 'react-native-ui-lib';
3+
import {Chip, Colors, Spacings, Text, Typography, View, Image} from 'react-native-ui-lib';
54

65
const avatarImage = {
76
uri: 'https://randomuser.me/api/portraits/women/24.jpg'
@@ -20,64 +19,9 @@ export default class ChipScreen extends Component {
2019
];
2120

2221
state = {
23-
showDialog: false,
2422
selectedValue: this.colors[2].label
2523
};
2624

27-
toggleDialog = (showDialog: boolean) => {
28-
this.setState({showDialog});
29-
};
30-
31-
openDialog = () => {
32-
this.toggleDialog(true);
33-
};
34-
35-
closeDialog = () => {
36-
this.toggleDialog(false);
37-
};
38-
39-
onSelect = (itemValue: string) => {
40-
const values = _.filter(this.colors, {value: itemValue});
41-
if (values.length > 0) {
42-
this.setState({selectedValue: values[0].label});
43-
}
44-
this.closeDialog();
45-
};
46-
47-
renderItem = ({item: color}) => {
48-
return (
49-
<Text text50 margin-20 color={color.value}>
50-
{color.label}
51-
</Text>
52-
);
53-
};
54-
55-
renderContent = () => {
56-
const {selectedValue} = this.state;
57-
58-
return (
59-
<WheelPickerDialog
60-
items={this.colors}
61-
selectedValue={selectedValue}
62-
onSelect={this.onSelect}
63-
onCancel={this.closeDialog}
64-
wheelPickerProps={{
65-
style: {width: 200}
66-
}}
67-
/>
68-
);
69-
};
70-
71-
renderPickerDialog = () => {
72-
const {showDialog} = this.state;
73-
74-
return (
75-
<Incubator.Dialog visible={showDialog} useSafeArea bottom onDismiss={this.closeDialog}>
76-
{this.renderContent()}
77-
</Incubator.Dialog>
78-
);
79-
};
80-
8125
renderExample = (text: string, chip: JSX.Element) => {
8226
return (
8327
<View row spread marginB-12>
@@ -90,7 +34,6 @@ export default class ChipScreen extends Component {
9034
render() {
9135
return (
9236
<View style={{padding: 20}}>
93-
{this.renderPickerDialog()}
9437
<Text marginB-20 text40 $textDefault>
9538
Chip
9639
</Text>
@@ -120,12 +63,11 @@ export default class ChipScreen extends Component {
12063
iconStyle={{width: 24, height: 24}}
12164
iconProps={{tintColor: Colors.$iconDefault}}
12265
/>)}
123-
{this.renderExample('Right icon + onPress + dynamic label',
66+
{this.renderExample('Right icon',
12467
<Chip
12568
label={this.state.selectedValue}
12669
rightIconSource={chevron}
12770
iconStyle={{margin: 8}}
128-
onPress={this.openDialog}
12971
/>)}
13072
{this.renderExample('Label + Avatar', <Chip label={'Chip'} avatarProps={{source: avatarImage, size: 20}}/>)}
13173
{this.renderExample('Label + Counter',

0 commit comments

Comments
 (0)