Skip to content

V7 remove native WheelPicker #2475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions demo/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ module.exports = {
get FeatureHighlightScreen() {
return require('./screens/componentScreens/FeatureHighlightScreen').default;
},
get WheelPickerDialogScreen() {
return require('./screens/componentScreens/WheelPickerDialogScreen').default;
},
get SliderScreen() {
return require('./screens/componentScreens/SliderScreen').default;
},
Expand Down Expand Up @@ -173,9 +170,6 @@ module.exports = {
get SafeAreaSpacerViewScreen() {
return require('./screens/nativeComponentScreens/SafeAreaSpacerViewScreen').default;
},
get WheelPickerViewScreen() {
return require('./screens/nativeComponentScreens/WheelPickerViewScreen').default;
},
// Full Screen components
get EmptyStateScreen() {
return require('./screens/componentScreens/EmptyStateScreen').default;
Expand Down
2 changes: 0 additions & 2 deletions demo/src/screens/MenuStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export const navigationData = {
screen: 'unicorn.components.SharedTransitionScreen'
},
{title: 'Stack Aggregator', tags: 'stack aggregator', screen: 'unicorn.components.StackAggregatorScreen'},
{title: 'Wheel Picker Dialog', tags: 'wheel picker dialog', screen: 'unicorn.components.WheelPickerDialogScreen'},
{title: 'Marquee', tags: 'sliding text', screen: 'unicorn.components.MarqueeScreen'}
]
},
Expand Down Expand Up @@ -141,7 +140,6 @@ export const navigationData = {
tags: 'native overlay',
screen: 'unicorn.nativeComponents.HighlightOverlayViewScreen'
},
{title: 'Wheel Picker', tags: 'wheel picker', screen: 'unicorn.nativeComponents.WheelPickerViewScreen'},
{title: 'SafeArea Spacer', tags: 'native safe area', screen: 'unicorn.nativeComponents.SafeAreaSpacerViewScreen'},
{
title: 'KeyboardTracking (iOS)',
Expand Down
62 changes: 2 additions & 60 deletions demo/src/screens/componentScreens/ChipScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import _ from 'lodash';
import React, {Component} from 'react';
import {Alert} from 'react-native';
import {Chip, Colors, Spacings, Text, Typography, View, Incubator, WheelPickerDialog, Image} from 'react-native-ui-lib';
import {Chip, Colors, Spacings, Text, Typography, View, Image} from 'react-native-ui-lib';

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

state = {
showDialog: false,
selectedValue: this.colors[2].label
};

toggleDialog = (showDialog: boolean) => {
this.setState({showDialog});
};

openDialog = () => {
this.toggleDialog(true);
};

closeDialog = () => {
this.toggleDialog(false);
};

onSelect = (itemValue: string) => {
const values = _.filter(this.colors, {value: itemValue});
if (values.length > 0) {
this.setState({selectedValue: values[0].label});
}
this.closeDialog();
};

renderItem = ({item: color}) => {
return (
<Text text50 margin-20 color={color.value}>
{color.label}
</Text>
);
};

renderContent = () => {
const {selectedValue} = this.state;

return (
<WheelPickerDialog
items={this.colors}
selectedValue={selectedValue}
onSelect={this.onSelect}
onCancel={this.closeDialog}
wheelPickerProps={{
style: {width: 200}
}}
/>
);
};

renderPickerDialog = () => {
const {showDialog} = this.state;

return (
<Incubator.Dialog visible={showDialog} useSafeArea bottom onDismiss={this.closeDialog}>
{this.renderContent()}
</Incubator.Dialog>
);
};

renderExample = (text: string, chip: JSX.Element) => {
return (
<View row spread marginB-12>
Expand All @@ -90,7 +34,6 @@ export default class ChipScreen extends Component {
render() {
return (
<View style={{padding: 20}}>
{this.renderPickerDialog()}
<Text marginB-20 text40 $textDefault>
Chip
</Text>
Expand Down Expand Up @@ -120,12 +63,11 @@ export default class ChipScreen extends Component {
iconStyle={{width: 24, height: 24}}
iconProps={{tintColor: Colors.$iconDefault}}
/>)}
{this.renderExample('Right icon + onPress + dynamic label',
{this.renderExample('Right icon',
<Chip
label={this.state.selectedValue}
rightIconSource={chevron}
iconStyle={{margin: 8}}
onPress={this.openDialog}
/>)}
{this.renderExample('Label + Avatar', <Chip label={'Chip'} avatarProps={{source: avatarImage, size: 20}}/>)}
{this.renderExample('Label + Counter',
Expand Down
54 changes: 0 additions & 54 deletions demo/src/screens/componentScreens/WheelPickerDialogScreen.js

This file was deleted.

1 change: 0 additions & 1 deletion demo/src/screens/componentScreens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export function registerScreens(registrar) {
registrar('unicorn.wrappers.TouchableOpacityScreen', () => require('./TouchableOpacityScreen').default);
registrar('unicorn.components.TourScreen', () => require('./TourScreen').default);
registrar('unicorn.components.ViewScreen', () => require('./ViewScreen').default);
registrar('unicorn.components.WheelPickerDialogScreen', () => require('./WheelPickerDialogScreen').default);
registrar('unicorn.components.WizardScreen', () => require('./WizardScreen').default);
// List Components
registrar('unicorn.lists.BasicListScreen', () => require('./BasicListScreen').default);
Expand Down
49 changes: 0 additions & 49 deletions demo/src/screens/nativeComponentScreens/WheelPickerViewScreen.js

This file was deleted.

1 change: 0 additions & 1 deletion demo/src/screens/nativeComponentScreens/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export function registerScreens(registrar) {
registrar('unicorn.nativeComponents.HighlightOverlayViewScreen', () => require('./HighlightOverlayViewScreen').default);
registrar('unicorn.nativeComponents.SafeAreaSpacerViewScreen', () => require('./SafeAreaSpacerViewScreen').default);
registrar('unicorn.nativeComponents.WheelPickerViewScreen', () => require('./WheelPickerViewScreen').default);
registrar('unicorn.nativeComponents.KeyboardTrackingViewScreen', () => require('./KeyboardTrackingViewScreen').default);
registrar('unicorn.nativeComponents.KeyboardAccessoryViewScreen', () => require('./keyboardAccessory/KeyboardAccessoryViewScreen').default);
}
1 change: 0 additions & 1 deletion jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jest.mock('react-native-gesture-handler',
return GestureHandler;
},
{virtual: true});
jest.mock('@react-native-picker/picker', () => ({Picker: {Item: {}}}));
jest.mock('react-native', () => {
const reactNative = jest.requireActual('react-native');
reactNative.NativeModules.KeyboardTrackingViewTempManager = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
import com.wix.reactnativeuilib.keyboardinput.KeyboardInputPackage;
import com.wix.reactnativeuilib.textinput.TextInputDelKeyHandlerPackage;
import com.wix.reactnativeuilib.wheelpicker.WheelPickerPackage;

import java.util.Arrays;
import java.util.List;
Expand All @@ -22,7 +21,6 @@ public UiLibPackageList(Application application) {
public List<ReactPackage> getPackageList() {
return Arrays.asList(
new HighlighterViewPackage(),
new WheelPickerPackage(),
new TextInputDelKeyHandlerPackage(),
new KeyboardInputPackage(application)
);
Expand Down

This file was deleted.

Loading