Skip to content

Commit c022258

Browse files
committed
Initial commit.
0 parents  commit c022258

File tree

236 files changed

+13102
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+13102
-0
lines changed

.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["react-native"]
3+
}

.buckconfig

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
indent_style = space
11+
indent_size = 2
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
15+
16+
[*.gradle]
17+
indent_size = 4

.flowconfig

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
10+
11+
; Ignore duplicate module providers
12+
; For RN Apps installed via npm, "Libraries" folder is inside
13+
; "node_modules/react-native" but in the source repo it is in the root
14+
.*/Libraries/react-native/React.js
15+
.*/Libraries/react-native/ReactNative.js
16+
17+
[include]
18+
19+
[libs]
20+
node_modules/react-native/Libraries/react-native/react-native-interface.js
21+
node_modules/react-native/flow
22+
flow/
23+
24+
[options]
25+
emoji=true
26+
27+
module.system=haste
28+
29+
experimental.strict_type_args=true
30+
31+
munge_underscores=true
32+
33+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
34+
35+
suppress_type=$FlowIssue
36+
suppress_type=$FlowFixMe
37+
suppress_type=$FixMe
38+
39+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-8]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
40+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-8]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
41+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
42+
43+
unsafe.enable_getters_and_setters=true
44+
45+
[version]
46+
^0.38.0

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.pbxproj -text
2+
*.bat text eol=crlf

.gitignore

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
project.xcworkspace
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
33+
# node.js
34+
#
35+
node_modules/
36+
npm-debug.log
37+
yarn-error.log
38+
39+
# BUCK
40+
buck-out/
41+
\.buckd/
42+
*.keystore
43+
44+
# fastlane
45+
#
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47+
# screenshots whenever they are needed.
48+
# For more information about the recommended setup visit:
49+
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
50+
51+
fastlane/report.xml
52+
fastlane/Preview.html
53+
fastlane/screenshots

.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

App/Components/AlertMessage.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React, { PropTypes } from 'react'
2+
import { View, Text } from 'react-native'
3+
import styles from './Styles/AlertMessageStyles'
4+
5+
export default class AlertMessage extends React.Component {
6+
static defaultProps = { show: true }
7+
8+
static propTypes = {
9+
title: PropTypes.string,
10+
icon: PropTypes.string,
11+
style: PropTypes.object,
12+
show: PropTypes.bool
13+
}
14+
15+
render () {
16+
let messageComponent = null
17+
if (this.props.show) {
18+
const { title } = this.props
19+
return (
20+
<View
21+
style={[styles.container, this.props.style]}
22+
>
23+
<View style={styles.contentContainer}>
24+
<Text allowFontScaling={false} style={styles.message}>{title && title.toUpperCase()}</Text>
25+
</View>
26+
</View>
27+
)
28+
}
29+
30+
return messageComponent
31+
}
32+
}
33+
34+
AlertMessage.defaultProps = {
35+
show: true
36+
}

App/Components/CustomNavBar.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react'
2+
import { View, Image, Animated, TouchableOpacity } from 'react-native'
3+
import { Images, Colors } from '../Themes'
4+
import Styles from './Styles/CustomNavBarStyles'
5+
import Icon from 'react-native-vector-icons/Ionicons'
6+
import { Actions as NavigationActions } from 'react-native-router-flux'
7+
8+
export default class CustomNavBar extends React.Component {
9+
render () {
10+
return (
11+
<Animated.View style={Styles.container}>
12+
<TouchableOpacity style={Styles.leftButton} onPress={NavigationActions.pop}>
13+
<Icon name='ios-arrow-back' size={34} color={Colors.snow} />
14+
</TouchableOpacity>
15+
<Image style={Styles.logo} source={Images.clearLogo} />
16+
<View style={Styles.rightButton} />
17+
</Animated.View>
18+
)
19+
}
20+
}

App/Components/DrawerButton.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React, { Component, PropTypes } from 'react'
2+
import { Text, TouchableOpacity } from 'react-native'
3+
import styles from './Styles/DrawerButtonStyles'
4+
import ExamplesRegistry from '../Services/ExamplesRegistry'
5+
6+
// Example
7+
ExamplesRegistry.addComponentExample('Drawer Button', () =>
8+
<DrawerButton
9+
text='Example left drawer button'
10+
onPress={() => window.alert('Your drawers are showing')}
11+
/>
12+
)
13+
14+
class DrawerButton extends Component {
15+
static propTypes = {
16+
text: PropTypes.string,
17+
onPress: PropTypes.func
18+
}
19+
20+
render () {
21+
return (
22+
<TouchableOpacity onPress={this.props.onPress}>
23+
<Text style={styles.text}>{this.props.text}</Text>
24+
</TouchableOpacity>
25+
)
26+
}
27+
}
28+
29+
export default DrawerButton

