react-native-plain-calendar
Version:
Calendar component for React-Native
19 lines (18 loc) • 668 B
JavaScript
import * as React from 'react';
import { Text, View } from 'react-native';
import { Touchable } from '../Touchable/Touchable';
import { s } from './styles';
export function HeaderButton({ type, onPress, children, headerButtonStyle, HeaderButtonComponent, }) {
if (HeaderButtonComponent) {
return <HeaderButtonComponent onPress={onPress} type={type}/>;
}
const isNext = type === 'next';
return (<View style={[
s.headerContainers,
isNext ? s.headerNextButton : s.headerPrevButton,
]}>
<Touchable onPress={onPress} style={headerButtonStyle}>
<Text>{children}</Text>
</Touchable>
</View>);
}