Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// show placeholder only for non root nodes
shouldShowPlaceholder={depth > 0}
// Render a node from name and data (or possibly other props like isNonenumerable)
nodeRenderer={nodeRenderer}
{...this.props}
>
{// only render if the node is expanded
expanded ? this.renderChildNodes(data, path) : undefined}
);
}
}
ConnectedTreeNode.propTypes = {
name: PropTypes.string,
data: PropTypes.any,
dataIterator: PropTypes.func,
depth: PropTypes.number,
expanded: PropTypes.bool,
nodeRenderer: PropTypes.func,
};
ConnectedTreeNode.contextTypes = {
store: PropTypes.any,
};
class TreeView extends Component {
static defaultProps = {
expandLevel: 0,
expandPaths: [],
const TITLE_OFFSET = Platform.OS === 'ios' ? 140 : 80;
class Header extends PureComponent {
static HEIGHT = APPBAR_HEIGHT + STATUSBAR_HEIGHT;
static Title = HeaderTitle;
static BackButton = HeaderBackButton;
// propTypes for people who don't use Flow
static propTypes = {
...NavigationPropTypes.SceneRendererProps,
onNavigateBack: PropTypes.func,
renderLeftComponent: PropTypes.func,
renderRightComponent: PropTypes.func,
renderTitleComponent: PropTypes.func,
router: PropTypes.object,
style: PropTypes.any,
};
// props: HeaderProps;
state = {
widths: {},
};
_getHeaderTitle(navigation) {
const header = this.props.router.getScreenConfig(navigation, 'header');
let title;
if (header && header.title) {
title = header.title;
} else {
title = this.props.router.getScreenConfig(navigation, 'title');
}
selectedMoment: moment(this.props.selectedDate),
};
static propTypes = {
customStyle: PropTypes.object,
dayHeadings: PropTypes.array,
eventDates: PropTypes.array,
monthNames: PropTypes.array,
nextButtonText: PropTypes.string,
onDateSelect: PropTypes.func,
onSwipeNext: PropTypes.func,
onSwipePrev: PropTypes.func,
onTouchNext: PropTypes.func,
onTouchPrev: PropTypes.func,
prevButtonText: PropTypes.string,
selectedDate: PropTypes.any,
showControls: PropTypes.bool,
startDate: PropTypes.any,
endDate: PropTypes.any,
titleFormat: PropTypes.string,
dateFormat: PropTypes.string,
today: PropTypes.any,
weekStart: PropTypes.number,
};
static defaultProps = {
customStyle: {},
dayHeadings: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
eventDates: [],
monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
nextButtonText: 'Next',
static propTypes = {
customStyle: PropTypes.object,
dayHeadings: PropTypes.array,
eventDates: PropTypes.array,
monthNames: PropTypes.array,
nextButtonText: PropTypes.string,
onDateSelect: PropTypes.func,
onSwipeNext: PropTypes.func,
onSwipePrev: PropTypes.func,
onTouchNext: PropTypes.func,
onTouchPrev: PropTypes.func,
prevButtonText: PropTypes.string,
scrollEnabled: PropTypes.bool,
selectedDate: PropTypes.any,
showControls: PropTypes.bool,
startDate: PropTypes.any,
endDate: PropTypes.any,
titleFormat: PropTypes.string,
dateFormat: PropTypes.string,
today: PropTypes.any,
weekStart: PropTypes.number,
};
static defaultProps = {
customStyle: {},
dayHeadings: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
eventDates: [],
monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
nextButtonText: 'Next',
prevButtonText: 'Prev',
scrollEnabled: false,
};
static propTypes = {
customStyle: PropTypes.object,
dayHeadings: PropTypes.array,
eventDates: PropTypes.array,
monthNames: PropTypes.array,
nextButtonText: PropTypes.string,
onDateSelect: PropTypes.func,
onSwipeNext: PropTypes.func,
onSwipePrev: PropTypes.func,
onTouchNext: PropTypes.func,
onTouchPrev: PropTypes.func,
prevButtonText: PropTypes.string,
scrollEnabled: PropTypes.bool,
selectedDate: PropTypes.any,
showControls: PropTypes.bool,
startDate: PropTypes.any,
endDate: PropTypes.any,
titleFormat: PropTypes.string,
dateFormat: PropTypes.string,
today: PropTypes.any,
weekStart: PropTypes.number,
};
static defaultProps = {
customStyle: {},
dayHeadings: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
eventDates: [],
monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
nextButtonText: 'Next',
static propTypes = {
customStyle: PropTypes.object,
dayHeadings: PropTypes.array,
eventDates: PropTypes.array,
monthNames: PropTypes.array,
nextButtonText: PropTypes.string,
onDateSelect: PropTypes.func,
onSwipeNext: PropTypes.func,
onSwipePrev: PropTypes.func,
onTouchNext: PropTypes.func,
onTouchPrev: PropTypes.func,
prevButtonText: PropTypes.string,
selectedDate: PropTypes.any,
showControls: PropTypes.bool,
startDate: PropTypes.any,
endDate: PropTypes.any,
titleFormat: PropTypes.string,
dateFormat: PropTypes.string,
today: PropTypes.any,
weekStart: PropTypes.number,
};
static defaultProps = {
customStyle: {},
dayHeadings: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
eventDates: [],
monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
nextButtonText: 'Next',
prevButtonText: 'Prev',
showControls: true,
titleFormat: 'MMMM YYYY',
]}>
{title}
{
loading && loadingRight && loadingElement
}
{
icon && iconRight && iconElement
}
);
};
Button.propTypes = {
buttonStyle: PropTypes.any,
title: PropTypes.string,
onPress: PropTypes.any,
icon: PropTypes.object,
secondary: PropTypes.bool,
secondary2: PropTypes.bool,
secondary3: PropTypes.bool,
primary1: PropTypes.bool,
primary2: PropTypes.bool,
primary3: PropTypes.bool,
backgroundColor: PropTypes.string,
color: PropTypes.string,
fontSize: PropTypes.number,
underlayColor: PropTypes.string,
raised: PropTypes.bool,
textStyle: PropTypes.any,
disabled: PropTypes.bool,
buttonStyle: PropTypes.any,
title: PropTypes.string,
onPress: PropTypes.any,
icon: PropTypes.object,
secondary: PropTypes.bool,
secondary2: PropTypes.bool,
secondary3: PropTypes.bool,
primary1: PropTypes.bool,
primary2: PropTypes.bool,
primary3: PropTypes.bool,
backgroundColor: PropTypes.string,
color: PropTypes.string,
fontSize: PropTypes.number,
underlayColor: PropTypes.string,
raised: PropTypes.bool,
textStyle: PropTypes.any,
disabled: PropTypes.bool,
loading: PropTypes.bool,
activityIndicatorStyle: PropTypes.any,
loadingRight: PropTypes.bool
};
const styles = StyleSheet.create({
button: {
padding: 19 * 2,
marginLeft: 15 * 2,
marginRight: 15 * 2,
backgroundColor: colors.primary,
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row'
},
import {createElement, Component, PropTypes} from 'rax';
import View from 'rax-view';
import Text from 'rax-text';
import Touchable from 'rax-touchable';
import styles from './styles';
export default class Day extends Component {
static defaultProps = {
customStyle: {},
}
static propTypes = {
caption: PropTypes.any,
customStyle: PropTypes.object,
filler: PropTypes.bool,
hasEvent: PropTypes.bool,
isSelected: PropTypes.bool,
isToday: PropTypes.bool,
isWeekend: PropTypes.bool,
isDisabled: PropTypes.bool,
onPress: PropTypes.func,
usingEvents: PropTypes.bool,
}
dayCircleStyle = (isWeekend, isSelected, isToday) => {
const { customStyle } = this.props;
const dayCircleStyle = [styles.dayCircleFiller, customStyle.dayCircleFiller && customStyle.dayCircleFiller];
if (isSelected && !isToday) {
monthNames: PropTypes.array,
nextButtonText: PropTypes.string,
onDateSelect: PropTypes.func,
onSwipeNext: PropTypes.func,
onSwipePrev: PropTypes.func,
onTouchNext: PropTypes.func,
onTouchPrev: PropTypes.func,
prevButtonText: PropTypes.string,
scrollEnabled: PropTypes.bool,
selectedDate: PropTypes.any,
showControls: PropTypes.bool,
startDate: PropTypes.any,
endDate: PropTypes.any,
titleFormat: PropTypes.string,
dateFormat: PropTypes.string,
today: PropTypes.any,
weekStart: PropTypes.number,
};
static defaultProps = {
customStyle: {},
dayHeadings: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
eventDates: [],
monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
nextButtonText: 'Next',
prevButtonText: 'Prev',
scrollEnabled: false,
showControls: true,
titleFormat: 'MMMM YYYY',
dateFormat: 'YYYY-MM-DD',
today: moment(),