App/Components/FullButton.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React, { PropTypes } from 'react'
2+
import { TouchableOpacity, Text } from 'react-native'
3+
import styles from './Styles/FullButtonStyles'
4+
import ExamplesRegistry from '../Services/ExamplesRegistry'
5+
6+
// Example
7+
ExamplesRegistry.addComponentExample('Full Button', () =>
8+
<FullButton
9+
text='Hey there'
10+
onPress={() => window.alert('Full Button Pressed!')}
11+
/>
12+
)
13+
14+
export default class FullButton extends React.Component {
15+
static propTypes = {
16+
text: PropTypes.string,
17+
onPress: PropTypes.func,
18+
styles: PropTypes.object
19+
}
20+
21+
render () {
22+
return (
23+
<TouchableOpacity style={[styles.button, this.props.styles]} onPress={this.props.onPress}>
24+
<Text style={styles.buttonText}>{this.props.text && this.props.text.toUpperCase()}</Text>
25+
</TouchableOpacity>
26+
)
27+
}
28+
}

App/Components/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Components Folder
2+
All components are stored and organized here

App/Components/RoundedButton.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React, { PropTypes } from 'react'
2+
import { TouchableOpacity, Text } from 'react-native'
3+
import styles from './Styles/RoundedButtonStyles'
4+
import ExamplesRegistry from '../Services/ExamplesRegistry'
5+
6+
// Example
7+
ExamplesRegistry.addComponentExample('Rounded Button', () =>
8+
<RoundedButton
9+
text='real buttons have curves'
10+
onPress={() => window.alert('Rounded Button Pressed!')}
11+
/>
12+
)
13+
14+
export default class RoundedButton extends React.Component {
15+
static propTypes = {
16+
onPress: PropTypes.func,
17+
text: PropTypes.string,
18+
children: PropTypes.string,
19+
navigator: PropTypes.object
20+
}
21+
22+
getText () {
23+
const buttonText = this.props.text || this.props.children || ''
24+
return buttonText.toUpperCase()
25+
}
26+
27+
render () {
28+
return (
29+
<TouchableOpacity style={styles.button} onPress={this.props.onPress}>
30+
<Text style={styles.buttonText}>{this.getText()}</Text>
31+
</TouchableOpacity>
32+
)
33+
}
34+
}

App/Components/SearchBar.js

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import React from 'react'
2+
import { View, Text, TextInput, TouchableOpacity } from 'react-native'
3+
import styles from './Styles/SearchBarStyles'
4+
import { Colors, Metrics } from '../Themes/'
5+
import Icon from 'react-native-vector-icons/FontAwesome'
6+
7+
export default class SearchBar extends React.Component {
8+
9+
static propTypes = {
10+
onSearch: React.PropTypes.func.isRequired,
11+
onCancel: React.PropTypes.func.isRequired,
12+
searchTerm: React.PropTypes.string
13+
}
14+
15+
render () {
16+
const { onSearch, onCancel, searchTerm } = this.props
17+
const onSubmitEditing = () => onSearch(searchTerm)
18+
return (
19+
<View style={styles.container}>
20+
<Icon name='search' size={Metrics.icons.tiny} style={styles.searchIcon} />
21+
<TextInput
22+
ref='searchText'
23+
autoFocus
24+
placeholder='Search'
25+
placeholderTextColor={Colors.snow}
26+
underlineColorAndroid='transparent'
27+
style={styles.searchInput}
28+
value={this.props.searchTerm}
29+
onChangeText={onSearch}
30+
autoCapitalize='none'
31+
onSubmitEditing={onSubmitEditing}
32+
returnKeyType={'search'}
33+
autoCorrect={false}
34+
selectionColor={Colors.snow}
35+
/>
36+
<TouchableOpacity onPress={onCancel} style={styles.cancelButton}>
37+
<Text style={styles.buttonLabel}>Cancel</Text>
38+
</TouchableOpacity>
39+
</View>
40+
)
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { StyleSheet } from 'react-native'
2+
import { Colors, Metrics, Fonts } from '../../Themes/'
3+
4+
export default StyleSheet.create({
5+
container: {
6+
justifyContent: 'center',
7+
marginVertical: Metrics.section
8+
},
9+
contentContainer: {
10+
alignSelf: 'center',
11+
alignItems: 'center'
12+
},
13+
message: {
14+
marginTop: Metrics.baseMargin,
15+
marginHorizontal: Metrics.baseMargin,
16+
textAlign: 'center',
17+
fontFamily: Fonts.type.base,
18+
fontSize: Fonts.size.regular,
19+
fontWeight: 'bold',
20+
color: Colors.steel
21+
},
22+
icon: {
23+
color: Colors.steel
24+
}
25+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Colors, Metrics } from '../../Themes/'
2+
3+
export default {
4+
container: {
5+
position: 'absolute',
6+
top: 0,
7+
left: 0,
8+
right: 0,
9+
height: Metrics.navBarHeight,
10+
paddingHorizontal: Metrics.baseMargin,
11+
backgroundColor: Colors.background,
12+
flexDirection: 'row',
13+
alignItems: 'center',
14+
justifyContent: 'space-between'
15+
},
16+
leftButton: {
17+
paddingTop: Metrics.baseMargin
18+
},
19+
logo: {
20+
height: Metrics.navBarHeight - Metrics.doubleBaseMargin,
21+
width: Metrics.navBarHeight - Metrics.doubleBaseMargin,
22+
resizeMode: 'contain'
23+
},
24+
rightButton: {
25+
paddingTop: Metrics.baseMargin
26+
}
27+
}

0 commit comments

Comments
 (0)