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]
target = Google Inc.:Google APIs:23
target = Google Inc.:Google APIs:23
[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';
export function menuopen() {
return {
type: types.MENUOPEN
};
return {
type: types.MENUOPEN
};
}
export function menuclose() {
return {
type: types.MENUCLOSE
};
return {
type: types.MENUCLOSE
};
}
export function main() {
return {
type: types.MAIN
};
return {
type: types.MAIN
};
}
export function help() {
return {
type: types.HELP
};
return {
type: types.HELP
};
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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