diff --git a/components/Timer/Timer.js b/components/Timer/Timer.js index 112c336..c3d376f 100644 --- a/components/Timer/Timer.js +++ b/components/Timer/Timer.js @@ -1,5 +1,5 @@ import React, { Component } from "react"; -import { StyleSheet } from "react-native"; +import { StyleSheet, Dimensions } from "react-native"; import { Actions } from "react-native-router-flux"; import { connect } from "react-redux"; import { increaseTime, decreaseTime, countdown, clearTime, resetTime, updateAlarmLog } from "../../store/actions"; @@ -74,7 +74,7 @@ class Timer extends Component { return ( { const onPress = async () => { if (!throttle) { setThrottle(true); - await props.onPress(); buttonTimeout.current = setTimeout(() => setThrottle(false), 300); + await props.onPress(); } }; @@ -69,7 +69,7 @@ Button.defaultProps = { /* Styles */ const baseButtonStyles = { - margin: theme.layout.margin, + margin: theme.layout.padding, alignItems: "center", justifyContent: "center", flexShrink: 1 diff --git a/components/buttons/IconButton.js b/components/buttons/IconButton.js index 5b5af1a..286adfb 100644 --- a/components/buttons/IconButton.js +++ b/components/buttons/IconButton.js @@ -18,8 +18,8 @@ const IconButton = (props) => { const onPress = async () => { if (!throttle) { setThrottle(true); - await props.onPress(); buttonTimeout.current = setTimeout(() => setThrottle(false), 300); + await props.onPress(); } }; @@ -77,7 +77,7 @@ IconButton.propTypes = { IconButton.defaultProps = { variant: "counter", name: "md-pin", - size: 42, + size: theme.buttons.iconSize, color: theme.colors.green, counterValue: 0 }; diff --git a/components/drawer/DrawerContent.js b/components/drawer/DrawerContent.js index 268eece..5dc8ff9 100644 --- a/components/drawer/DrawerContent.js +++ b/components/drawer/DrawerContent.js @@ -50,7 +50,7 @@ const DrawerContent = (props) => { { name: "Using", function: Actions.using }, { name: "Responding", function: Actions.responding }, { name: "User Profile", function: Actions.profile }, - { name: "Resource", function: Actions.resource }, + { name: "Resources", function: Actions.resource }, { name: "Logout", function: () => { Actions.modal(modalParams) } }, ]; diff --git a/components/forms/Input.js b/components/forms/Input.js index fd8d79b..b68d4bf 100644 --- a/components/forms/Input.js +++ b/components/forms/Input.js @@ -40,12 +40,16 @@ const Input = React.forwardRef((props, ref) => { props.onChangeText(value, !result); }); + const passwordIcon = passwordHidden? "md-eye" : "md-eye-off"; return ( - + - + { + props.label && + + } { /> {/* For password inputs, add an icon to show/hide password */} - {(props.variant == "password") && ( - (passwordHidden)? - setPasswordHidden(false)} /> - : - setPasswordHidden(true)} /> - )} + { + (props.variant == "password") && + setPasswordHidden(false)} /> + } @@ -80,7 +82,8 @@ const Input = React.forwardRef((props, ref) => { Input.propTypes = { variant: PropTypes.oneOf([ "text", "password", "number"]), - label: PropTypes.string.isRequired, + label: PropTypes.string, + placeholder: PropTypes.string, hasNext: PropTypes.bool, refresh: PropTypes.bool, constraints: PropTypes.object, @@ -122,7 +125,6 @@ const baseStyles = { const noErrorInputStyles = StyleSheet.create({ item: { ...baseStyles, - marginTop: theme.layout.margin, backgroundColor: theme.colors.white // Match the background color }, label: { diff --git a/components/layout/Banner.js b/components/layout/Banner.js index 0ce6d4f..8648d91 100644 --- a/components/layout/Banner.js +++ b/components/layout/Banner.js @@ -18,9 +18,7 @@ const bannerStyles = StyleSheet.create({ flexDirection: "row", alignItems: "center", justifyContent: "space-between", - height: theme.layout.bannerHeight, - padding: theme.layout.padding, - overflow: "hidden" + padding: theme.layout.padding } }); diff --git a/components/layout/Content.js b/components/layout/Content.js index f40f0aa..59205d4 100644 --- a/components/layout/Content.js +++ b/components/layout/Content.js @@ -15,7 +15,7 @@ const Content = (props) => { const contentStyles = StyleSheet.create({ content: { flex: 1, - padding: (theme.layout.padding + theme.layout.margin) + padding: theme.layout.margin } }); diff --git a/components/layout/Segment.js b/components/layout/Segment.js index 4ade659..fff42c3 100644 --- a/components/layout/Segment.js +++ b/components/layout/Segment.js @@ -8,7 +8,7 @@ import View from "./View"; const Segment = (props) => { return ( - + { - - - diff --git a/screens/LocationScreen.js b/screens/LocationScreen.js index 8fdf343..755076d 100644 --- a/screens/LocationScreen.js +++ b/screens/LocationScreen.js @@ -135,7 +135,7 @@ const LocationScreen = (props) => { />
- setAddress(text)} placeholder="Enter address" @@ -146,7 +146,7 @@ const LocationScreen = (props) => { multiline onSubmitEditing={() => { notesInputRef._root.focus() }} /> - notesInputRef = input} variant="text" onChangeText={text => setNote(text)} diff --git a/screens/LoginScreen.js b/screens/LoginScreen.js index beda582..7ceef65 100644 --- a/screens/LoginScreen.js +++ b/screens/LoginScreen.js @@ -76,7 +76,7 @@ class LoginScreen extends Component { /> - + - - - @@ -103,20 +100,17 @@ const styles = StyleSheet.create({ flex: 0, }, rememberMe: { - flex: 2, + flex: 0, flexDirection: "row", - marginTop: theme.layout.margin, + marginBottom: theme.layout.margin, alignSelf: "flex-end", + justifyContent: "flex-start" }, rememberMeSwitch: { marginLeft: theme.layout.margin, }, - loginButton: { - flex: 6, - justifyContent: "flex-start", - }, - signupButton: { - flex: 3, + buttons: { + justifyContent: "space-around" } }); diff --git a/screens/ResourceScreen.js b/screens/ResourceScreen.js index 9f135c5..9c9a722 100644 --- a/screens/ResourceScreen.js +++ b/screens/ResourceScreen.js @@ -1,21 +1,20 @@ import React from "react"; -import { - StyleSheet -} from "react-native"; +import { StyleSheet } from "react-native"; import { Button } from "../components/buttons"; import { Actions } from "react-native-router-flux"; import { Container, Content, Header, View } from "../components/layout"; +import theme from "../styles/base"; const ResourceScreen = () => { return (
Actions.drawerOpen()}>Resources
- + - + @@ -24,9 +23,12 @@ const ResourceScreen = () => { } const styles = StyleSheet.create({ + view: { + paddingVertical: theme.layout.margin, + justifyContent: "space-around" + }, button: { - width: "100%", - height: "12%" + width: "100%" } }); diff --git a/screens/RespondingScreen.js b/screens/RespondingScreen.js index c1c4d4d..59c6764 100644 --- a/screens/RespondingScreen.js +++ b/screens/RespondingScreen.js @@ -56,7 +56,9 @@ const RespondingScreen = props => { - I am available with Naloxone + + I am available with Naloxone + - - - You'll receive a verification code via text. -
@@ -112,18 +108,14 @@ class SignupScreen extends Component { const styles = StyleSheet.create({ title: { - flex: 0, + flex: 0 }, loginInfo: { - flex: 0, + flex: 0 }, signupButton: { - flex: 1, - }, - message: { - flex: 0, - justifyContent: "flex-start", - }, + flex: 1 + } }); const mapStateToProps = (state) => { diff --git a/screens/SnoozeScreen.js b/screens/SnoozeScreen.js index f67fd7b..ca152d7 100644 --- a/screens/SnoozeScreen.js +++ b/screens/SnoozeScreen.js @@ -104,10 +104,12 @@ class SnoozeScreen extends Component { const styles = StyleSheet.create({ text: { color: theme.colors.white, + paddingVertical: theme.layout.margin, + textAlign: "center" }, numeral: { color: theme.colors.white, - paddingVertical: 80 + paddingVertical: "10%" } }); diff --git a/screens/UsingScreen.js b/screens/UsingScreen.js index c8af8f6..ab8e928 100644 --- a/screens/UsingScreen.js +++ b/screens/UsingScreen.js @@ -7,6 +7,7 @@ import { Container, Content, Header, View, Segment, Banner } from "../components import { Button, IconButton } from "../components/buttons"; import { convertToAddressAsync } from "../utils"; import { makeAlarmLog, getNumberOfAvailableResponders, setLocalLocation, getMyResponders } from "../store/actions"; +import theme from "../styles/base"; // const fredVictorCoordinates = { // lat: 43.6536212, @@ -136,15 +137,14 @@ const UsingScreen = props => { - - Actions.responding()} - /> - - + Actions.responding()} + /> + { }; const styles = StyleSheet.create({ + segment: { + flex: 0 + }, + icons: { + flex: 0, + flexGrow: 1, + padding: theme.layout.padding + }, timer: { - flex: 5 + flex: 0, + flexGrow: 2 }, startButton: { - flex: 2 + flex: 3 } }); diff --git a/screens/modals/ResponderHelpRequestModal.js b/screens/modals/ResponderHelpRequestModal.js index dcc2256..7c3f215 100644 --- a/screens/modals/ResponderHelpRequestModal.js +++ b/screens/modals/ResponderHelpRequestModal.js @@ -65,12 +65,13 @@ const ResponderHelpRequestModal = (props) => { {address || "Location not specified."}