Skip to content
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

Add ability to config onEndReachedThreshold and rowHasChanged props #76

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
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
21 changes: 17 additions & 4 deletions components/DropDownMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import _ from 'lodash';

import { Button } from './Button';
import { Icon } from './Icon';
import { Text } from './Text';
import { Text, Title } from './Text';
import { View } from './View';
import { TouchableOpacity } from './TouchableOpacity';

Expand Down Expand Up @@ -51,7 +51,14 @@ class DropDownMenu extends Component {
* Prop definition overrides style.
*/
visibleOptions: React.PropTypes.number,
style: React.PropTypes.object,
/**
* Header property
*/
header: React.PropTypes.string,
style: React.PropTypes.oneOfType([
React.PropTypes.object,
React.PropTypes.array
]),
};

static DEFAULT_VISIBLE_OPTIONS = 8;
Expand Down Expand Up @@ -144,7 +151,12 @@ class DropDownMenu extends Component {
return selectedOption ? (
<View style={style.horizontalContainer}>
<Button onPress={this.collapse} style={style.selectedOption}>
<Text>{selectedOption[titleProperty]}</Text>
<Text
numberOfLines={1}
style={style.selectedOptionTitle}
>
{selectedOption[titleProperty]}
</Text>
<Icon name="drop-down" />
</Button>
</View>
Expand Down Expand Up @@ -185,7 +197,7 @@ class DropDownMenu extends Component {

render() {
const { collapsed } = this.state;
const { titleProperty, options, style } = this.props;
const { titleProperty, options, style, header, } = this.props;

const button = this.renderSelectedOption();
if (_.size(options) === 0 || !button) {
Expand All @@ -206,6 +218,7 @@ class DropDownMenu extends Component {
<ZoomOut driver={this.timingDriver} maxFactor={1.1} style={{ flex: 1 }}>
<FadeIn driver={this.timingDriver} style={{ flex: 1 }}>
<View style={style.modal} styleName="vertical">
{header && <Title style={style.header}>{header}</Title>}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we had new method renderHeader and this expression there.

<AnimatedListView
dataSource={dataSource}
renderRow={this.renderRow}
Expand Down
5 changes: 4 additions & 1 deletion components/HorizontalPager/HorizontalPager.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ class HorizontalPager extends Component {
// Prop that forces enables or disables swiping
scrollEnabled: PropTypes.bool,
// Style prop used to override default (theme) styling
style: PropTypes.object,
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.array
]),
// Prop that reduces page size by pageMargin, allowing 'sneak peak' of next page
showNextPage: PropTypes.bool,
// Always render only central (currently loaded) page plus `surroundingPagesToLoad`
Expand Down
Loading