Fix whitespace

This commit is contained in:
Tanner Collin 2017-02-01 23:44:21 -07:00
parent 7f6fc32d74
commit 367ec26e79
11 changed files with 156 additions and 165 deletions

View File

@ -1,6 +1,5 @@
[android] [android]
target = Google Inc.:Google APIs:23 target = Google Inc.:Google APIs:23
[maven_repositories] [maven_repositories]
central = https://repo1.maven.org/maven2 central = https://repo1.maven.org/maven2

View File

@ -1,25 +1,25 @@
import * as types from './actionTypes'; import * as types from './actionTypes';
export function menuopen() { export function menuopen() {
return { return {
type: types.MENUOPEN type: types.MENUOPEN
}; };
} }
export function menuclose() { export function menuclose() {
return { return {
type: types.MENUCLOSE type: types.MENUCLOSE
}; };
} }
export function main() { export function main() {
return { return {
type: types.MAIN type: types.MAIN
}; };
} }
export function help() { export function help() {
return { return {
type: types.HELP type: types.HELP
}; };
} }

View File

@ -5,20 +5,20 @@ const styles = StyleSheet.create({
}); });
export default class Help extends Component { export default class Help extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
} }
render() { render() {
//const { counter } = this.props; //const { counter } = this.props;
return ( return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center' }}> <View style={{flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>This is a sample counter app.</Text> <Text>This is a sample counter app.</Text>
<Text>Press Increase to add 1 to the value.</Text> <Text>Press Increase to add 1 to the value.</Text>
<Text>Press Decrease to subtract 1 from the value.</Text> <Text>Press Decrease to subtract 1 from the value.</Text>
</View> </View>
); );
} }
} }

View File

@ -11,19 +11,19 @@ const styles = StyleSheet.create({
}); });
export default class Menu extends Component { export default class Menu extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
} }
render() { render() {
const { main, help } = this.props; const { main, help } = this.props;
return ( return (
<View style={styles.main}> <View style={styles.main}>
<Text onPress={main}>Calculator</Text> <Text onPress={main}>Calculator</Text>
<Text onPress={help}>Help</Text> <Text onPress={help}>Help</Text>
<Text>Link 4</Text> <Text>Link 4</Text>
</View> </View>
); );
} }
} }

View File

@ -78,7 +78,8 @@ class Resistor extends Component {
<Picker.Item label=" Ω" value="1" /> <Picker.Item label=" Ω" value="1" />
<Picker.Item label=" mΩ" value="0.001" /> <Picker.Item label=" mΩ" value="0.001" />
</Picker> </Picker>
<TouchableOpacity onPress={() => { <TouchableOpacity
onPress={() => {
console.log(this); console.log(this);
Alert.alert( Alert.alert(
'Clear resistor value?', 'Clear resistor value?',
@ -93,7 +94,8 @@ class Resistor extends Component {
{text: 'OK', onPress: clear}, {text: 'OK', onPress: clear},
] ]
) )
}} style={styles.clearbutton} activeOpacity={1} }}
style={styles.clearbutton} activeOpacity={1}
> >
<Text>Clear</Text> <Text>Clear</Text>
</TouchableOpacity> </TouchableOpacity>
@ -118,7 +120,7 @@ function mapStateToProps(state, ownProps) {
} }
export default connect(mapStateToProps, export default connect(mapStateToProps,
(dispatch) => ({ (dispatch) => ({
actions: bindActionCreators(calcActions, dispatch) actions: bindActionCreators(calcActions, dispatch)
}) })
)(Resistor); )(Resistor);

View File

@ -14,11 +14,11 @@ const reducer = combineReducers(reducers);
const store = createStoreWithMiddleware(reducer); const store = createStoreWithMiddleware(reducer);
export default class App extends Component { export default class App extends Component {
render() { render() {
return ( return (
<Provider store={store}> <Provider store={store}>
<Nav /> <Nav />
</Provider> </Provider>
); );
} }
} }

View File

@ -6,22 +6,18 @@ import Help from '../components/help';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
class HelpApp extends Component { class HelpApp extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
} }
render() { render() {
const { state, actions } = this.props; const { state, actions } = this.props;
return ( return (
<Help <Help {...actions} />
{...actions} /> );
); }
}
} }
export default connect(state => ({ export default connect(state => ({
}), }), (dispatch) => ({
(dispatch) => ({ }))(HelpApp);
})
)(HelpApp);

