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

Commit 9d127c0

Browse files
committed
Merge branch 'wookiem-master'
2 parents 6b2fbe8 + 95e1365 commit 9d127c0

26 files changed

+1391
-615
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ Snowflake ![snowflake](https://cloud.githubusercontent.com/assets/1282364/115993
88
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/bartonhammond/snowflake/blob/master/LICENSE)
99

1010
---------------
11+
Navigation is handled with [React Native Router Flux](https://github.com/aksonov/react-native-router-flux)
1112

12-
Using Redux and Immutable, the state of the application is fully testable with Jest, currently at 86% coverage.
13+
Using [Redux](https://github.com/reactjs/react-redux) and [Immutable](https://facebook.github.io/immutable-js/), the state of the application is testable with Jest, currently at 80% coverage.
1314

1415
Snowflake supports Hot Reloading of its state. Snowflake uses CI with [Bitrise.io]( https://www.bitrise.io) and has extensive docs and 45+ min of video demonstating implementation.
1516

ios/Media.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@
119119
"version" : 1,
120120
"author" : "xcode"
121121
}
122-
}
122+
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snowflake",
3-
"version": "0.0.11",
3+
"version": "0.0.12",
44
"private": true,
55
"jest": {
66
"scriptPreprocessor": "jestSupport/scriptPreprocess.js",
@@ -20,6 +20,7 @@
2020
"unmockedModulePathPatterns": [
2121
"react",
2222
"react-addons-test-utils",
23+
"react-native-router-flux",
2324
"promise",
2425
"source-map",
2526
"key-mirror",
@@ -29,6 +30,7 @@
2930
"redux-thunk",
3031
"fbjs"
3132
],
33+
"collectCoverage": false,
3234
"verbose": true,
3335
"testPathDirs": [
3436
"src/"
@@ -47,9 +49,10 @@
4749
"key-mirror": "^1.0.1",
4850
"react-native": "^0.18.1",
4951
"react-native-gifted-spinner": "0.0.3",
52+
"react-native-navbar": "^1.2.1",
53+
"react-native-router-flux": "^2.3.1",
5054
"react-native-simple-store": "^0.1.0",
5155
"react-native-simpledialog-android": "^1.0.2",
52-
"react-native-tab-navigator": "^0.2.15",
5356
"react-native-vector-icons": "^1.1.0",
5457
"react-redux": "^4.1.1",
5558
"redux": "^3.1.2",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
Actions: {
3+
push: function() {},
4+
reset: function() {},
5+
pop: function() {}
6+
}
7+
}

src/components/LoginForm.js

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const {
2121
* States of login display
2222
*/
2323
const {
24-
LOGIN_STATE_REGISTER,
25-
LOGIN_STATE_LOGIN,
26-
LOGIN_STATE_FORGOT_PASSWORD
24+
REGISTER,
25+
LOGIN,
26+
FORGOT_PASSWORD
2727
} = require('../lib/constants').default;
2828

2929
/**
@@ -41,6 +41,7 @@ var LoginForm = React.createClass({
4141
* * onChange: function to call when user enters text
4242
*/
4343
propTypes: {
44+
formType: PropTypes.string,
4445
form: PropTypes.object,
4546
value: PropTypes.object,
4647
onChange: PropTypes.func
@@ -54,6 +55,8 @@ var LoginForm = React.createClass({
5455
*/
5556
render() {
5657

58+
let formType = this.props.formType;
59+
5760
let options = {
5861
auto: 'placeholders',
5962
fields: {
@@ -98,12 +101,12 @@ var LoginForm = React.createClass({
98101
};
99102

100103
let loginForm;
101-
switch(this.props.form.state) {
104+
switch(formType) {
102105
/**
103106
* ### Registration
104107
* The registration form has 4 fields
105108
*/
106-
case(LOGIN_STATE_REGISTER):
109+
case(REGISTER):
107110
loginForm = t.struct({
108111
username: t.String,
109112
email: t.String,
@@ -120,20 +123,20 @@ var LoginForm = React.createClass({
120123
* ### Login
121124
* The login form has only 2 fields
122125
*/
123-
case(LOGIN_STATE_LOGIN):
126+
case(LOGIN):
124127
loginForm = t.struct({
125128
username: t.String,
126129
password: t.String
127130
});
128131
options.fields['username'] = username;
129132
options.fields['password'] = password;
130-
break;
131-
132-
/**
133-
* ### Reset password
134-
* The password reset form has only 1 field
135-
*/
136-
case(LOGIN_STATE_FORGOT_PASSWORD):
133+
break;
134+
135+
/**
136+
* ### Reset password
137+
* The password reset form has only 1 field
138+
*/
139+
case(FORGOT_PASSWORD):
137140
loginForm = t.struct({
138141
email: t.String
139142
});
@@ -146,12 +149,12 @@ var LoginForm = React.createClass({
146149
* returns the Form component with the correct structures
147150
*/
148151
return (
149-
<Form ref="form"
150-
type={loginForm}
151-
options={options}
152-
value={this.props.value}
153-
onChange={this.props.onChange}
154-
/>
152+
<Form ref="form"
153+
type={loginForm}
154+
options={options}
155+
value={this.props.value}
156+
onChange={this.props.onChange}
157+
/>
155158

156159
);
157160
}

0 commit comments

Comments
 (0)