From 9a46932a1265e8bcd73063a075256a5011d42f88 Mon Sep 17 00:00:00 2001 From: Kyle Roach Date: Wed, 5 Jul 2017 11:32:02 -0400 Subject: [PATCH] [react-native-elements] Added HTML Style Headings(Text) Component, and checklist --- types/react-native-elements/README.md | 27 +++++++++++++ types/react-native-elements/index.d.ts | 39 +++++++++++++++++++ .../react-native-elements-tests.tsx | 15 ++++++- 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 types/react-native-elements/README.md diff --git a/types/react-native-elements/README.md b/types/react-native-elements/README.md new file mode 100644 index 0000000000..0ed43c6eb3 --- /dev/null +++ b/types/react-native-elements/README.md @@ -0,0 +1,27 @@ +# [React Native Elements](https://github.com/react-native-training/react-native-elements) + +### Component Checklist +List will update as typings are added + +- [x] Buttons +- [ ] Badge +- [ ] Social Icons / Social Icon Buttons +- [ ] Icons +- [ ] Side Menu +- [ ] Form Elements +- [ ] Search Bar +- [ ] ButtonGroup +- [ ] Checkboxes +- [ ] List Element +- [ ] Badge +- [ ] Tab Bar Component +- [x] HTML style headings +- [ ] Card component +- [ ] Pricing Component +- [ ] Grid Component +- [ ] Slider Component +- [ ] Tile Component +- [ ] Avatar Component +- [ ] Rating Component +- [ ] SwipeDeck Component +- [ ] Header Component diff --git a/types/react-native-elements/index.d.ts b/types/react-native-elements/index.d.ts index 8323ef1c25..5a39c78481 100644 --- a/types/react-native-elements/index.d.ts +++ b/types/react-native-elements/index.d.ts @@ -7,6 +7,45 @@ import * as React from 'react'; import { ViewStyle, TextStyle } from 'react-native'; +export interface TextProps { + /** + * font size 40 + */ + h1?: boolean; + + /** + * font size 34 + */ + h2?: boolean; + + /** + * font size 28 + */ + h3?: boolean; + + /** + * font size 22 + */ + h4?: boolean; + + /** + * font family name + */ + fontFamily?: string; + + /** + * Additional styling for Text + */ + style?: TextStyle; +} + +/** + * HTML Style Headings + * + * @desc https://react-native-training.github.io/react-native-elements/API/HTML_style_headings/ + */ +export class Text extends React.Component {} + export interface ButtonIcon { name?: string; color?: string; diff --git a/types/react-native-elements/react-native-elements-tests.tsx b/types/react-native-elements/react-native-elements-tests.tsx index 197b1ec202..836b04b431 100644 --- a/types/react-native-elements/react-native-elements-tests.tsx +++ b/types/react-native-elements/react-native-elements-tests.tsx @@ -1,6 +1,19 @@ import * as React from 'react'; import { View, StyleSheet } from 'react-native'; -import { Button } from 'react-native-elements'; +import { Button, Text } from 'react-native-elements'; + +class TextTest extends React.Component { + render() { + return ( + + Heading 1 + Heading 2 + Heading 3 + Heading 4 + + ); + } +} class ButtonTest extends React.Component { handleButtonPress() {