View File

@ -7,24 +7,22 @@ import * as menuActions from '../actions/menuActions';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
class MenuApp extends Component { class MenuApp extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
} }
render() { render() {
const { state, actions } = this.props; const { state, actions } = this.props;
return ( return (
<Menu {...actions} /> <Menu {...actions} />
); );
} }
} }
export default connect(state => ({ export default connect(state => ({
state: state state: state
}), }), (dispatch) => ({
(dispatch) => ({ actions: bindActionCreators(menuActions, dispatch)
actions: bindActionCreators(menuActions, dispatch) }))(MenuApp);
})
)(MenuApp);

View File

@ -10,61 +10,57 @@ import * as menuActions from '../actions/menuActions';
import MenuApp from '../containers/menuApp'; import MenuApp from '../containers/menuApp';
class Nav extends Component { class Nav extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
} }
render() { render() {
const { state, actions } = this.props; const { state, actions } = this.props;
const drawerStyles = { const drawerStyles = {
drawer: { shadowColor: '#000000', shadowOpacity: 0.8, shadowRadius: 3}, drawer: { shadowColor: '#000000', shadowOpacity: 0.8, shadowRadius: 3},
main: {paddingLeft: 3}, main: {paddingLeft: 3},
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
toolbar: { toolbar: {
backgroundColor: '#e9eaed', backgroundColor: '#e9eaed',
height: 56, height: 56,
}, },
}); });
return ( return (
<Drawer <Drawer
open={state.isOpen} open={state.isOpen}
type="overlay" type="overlay"
content={<MenuApp />} content={<MenuApp />}
tapToClose={true} tapToClose={true}
openDrawerOffset={0.3} openDrawerOffset={0.3}
captureGestures={false} captureGestures={false}
panCloseMask={0.3} panCloseMask={0.3}
closedDrawerOffset={-3} closedDrawerOffset={-3}
styles={drawerStyles} styles={drawerStyles}
tweenHandler={(ratio) => ({ tweenHandler={(ratio) => ({
main: { opacity: 1, }, main: { opacity: 1, },
mainOverlay: { opacity: ratio/2, backgroundColor: 'black', }, mainOverlay: { opacity: ratio/2, backgroundColor: 'black', },
})} })}
> >
<Ionicons.ToolbarAndroid <Ionicons.ToolbarAndroid
navIconName={"md-menu"} navIconName={"md-menu"}
onIconClicked={actions.menuopen} onIconClicked={actions.menuopen}
style={styles.toolbar} style={styles.toolbar}
subtitle={state.subtitle} subtitle={state.subtitle}
title="Exact Resistor Calculator" title="Exact Resistor Calculator"
/> />
<View style={{flex: 1}}> <View style={{flex: 1}}>
{state.page} {state.page}
</View> </View>
</Drawer> </Drawer>
); );
} }
} }
export default connect(state => ({ export default connect(state => ({
state: state.menu state: state.menu
}), }), (dispatch) => ({
(dispatch) => ({ actions: bindActionCreators(menuActions, dispatch)
actions: bindActionCreators(menuActions, dispatch) }))(Nav);
})
)(Nav);

View File

@ -2,6 +2,6 @@ import calc from './calc';
import menu from './menu'; import menu from './menu';
export { export {
calc, calc,
menu, menu,
}; };

View File

@ -12,32 +12,32 @@ const initialState = {
}; };
export default function menu(state = initialState, action = {}) { export default function menu(state = initialState, action = {}) {
switch (action.type) { switch (action.type) {
case types.MENUOPEN: case types.MENUOPEN:
return { return {
...state, ...state,
isOpen: true, isOpen: true,
}; };
case types.MENUCLOSE: case types.MENUCLOSE:
return { return {
...state, ...state,
isOpen: false, isOpen: false,
}; };
case types.MAIN: case types.MAIN:
return { return {
...state, ...state,
isOpen: false, isOpen: false,
page: <CalcApp />, page: <CalcApp />,
subtitle: 'Calculator Page', subtitle: 'Calculator Page',
}; };
case types.HELP: case types.HELP:
return { return {
...state, ...state,
isOpen: false, isOpen: false,
page: <HelpApp />, page: <HelpApp />,
subtitle: 'Help', subtitle: 'Help',
}; };
default: default:
return state; return state;
} }
} }