diff --git a/assets/images/SVG/Bitcoin.svg b/assets/images/SVG/Bitcoin.svg index f8dd3d1c7..57d1b3596 100644 --- a/assets/images/SVG/Bitcoin.svg +++ b/assets/images/SVG/Bitcoin.svg @@ -1,3 +1,3 @@ - + diff --git a/components/Button.tsx b/components/Button.tsx index 91d88b9a7..e5c48cfd2 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -10,11 +10,13 @@ interface ButtonProps { secondary?: boolean; tertiary?: boolean; quaternary?: boolean; + quinary?: boolean; iconOnly?: boolean; adaptiveWidth?: boolean; containerStyle?: any; buttonStyle?: any; noUppercase?: boolean; + disabled?: boolean; } function Button(props: ButtonProps) { @@ -26,11 +28,13 @@ function Button(props: ButtonProps) { secondary, tertiary, quaternary, + quinary, iconOnly, adaptiveWidth, containerStyle, buttonStyle, - noUppercase + noUppercase, + disabled } = props; const newContainerStyle: any = adaptiveWidth @@ -83,6 +87,8 @@ function Button(props: ButtonProps) { : { backgroundColor: iconOnly ? 'transparent' + : quinary + ? themeColor('secondary') : quaternary ? themeColor('background') : tertiary @@ -101,6 +107,8 @@ function Button(props: ButtonProps) { } : { color: iconOnly + ? themeColor('text') + : quinary ? themeColor('text') : quaternary ? themeColor('text') @@ -113,6 +121,7 @@ function Button(props: ButtonProps) { } onPress={onPress} containerStyle={newContainerStyle} + disabled={disabled} /> ); } diff --git a/components/PinPad.tsx b/components/PinPad.tsx index f633a1539..b286da6ac 100644 --- a/components/PinPad.tsx +++ b/components/PinPad.tsx @@ -16,6 +16,7 @@ interface PinPadProps { minLength?: number; maxLength?: number; numberHighlight?: boolean; + amount?: boolean; } export default function PinPad({ @@ -27,7 +28,8 @@ export default function PinPad({ hidePinLength = false, minLength = 4, maxLength = 8, - numberHighlight = false + numberHighlight = false, + amount = false }: PinPadProps) { // PinPad state only depends on pin value length, not the actual pin/amount value // Parent component to PinPad can store pin/amount value @@ -65,7 +67,7 @@ export default function PinPad({ }; return ( - + { @@ -163,16 +165,28 @@ export default function PinPad({ - { - decrementPinValueLength(); - deleteValue(); - }} - highlight={numberHighlight} - style={styles.key} - > - {'<'} - + {amount ? ( + { + appendValue('.'); + }} + highlight={numberHighlight} + style={styles.key} + > + {'.'} + + ) : ( + { + decrementPinValueLength(); + deleteValue(); + }} + highlight={numberHighlight} + style={styles.key} + > + {'<'} + + )} { incrementPinValueLength(); @@ -183,18 +197,30 @@ export default function PinPad({ > {pinNumbers[0]} - {!hidePinLength && ( - { - clearPinValueLength(); - clearValue(); - }} - highlight={numberHighlight} - style={styles.key} - > - C - - )} + {!hidePinLength && + (amount ? ( + { + decrementPinValueLength(); + deleteValue(); + }} + highlight={numberHighlight} + style={styles.key} + > + {'<'} + + ) : ( + { + clearPinValueLength(); + clearValue(); + }} + highlight={numberHighlight} + style={styles.key} + > + C + + ))} {!!hidePinLength && pinValueLength >= minLength && ( { @@ -226,7 +252,7 @@ const styles = StyleSheet.create({ fontSize: 20, fontFamily: 'Lato-Bold' }, - bottom: { + pad: { justifyContent: 'flex-end', marginBottom: 25 }, diff --git a/components/UnitToggle.tsx b/components/UnitToggle.tsx new file mode 100644 index 000000000..c5058de09 --- /dev/null +++ b/components/UnitToggle.tsx @@ -0,0 +1,43 @@ +import * as React from 'react'; +import { inject, observer } from 'mobx-react'; + +import Button from './../components/Button'; + +import UnitsStore from './../stores/UnitsStore'; +import SettingsStore from './../stores/SettingsStore'; + +interface UnitToggleProps { + UnitsStore: UnitsStore; + SettingsStore: SettingsStore; + onToggle?: () => void; +} + +@inject('UnitsStore', 'SettingsStore') +@observer +export default class UnitToggle extends React.Component { + render() { + const { UnitsStore, SettingsStore, onToggle } = this.props; + const { changeUnits, units } = UnitsStore; + const { settings } = SettingsStore; + const { fiat } = settings; + + return ( + +