-
-
Notifications
You must be signed in to change notification settings - Fork 864
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade RN0.28, Add Redux, Add Styleguide, Ready for Android
- Loading branch information
Showing
46 changed files
with
973 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ project.xcworkspace | |
|
||
# Android/IJ | ||
# | ||
*.iml | ||
.idea | ||
.gradle | ||
local.properties | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Sidemenu Actions | ||
* | ||
* React Native Starter App | ||
* https://github.com/mcnamee/react-native-starter-app | ||
*/ | ||
'use strict'; | ||
|
||
export function toggle() { | ||
return { | ||
type: 'SIDEMENU_TOGGLE' | ||
} | ||
} | ||
|
||
export function open() { | ||
return { | ||
type: 'SIDEMENU_OPEN' | ||
} | ||
} | ||
|
||
export function close() { | ||
return { | ||
type: 'SIDEMENU_CLOSE' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/** | ||
* Alerts - Status/Success/Error Messages | ||
* | ||
* USAGE: | ||
<Alerts status={'Something\'s happening...'} success={'Hello Success'} error={'Error hey'} /> | ||
* | ||
* React Native Starter App | ||
* https://github.com/mcnamee/react-native-starter-app | ||
*/ | ||
'use strict'; | ||
|
||
/* Setup ==================================================================== */ | ||
import React, { Component } from 'react' | ||
import { | ||
StyleSheet, | ||
View, | ||
Text, | ||
} from 'react-native' | ||
|
||
// App Globals | ||
import AppStyles from '../styles' | ||
|
||
/* Component ==================================================================== */ | ||
class Alerts extends Component { | ||
static propTypes = { | ||
status: React.PropTypes.string, | ||
success: React.PropTypes.string, | ||
error: React.PropTypes.string, | ||
} | ||
|
||
static defaultProps = { | ||
status: '', | ||
success: '', | ||
error: '', | ||
} | ||
|
||
render = () => { | ||
let { status, success, error } = this.props; | ||
|
||
// Allows you to show both error and success | ||
return ( | ||
<View style={styles.alerts}> | ||
{success != '' && | ||
<View> | ||
<View style={[styles.msg]}> | ||
<Text style={[AppStyles.baseText, styles.msg_text]}>{success}</Text> | ||
</View> | ||
<View style={AppStyles.spacer_20} /> | ||
</View> | ||
} | ||
|
||
{status != '' && | ||
<View> | ||
<View style={[styles.msg, styles.msgStatus]}> | ||
<Text style={[AppStyles.baseText, styles.msg_text, styles.msgStatus_text]}>{status}</Text> | ||
</View> | ||
<View style={AppStyles.spacer_20} /> | ||
</View> | ||
} | ||
|
||
{error != '' && | ||
<View> | ||
<View style={[styles.msg, styles.msgError]}> | ||
<Text style={[AppStyles.baseText, styles.msg_text, styles.msgError_text]}>{error}</Text> | ||
</View> | ||
<View style={AppStyles.spacer_20} /> | ||
</View> | ||
} | ||
</View> | ||
) | ||
} | ||
} | ||
|
||
/* Styles ==================================================================== */ | ||
const styles = StyleSheet.create({ | ||
alerts: { | ||
left: 0, | ||
right: 0, | ||
}, | ||
// Success | ||
msg: { | ||
right: 0, | ||
left: 0, | ||
paddingVertical: 10, | ||
paddingHorizontal: 10, | ||
borderLeftWidth: 3, | ||
borderColor: "#1C854C", | ||
backgroundColor: "#59DC9A", | ||
// borderRadius: 2, | ||
}, | ||
msg_text: { | ||
textAlign: "center", | ||
color: "#16693c", | ||
fontWeight: "500" | ||
}, | ||
|
||
// Error | ||
msgError: { | ||
borderColor: "#C02827", | ||
backgroundColor: "#FB6567", | ||
}, | ||
msgError_text: { | ||
color: "#7f1a1a", | ||
}, | ||
|
||
// Status | ||
msgStatus: { | ||
borderColor: "#408491", | ||
backgroundColor: "#8EDBE5", | ||
}, | ||
msgStatus_text: { | ||
color: "#2f606a", | ||
}, | ||
}); | ||
|
||
/* Export Component ==================================================================== */ | ||
export default Alerts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Error Screen | ||
* | ||
<Error text={'Server is down'} /> | ||
* | ||
* React Native Starter App | ||
* https://github.com/mcnamee/react-native-starter-app | ||
*/ | ||
'use strict'; | ||
|
||
/* Setup ==================================================================== */ | ||
import React, { Component } from 'react' | ||
import { | ||
View, | ||
Text, | ||
} from 'react-native' | ||
import Icon from 'react-native-vector-icons/Ionicons'; | ||
|
||
// App Globals | ||
import AppStyles from '../styles' | ||
import AppConfig from '../config' | ||
|
||
/* Component ==================================================================== */ | ||
class Error extends Component { | ||
render = () => { | ||
// What are we Erroring? | ||
var text = this.props.text || 'Woops, Something wen\'t wrong.'; | ||
|
||
return ( | ||
<View style={[AppStyles.container, AppStyles.containerCentered]}> | ||
<Icon name={'ios-alert-outline'} size={50} color={"#CCC"} /> | ||
|
||
<View style={[AppStyles.spacer_10]} /> | ||
|
||
<Text style={[AppStyles.baseText]}>{text}</Text> | ||
</View> | ||
); | ||
} | ||
} | ||
|
||
/* Export Component ==================================================================== */ | ||
export default Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.