Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanshar committed Nov 27, 2019
2 parents 8a1e467 + 0300fb3 commit 0f76b0a
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 15 deletions.
18 changes: 9 additions & 9 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"eslintIntegration": true,
"printWidth": 120,
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": false,
"trailingComma": "all",
"bracketSpacing": false,
"arrowParens": "avoid"
// "eslintIntegration": true,
// "printWidth": 120,
// "useTabs": false,
// "semi": true,
// "singleQuote": true,
// "jsxSingleQuote": false,
// "trailingComma": "none",
// "bracketSpacing": false,
// "arrowParens": "avoid"
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ UI Toolset & Components Library for React Native
Read more in our [Wiki](https://github.com/wix/react-native-ui-lib/wiki). <br>
Check out our [Docs](https://wix.github.io/react-native-ui-lib/). <br>
Our [Discord Channel](https://discord.gg/2eW4g6Z)


### RN60
please use `react-native-ui-lib@rn61` for React Native >= 0.60.0 (till it will publish officially)
2 changes: 1 addition & 1 deletion demo/src/screens/componentScreens/ButtonsScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class ButtonsScreen extends DemoScreen {
return (
<View useSafeArea>
{!!snippet && <SnippetBlock snippet={snippet} onClose={() => this.hideSnippet()}/>}
<ScrollView>
<ScrollView showsVerticalScrollIndicator={false}>
<View centerH>
<Text style={styles.title}>Buttons</Text>

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"jest": "^24.5.0",
"metro-react-native-babel-preset": "^0.53.1",
"mocha": "^5.0.0",
"prettier-eslint": "^9.0.0",
"react": "16.8.3",
"react-autobind": "^1.0.6",
"react-dom": "^15.4.2",
Expand Down
15 changes: 15 additions & 0 deletions src/components/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,21 @@ export default class Button extends PureBaseComponent {
}
}

componentDidMount() {
Constants.addDimensionsEventListener(this.onOrientationChanged);
}

componentWillUnmount() {
Constants.removeDimensionsEventListener(this.onOrientationChanged);
}

onOrientationChanged = () => {
if (Constants.isTablet && this.props.fullWidth) {
// only to trigger re-render
this.setState({isLandscape: Constants.isLandscape});
}
};

// This method will be called more than once in case of layout change!
onLayout = event => {
const height = event.nativeEvent.layout.height;
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialog/dialogDeprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const SWIPE_DIRECTIONS = {
}; // DEFRECATED

class DialogDeprecated extends BaseComponent {
static displayName = 'Dialog'
static displayName = 'Dialog (deprecated)'
static propTypes = {
/**
* Control visibility of the dialog
Expand Down
7 changes: 4 additions & 3 deletions src/components/picker/NativePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {WheelPicker} from '../../nativeComponents';
import PickerDialog from './PickerDialog';
import TouchableOpacity from '../touchableOpacity';
import View from '../view';
import {Colors} from '../../style';

class NativePicker extends BaseComponent {
state = {
Expand Down Expand Up @@ -75,8 +76,6 @@ class NativePicker extends BaseComponent {

render() {
const {renderPicker, customPickerProps, testID} = this.props;
const textInputProps = TextField.extractOwnProps(this.props);
const label = this.getLabel();

if (_.isFunction(renderPicker)) {
const {selectedValue} = this.state;
Expand All @@ -90,10 +89,12 @@ class NativePicker extends BaseComponent {
);
}

const textInputProps = TextField.extractOwnProps(this.props);
const label = this.getLabel();
return (
<TextField
color={Colors.dark10}
{...textInputProps}
enableErrors={false}
value={label}
expandable
renderExpandable={this.renderPickerDialog}
Expand Down
3 changes: 2 additions & 1 deletion src/components/picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import * as PickerPresenter from './PickerPresenter';
import NativePicker from './NativePicker';
import PickerModal from './PickerModal';
import PickerItem from './PickerItem';
import {Colors} from '../../style';

const PICKER_MODES = {
SINGLE: 'SINGLE',
Expand Down Expand Up @@ -324,9 +325,9 @@ class Picker extends BaseComponent {
const label = this.getLabel();
return (
<TextField
color={Colors.dark10}
{...textInputProps}
{...this.getAccessibilityInfo()}
enableErrors={false}
value={label}
expandable
renderExpandable={this.renderExpandableModal}
Expand Down

0 comments on commit 0f76b0a

Please sign in to comment.