Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
};
const APPBAR_HEIGHT = Platform.OS === 'ios' ? 88 : 112;
const STATUSBAR_HEIGHT = Platform.OS === 'ios' ? 40 : 0;
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;
import { createElement, PureComponent, PropTypes as T } from 'rax';
import { Image, View, Text } from 'rax-components';
import styles from './style';
const CANOPY_IMAGE_URL = 'https://cbu01.alicdn.com/cms/upload/2017/972/092/3290279_2093810242.png';
const SCAN_IMAGE_URL = 'https://cbu01.alicdn.com/cms/upload/2017/533/092/3290335_2093810242.png';
const MESSAGE_IMAGE_URL = 'https://cbu01.alicdn.com/cms/upload/2017/982/192/3291289_2093810242.png';
const SEARCH_IMAGE_URL = 'https://cbu01.alicdn.com/cms/upload/2017/294/133/3331492_2093810242.png';
const noop = () => {};
class Canopy extends PureComponent {
static propTypes = {
onScan: T.func,
onMessage: T.func,
onSearch: T.func,
messageNum: T.number, // '99+' maybe
searchKeyword: T.string,
searchPlaceholder: T.string
}
static defaultProps = {
onScan: noop,
onMessage: noop,
onSearch: noop,
messageNum: 0
}
renderPlaceholder() {
const { searchKeyword, searchPlaceholder } = this.props;
if (searchKeyword) {
{'' + displaySecondNum}
;
};
class Index extends Component {
state = {
timeRemaining: 0
};
timeoutId = 0;
static propTypes = {
formatFunc: PropTypes.func,
onTick: PropTypes.func,
onComplete: PropTypes.func,
tpl: PropTypes.string, // template (example {h}:{m}:{s})
timeRemaining: PropTypes.number,
secondStyle: PropTypes.object,
timeStyle: PropTypes.object, // style for num
textStyle: PropTypes.object, // style for text
timeWrapStyle: PropTypes.object,
timeBackground: PropTypes.string,
timeBackgroundStyle: PropTypes.object,
interval: PropTypes.number
};
static defaultProps = {
tpl: '{d}天{h}时{m}分{s}秒',
timeRemaining: 0,
interval: 1000
};
// panHandlers: ?NavigationPanHandlers,
// pointerEvents: string,
// renderScene: NavigationSceneRenderer,
// style: any,
// };
/**
* Component that renders the scene as card for the .
*/
class Card extends Component {
// props: Props;
static propTypes = {
...NavigationPropTypes.SceneRendererProps,
onComponentRef: PropTypes.func.isRequired,
onNavigateBack: PropTypes.func,
panHandlers: NavigationPropTypes.panHandlers,
pointerEvents: PropTypes.string.isRequired,
renderScene: PropTypes.func.isRequired,
style: PropTypes.any,
};
render() {
const {
panHandlers,
pointerEvents,
renderScene,
style,
...props /* NavigationSceneRendererProps */
} = this.props;
const viewStyle = style === undefined ?
/* NavigationSceneRendererProps */
const SceneRendererProps = {
layout: layout.isRequired,
navigationState: navigationState.isRequired,
navigation: PropTypes.object,
position: animatedValue.isRequired,
progress: animatedValue.isRequired,
scene: scene.isRequired,
scenes: PropTypes.arrayOf(scene).isRequired,
};
const SceneRenderer = PropTypes.shape(SceneRendererProps);
/* NavigationPanPanHandlers */
const panHandlers = PropTypes.shape({
onMoveShouldSetResponder: PropTypes.func.isRequired,
onMoveShouldSetResponderCapture: PropTypes.func.isRequired,
onResponderEnd: PropTypes.func.isRequired,
onResponderGrant: PropTypes.func.isRequired,
onResponderMove: PropTypes.func.isRequired,
onResponderReject: PropTypes.func.isRequired,
onResponderRelease: PropTypes.func.isRequired,
onResponderStart: PropTypes.func.isRequired,
onResponderTerminate: PropTypes.func.isRequired,
onResponderTerminationRequest: PropTypes.func.isRequired,
onStartShouldSetResponder: PropTypes.func.isRequired,
onStartShouldSetResponderCapture: PropTypes.func.isRequired,
});
/**
* Helper function that extracts the props needed for scene renderer.
*/
const VIEW_INDEX = 2;
export default class Calendar extends Component {
state = {
currentMonthMoment: moment(this.props.selectedDate || this.props.startDate || this.props.endDate || this.props.today),
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: {},
state = {
currentMonthMoment: moment(this.props.selectedDate || this.props.startDate || this.props.endDate || this.props.today),
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,
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: [],
import {createElement, Component, PropTypes} from 'rax';
import View from 'rax-view';
import PanResponder from 'universal-panresponder';
import isValidSwipe from './isValidSwipe';
const directions = {
SWIPE_UP: 'SWIPE_UP',
SWIPE_DOWN: 'SWIPE_DOWN',
SWIPE_LEFT: 'SWIPE_LEFT',
SWIPE_RIGHT: 'SWIPE_RIGHT'
};
const propTypes = {
onSwipeBegin: PropTypes.func,
onSwipe: PropTypes.func,
onSwipeEnd: PropTypes.func,
swipeDecoratorStyle: PropTypes.object
};
export default class SwipeEvent extends Component {
constructor(props) {
super(props);
this.state = {
swipe: {
direction: null,
distance: 0,
velocity: 0
}
};
};
static propTypes = {
/** An integer specifying to which level the tree should be initially expanded. */
expandLevel: PropTypes.number,
/** An array containing all the paths that should be expanded when the component is initialized, or a string of just one path */
expandPaths: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
name: PropTypes.string,
/** Not required prop because we also allow undefined value */
data: PropTypes.any,
/** Show non-enumerable properties */
showNonenumerable: PropTypes.bool,
/** Sort object keys with optional compare function. */
sortObjectKeys: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),
/** Provide a custom nodeRenderer */
nodeRenderer: PropTypes.func,
};
render() {
const { showNonenumerable, sortObjectKeys, nodeRenderer, ...rest } = this.props;
const dataIterator = createIterator(showNonenumerable, sortObjectKeys);
const renderer = nodeRenderer ? nodeRenderer : defaultNodeRenderer;
return (
);
}
}
onEndReachedThreshold={onEndReachedThreshold}
onTouchEnd={this.webRefresh}
ref={(ref) => {
this.recyclerView = ref;
}}
>
{children}
);
}
}
FloorWrapper.propTypes = {
onEndReached: T.func,
onEndReachedThreshold: T.number,
style: T.object,
children: T.node
};
FloorWrapper.Top = function Top() {
return null;
};
FloorWrapper.Bottom = function Bottom() {
return null;
};
FloorWrapper.Header = function Header() {
return null;
};