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

Commit afbd9ac

Browse files
committed
updated image, added lists
1 parent 03d24a7 commit afbd9ac

File tree

12 files changed

+378
-159
lines changed

12 files changed

+378
-159
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# 🔥🔥🔥 React Native Hackathon Starter Project & UI Toolkit 🔥🔥🔥
1+
React Native Hackathon Starter Project & UI Toolkit
22

3-
![React Native UI Toolkit](http://i.imgur.com/80RWAyT.png)
3+
![React Native UI Toolkit](http://i.imgur.com/QsxIkuW.png)
44

55
### Included
66
- [x] [Buttons](https://github.com/dabit3/react-native-hackathon-starter#buttons)

src/App.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Home from './home/HomeRootContainer'
99
import About from './about/AboutRootContainer'
1010
import Contact from './contact/ContactRootContainer'
1111
import Pricing from './pricing/PricingRootContainer'
12+
import More from './more/MoreRootContainer'
1213

1314
let styles = {}
1415

@@ -72,6 +73,17 @@ class App extends Component {
7273
onPress={() => this.changeTab('pricing')}>
7374
<Pricing />
7475
</TabNavigator.Item>
76+
<TabNavigator.Item
77+
tabStyle={selectedTab !== 'more' && { marginBottom: -6 }}
78+
titleStyle={[styles.titleStyle, {marginTop: -1}]}
79+
selectedTitleStyle={[styles.titleSelected, {marginTop: -3, marginBottom: 8}]}
80+
selected={selectedTab === 'more'}
81+
title={selectedTab === 'more' ? 'MORE' : null}
82+
renderIcon={() => <Icon style={{paddingBottom: 4}} color={colors.grey2} name='list' size={26} />}
83+
renderSelectedIcon={() => <Icon color={colors.primary} name='list' size={26} />}
84+
onPress={() => this.changeTab('more')}>
85+
<More />
86+
</TabNavigator.Item>
7587
</TabNavigator>
7688

7789
)

src/components/form/FormLabel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import Text from 'HSText'
1010

1111
let styles = {}
1212

13-
const FormLabel = ({containerStyle, inputStyle, children}) => (
13+
const FormLabel = ({containerStyle, labelStyle, children}) => (
1414
<View style={[styles.container, containerStyle && containerStyle]}>
15-
<Text style={styles.label}>{children.toUpperCase()}</Text>
15+
<Text style={[styles.label, labelStyle && labelStyle]}>{children.toUpperCase()}</Text>
1616
</View>
1717
)
1818

src/components/linkList/LinkItem.js

Lines changed: 0 additions & 106 deletions
This file was deleted.

src/components/linkList/LinkList.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/components/list/List.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* @providesModule HSList
3+
*/
4+
5+
import React from 'react'
6+
import { View, StyleSheet } from 'react-native'
7+
import colors from 'HSColors'
8+
let styles
9+
10+
const Component = ({children, containerStyle}) => (
11+
<View style={[styles.listContainer, containerStyle && containerStyle]}>
12+
{children}
13+
</View>
14+
)
15+
16+
Component.propTypes = {}
17+
18+
styles = StyleSheet.create({
19+
listContainer: {
20+
marginTop: 20,
21+
borderTopWidth: 1,
22+
borderBottomWidth: 1,
23+
borderColor: colors.greyOutline
24+
}
25+
})
26+
27+
export default Component

src/components/list/ListItem.js

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/**
2+
* @providesModule HSListItem
3+
*/
4+
5+
import React, { PropTypes } from 'react'
6+
import { View, StyleSheet, TouchableHighlight, Image, Platform } from 'react-native'
7+
import Icon from 'react-native-vector-icons/MaterialIcons'
8+
import Text from 'HSText'
9+
import colors from 'HSColors'
10+
import fonts from 'HSFonts'
11+
let styles
12+
13+
const ListItem = ({
14+
onPress,
15+
title,
16+
icon,
17+
rightIcon,
18+
avatar,
19+
avatarStyle,
20+
underlayColor,
21+
subtitle,
22+
subtitleStyle,
23+
containerStyle,
24+
wrapperStyle,
25+
titleStyle,
26+
hideChevron,
27+
chevronColor,
28+
roundAvatar
29+
}) => {
30+
const Component = onPress ? TouchableHighlight : View
31+
return (
32+
<Component
33+
onPress={onPress}
34+
underlayColor={underlayColor}
35+
style={[styles.container, containerStyle && containerStyle]}>
36+
<View style={[styles.wrapper, wrapperStyle && wrapperStyle]}>
37+
{
38+
icon && icon.name && (
39+
<Icon
40+
size={28}
41+
style={styles.icon}
42+
name={icon.name}
43+
color={icon.color || colors.grey4}
44+
/>
45+
)
46+
}
47+
{
48+
avatar && (
49+
<Image
50+
style={[
51+
styles.avatar,
52+
roundAvatar && {borderRadius: 15},
53+
avatarStyle && avatarStyle]}
54+
source={{uri: avatar}}
55+
/>
56+
)
57+
}
58+
<View style={styles.titleContainer}>
59+
<Text
60+
style={[
61+
styles.title,
62+
titleStyle && titleStyle,
63+
!icon && {marginLeft: 10}
64+
]}>{title}</Text>
65+
{subtitle && (
66+
<Text
67+
style={[
68+
styles.subtitle,
69+
!icon && {marginLeft: 10},
70+
subtitleStyle && subtitleStyle
71+
]}>{subtitle}</Text>
72+
)}
73+
</View>
74+
{
75+
onPress && !hideChevron && (
76+
<View style={styles.chevronContainer}>
77+
<Icon
78+
style={styles.chevron}
79+
size={28}
80+
name={rightIcon}
81+
color={chevronColor} />
82+
</View>
83+
)
84+
}
85+
</View>
86+
</Component>
87+
)
88+
}
89+
90+
ListItem.defaultProps = {
91+
underlayColor: 'white',
92+
chevronColor: colors.grey4,
93+
rightIcon: 'chevron-right',
94+
hideChevron: false,
95+
roundAvatar: false
96+
}
97+
98+
ListItem.propTypes = {
99+
title: PropTypes.string,
100+
avatar: PropTypes.any,
101+
icon: PropTypes.any,
102+
onPress: PropTypes.func,
103+
rightIcon: PropTypes.string,
104+
underlayColor: PropTypes.string,
105+
subtitle: PropTypes.string,
106+
subtitleStyle: PropTypes.any,
107+
containerStyle: PropTypes.any,
108+
wrapperStyle: PropTypes.any,
109+
titleStyle: PropTypes.any,
110+
hideChevron: PropTypes.bool,
111+
chevronColor: PropTypes.string,
112+
roundAvatar: PropTypes.bool
113+
}
114+
115+
styles = StyleSheet.create({
116+
avatar: {
117+
width: 34,
118+
height: 34
119+
},
120+
container: {
121+
padding: 10,
122+
borderBottomColor: '#ededed',
123+
borderBottomWidth: 1,
124+
backgroundColor: 'white'
125+
},
126+
wrapper: {
127+
flexDirection: 'row'
128+
},
129+
icon: {
130+
marginRight: 10
131+
},
132+
title: {
133+
fontSize: 16,
134+
color: colors.grey1,
135+
marginTop: -2
136+
},
137+
subtitle: {
138+
color: colors.grey3,
139+
fontSize: 12,
140+
marginTop: 1,
141+
...Platform.select({
142+
ios: {
143+
fontFamily: fonts.ios.bold
144+
},
145+
android: {
146+
fontFamily: fonts.android.bold
147+
}
148+
})
149+
},
150+
titleContainer: {
151+
justifyContent: 'center'
152+
},
153+
chevronContainer: {
154+
flex: 1,
155+
alignItems: 'flex-end',
156+
justifyContent: 'center'
157+
},
158+
chevron: {
159+
}
160+
})
161+
162+
export default ListItem

0 commit comments

Comments
 (0)