mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-05-17 17:47:13 +08:00
* Automatically generate prop-types from Flow * Remove propTypes usage * Fix flow * Modify some eslint settings * Fix flowtype * Lint tweaks * use prop-types pkg * Run prettier * Fix flow * Fix few lint issues * Make eslint pass * Run lint on tests * Fix flow * Fixes * Alphabetical * Trailing comma: ES5 for website compat, also fix config/paths * Apply eslint --fix only to src now * Fix missing transitionconfig * Update TypeDefinition.js * New stuff * Unstage website and examples * reformat code * Update circle.yml
34 lines
684 B
JavaScript
34 lines
684 B
JavaScript
/* @flow */
|
|
|
|
import React from 'react';
|
|
|
|
import { Platform, StyleSheet, Text } from 'react-native';
|
|
|
|
import type { Style } from '../TypeDefinition';
|
|
|
|
type Props = {
|
|
tintColor?: ?string,
|
|
style?: Style,
|
|
};
|
|
|
|
const HeaderTitle = ({ style, ...rest }: Props) => (
|
|
<Text
|
|
numberOfLines={1}
|
|
{...rest}
|
|
style={[styles.title, style]}
|
|
accessibilityTraits="header"
|
|
/>
|
|
);
|
|
|
|
const styles = StyleSheet.create({
|
|
title: {
|
|
fontSize: Platform.OS === 'ios' ? 17 : 18,
|
|
fontWeight: Platform.OS === 'ios' ? '600' : '500',
|
|
color: 'rgba(0, 0, 0, .9)',
|
|
textAlign: Platform.OS === 'ios' ? 'center' : 'left',
|
|
marginHorizontal: 16,
|
|
},
|
|
});
|
|
|
|
export default HeaderTitle;
|