Skip to content

Commit 435c27a

Browse files
authored
v7_TextField (#2468)
* Enable text field migration * Ignore/fix TS errors * Move incubator TextField example screen to be the official screen * Remove centered prop from migration since it is supported * Remove transformer from migration list cause it is supported as formatter
1 parent b60c3ec commit 435c27a

File tree

13 files changed

+20
-661
lines changed

13 files changed

+20
-661
lines changed

demo/src/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ 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
},
@@ -215,9 +215,6 @@ module.exports = {
215215
return require('./screens/componentScreens/ProgressBarScreen').default;
216216
},
217217
// Incubator
218-
get IncubatorTextFieldScreen() {
219-
return require('./screens/incubatorScreens/IncubatorTextFieldScreen').default;
220-
},
221218
get PanViewScreen() {
222219
return require('./screens/incubatorScreens/PanViewScreen').default;
223220
},

demo/src/screens/MenuStructure.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ export const navigationData = {
175175
{title: 'ChipsInput', tags: 'chips input', screen: 'unicorn.components.ChipsInputScreen'},
176176
{title: 'Native TouchableOpacity', tags: 'touchable native', screen: 'unicorn.incubator.TouchableOpacityScreen'},
177177
{title: 'Dialog (New)', tags: 'dialog modal popup alert', screen: 'unicorn.incubator.IncubatorDialogScreen'},
178-
{title: 'TextField (New)', tags: 'text field input', screen: 'unicorn.components.IncubatorTextFieldScreen'},
179178
{title: 'Toast (New)', tags: 'toast', screen: 'unicorn.components.IncubatorToastScreen'},
180179
{
181180
title: 'ExpandableOverlay',

demo/src/screens/incubatorScreens/IncubatorTextFieldScreen.tsx renamed to demo/src/screens/componentScreens/TextFieldScreen.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import _ from 'lodash';
22
import React, {Component} from 'react';
33
import {TextInput, StyleSheet, ScrollView, ActivityIndicator} from 'react-native';
4-
import {Assets, Colors, Spacings, Typography, View, Text, Button, Keyboard, Incubator} from 'react-native-ui-lib'; //eslint-disable-line
5-
const {TextField} = Incubator;
4+
import {Assets, Colors, Spacings, Typography, View, Text, Button, Keyboard, TextField, TextFieldMethods} from 'react-native-ui-lib'; //eslint-disable-line
65
const {KeyboardAwareInsetsView} = Keyboard;
76

87
const priceFormatter = Intl.NumberFormat('en-US');
98

109
export default class TextFieldScreen extends Component {
1110
input = React.createRef<TextInput>();
1211
input2 = React.createRef<TextInput>();
13-
inputWithValidation = React.createRef<TextInput>();
12+
inputWithValidation = React.createRef<TextFieldMethods>();
1413
state = {
1514
errorPosition: TextField.validationMessagePositions.TOP,
1615
shouldDisable: false,
1716
isReadonly: false,
1817
value: 'Initial Value',
1918
searching: false,
20-
preset: 'withUnderline'
19+
preset: 'withUnderline',
20+
price: ''
2121
};
2222

2323
componentDidMount() {
@@ -162,6 +162,7 @@ export default class TextFieldScreen extends Component {
162162

163163
<View row top marginT-s4>
164164
<TextField
165+
// @ts-expect-error
165166
ref={this.inputWithValidation}
166167
placeholder="Enter full name"
167168
validate="required"

demo/src/screens/componentScreens/TextFieldScreen/BasicTextFieldScreen.js

Lines changed: 0 additions & 120 deletions
This file was deleted.

demo/src/screens/componentScreens/TextFieldScreen/CustomInputsScreen.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

demo/src/screens/componentScreens/TextFieldScreen/InputValidationsScreen.js

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)