Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

Commit 6962ebe

Browse files
committed
updated readme
1 parent f2d37c8 commit 6962ebe

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,17 @@ import Button from 'HSButton'
7474

7575
| prop | default | type | description |
7676
| ---- | ---- | ----| ---- |
77-
| buttonStyle | none | object (style) | add additional styling for button component |
78-
| title | none | string | button title |
79-
| onPress | none | function | onPress method |
80-
| icon | none | object {name(string), color(string), size(number)} | [Material Icon Name](https://design.google.com/icons/) |
81-
| secondary | false | boolean | secondary button flag |
82-
| backgroundColor | primary color | string (color) | background color of button |
83-
| color | white | string(color) | font color |
84-
| textStyle | none | object (style) | text styling |
85-
| fontSize | 18 | number | font size |
86-
| underlayColor | transparent | string(color) | underlay color for button press |
87-
| raised | false | boolean | flag to add raised button styling |
77+
| buttonStyle | none | object (style) | add additional styling for button component (optional) |
78+
| title | none | string | button title (required) |
79+
| onPress | none | function | onPress method (required) |
80+
| icon | none | object {name(string), color(string), size(number)} | [Material Icon Name](https://design.google.com/icons/) (optional) |
81+
| secondary | false | boolean | secondary button flag (optional) |
82+
| backgroundColor | primary color | string (color) | background color of button (optional) |
83+
| color | white | string(color) | font color (optional) |
84+
| textStyle | none | object (style) | text styling (optional) |
85+
| fontSize | 18 | number | font size (optional) |
86+
| underlayColor | transparent | string(color) | underlay color for button press (optional) |
87+
| raised | false | boolean | flag to add raised button styling (optional) |
8888

8989
## Social Icons & Buttons
9090

@@ -108,14 +108,14 @@ import SocialIcon from 'HSSocialIcon'
108108

109109
| prop | default | type | description |
110110
| ---- | ---- | ----| ---- |
111-
| component | TouchableHighlight | React Native Component | type of button |
112-
| type | none | social media type (facebook, twitter, google-plus-official, pinterest, linkedin, youtube, vimeo, tumblr, instagram, quora, foursquare, wordpress, stumbleupon) | social media type |
113-
| button | false | boolean | creates button |
114-
| onPress | none | funciton | onPress method |
115-
| iconStyle | none | object (style) | extra styling for icon component ([React Native Vector Icons](https://github.com/oblador/react-native-vector-icons)) |
116-
| style | none | object (style) | button styling |
117-
| iconColor | white | string | icon color |
118-
| title | none | string | title if made into a button |
111+
| component | TouchableHighlight | React Native Component | type of button (optional) |
112+
| type | none | social media type (facebook, twitter, google-plus-official, pinterest, linkedin, youtube, vimeo, tumblr, instagram, quora, foursquare, wordpress, stumbleupon) | social media type (required) |
113+
| button | false | boolean | creates button (optional) |
114+
| onPress | none | funciton | onPress method (optional) |
115+
| iconStyle | none | object (style) | extra styling for icon component ([React Native Vector Icons](https://github.com/oblador/react-native-vector-icons)) (optional) |
116+
| style | none | object (style) | button styling (optional) |
117+
| iconColor | white | string | icon color (optional) |
118+
| title | none | string | title if made into a button (optional) |
119119

120120
## Lists
121121

@@ -182,6 +182,7 @@ render () {
182182
| avatar | none | string | left avatar (optional) |
183183
| avatarStyle | none | object (style) | avatar styling (optional) |
184184
| chevronColor | #bdc6cf | string | set chevron color |
185+
| component | View or TouchableHighlight if onPress method is added as prop | React Native element | replace element with custom element (optional) |
185186
| containerStyle | none | object (style) | additional main container styling (optional) |
186187
| hideChevron | false | boolean | set if you do not want a chevron (optional) |
187188
| icon | none | object {name, color, style} | icon configuration for left icon (optional) |

src/components/list/ListItem.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ const ListItem = ({
2525
titleStyle,
2626
hideChevron,
2727
chevronColor,
28-
roundAvatar
28+
roundAvatar,
29+
component
2930
}) => {
30-
const Component = onPress ? TouchableHighlight : View
31+
let Component = onPress ? TouchableHighlight : View
32+
if (component) {
33+
Component = component
34+
}
3135
return (
3236
<Component
3337
onPress={onPress}

0 commit comments

Comments
 (0)