Skip to content

Commit e9b5881

Browse files
ArnonZethanshar
andauthored
Fix/Picker + TextField Ui fixes (#785)
* Updating DateTimePickerScreen * Removing unneeded picker value default color * Updating condition for rightIcon bottom padding * Spacings tweaks * Cosmetics * Update demo/src/screens/componentScreens/DateTimePickerScreen.js Co-authored-by: Ethan Sharabi <[email protected]> Co-authored-by: Ethan Sharabi <[email protected]>
1 parent af4aea2 commit e9b5881

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

demo/src/screens/componentScreens/DateTimePickerScreen.js

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
11
import React, {Component} from 'react';
22
import {DateTimePicker, View, Text} from 'react-native-ui-lib'; // eslint-disable-line
33

4-
54
export default class DateTimePickerScreen extends Component {
6-
75
render() {
86
return (
9-
<View flex padding-20>
10-
<Text text40 marginB-40>Date Time Picker</Text>
11-
12-
<DateTimePicker
13-
title={'Date'}
14-
placeholder={'Select a date'}
7+
<View flex padding-s5>
8+
<Text text40>Date Time Picker</Text>
9+
<DateTimePicker
10+
containerStyle={{marginVertical: 20}}
11+
title={'Date'}
12+
placeholder={'Select a date'}
1513
// dateFormat={'MMM D, YYYY'}
16-
// value={new Date('October 13, 2014')}
14+
// value={new Date('October 13, 2014')}
1715
/>
18-
<DateTimePicker
19-
mode={'time'}
20-
title={'Time'}
16+
<DateTimePicker
17+
mode={'time'}
18+
title={'Time'}
2119
placeholder={'Select time'}
2220
// timeFormat={'h:mm A'}
2321
// value={new Date('2015-03-25T12:00:00-06:30')}
2422
/>
23+
24+
<Text text60R marginT-40>
25+
Disabled
26+
</Text>
27+
<DateTimePicker
28+
containerStyle={{marginBottom: 20}}
29+
editable={false}
30+
title={'Date'}
31+
placeholder={'Select a date'}
32+
/>
33+
<DateTimePicker
34+
editable={false}
35+
mode={'time'}
36+
title={'Time'}
37+
placeholder={'Select time'}
38+
value={new Date('2015-03-25T12:00:00-06:30')}
39+
/>
2540
</View>
2641
);
2742
}

src/components/inputs/TextField.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ export default class TextField extends BaseInput {
702702
};
703703
}
704704

705-
function createStyles({centered, multiline, expandable}) {
705+
function createStyles({centered, multiline, hideUnderline}) {
706706
const inputTextAlign = Constants.isRTL ? 'right' : 'left';
707707

708708
return StyleSheet.create({
@@ -771,7 +771,7 @@ function createStyles({centered, multiline, expandable}) {
771771
position: 'absolute',
772772
right: 0,
773773
alignSelf: 'flex-end',
774-
paddingBottom: 8
774+
paddingBottom: hideUnderline ? undefined : 8
775775
},
776776
rightButton: {
777777
position: 'absolute',

src/components/picker/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import * as PickerPresenter from './PickerPresenter';
1313
import NativePicker from './NativePicker';
1414
import PickerModal from './PickerModal';
1515
import PickerItem from './PickerItem';
16-
import {Colors} from '../../style';
1716

1817
const PICKER_MODES = {
1918
SINGLE: 'SINGLE',
@@ -349,7 +348,6 @@ class Picker extends BaseComponent {
349348
const label = this.getLabel();
350349
return (
351350
<TextField
352-
color={Colors.dark10}
353351
{...textInputProps}
354352
{...this.getAccessibilityInfo()}
355353
importantForAccessibility={'no-hide-descendants'}

0 commit comments

Comments
 (0)