Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #779 from LedgerHQ/develop
Browse files Browse the repository at this point in the history
1.1.11 patches
  • Loading branch information
gre authored Feb 18, 2019
2 parents e0be43b + 7b55fd5 commit 3bc4c9a
Show file tree
Hide file tree
Showing 40 changed files with 1,503 additions and 864 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
}
},
"dependencies": {
"@ledgerhq/errors": "4.38.0",
"@ledgerhq/errors": "4.39.0",
"@ledgerhq/hw-app-btc": "4.38.0",
"@ledgerhq/hw-app-eth": "4.38.0",
"@ledgerhq/hw-app-xrp": "4.38.0",
"@ledgerhq/hw-transport": "4.38.0",
"@ledgerhq/hw-transport-http": "4.38.0",
"@ledgerhq/live-common": "4.16.1",
"@ledgerhq/live-common": "4.19.0",
"@ledgerhq/react-native-hid": "4.38.0",
"@ledgerhq/react-native-hw-transport-ble": "4.38.5",
"@ledgerhq/react-native-ledger-core": "^0.3.45",
Expand Down
1 change: 1 addition & 0 deletions src/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
green: "rgb(102, 190, 84)",
black: "#000000",
orange: "#ff7701",
yellow: "#ffd24a",

/* DERIVATIVES */
lightLive: "#4b84ff19",
Expand Down
26 changes: 23 additions & 3 deletions src/components/DeviceItemSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Touchable from "./Touchable";
import LText from "./LText";
import colors from "../colors";
import IconNanoX from "../icons/NanoX";
import Alert from "../icons/Alert";

type Props = {
deviceId: string,
Expand All @@ -36,11 +37,26 @@ class DeviceItemSummary extends PureComponent<Props> {
<Trans i18nKey="DeviceItemSummary.genuine" />
{" "}
</LText>
<Circle bg={colors.live} size={20}>
<Icon name="check" size={14} color={colors.white} />
<Circle bg={colors.live} size={14}>
<Icon name="check" size={10} color={colors.white} />
</Circle>
</View>
) : null}
) : (
<View style={styles.genuine}>
<LText
numberOfLines={1}
style={[styles.genuineText, styles.genuineFailed]}
>
<Trans i18nKey="DeviceItemSummary.genuineFailed">
{"Genuine check "}
<LText semiBold>failed</LText>
</Trans>
</LText>
<Circle bg={colors.yellow} size={14}>
<Alert size={10} color={colors.white} />
</Circle>
</View>
)}
</View>
<Touchable event="DeviceItemEdit" onPress={onEdit}>
<LText bold numberOfLines={1} style={styles.editText}>
Expand Down Expand Up @@ -91,7 +107,11 @@ const styles = StyleSheet.create({
fontSize: 14,
color: colors.smoke,
},
genuineFailed: {
marginRight: 6,
},
editText: {
color: colors.live,
fontSize: 14,
},
});
16 changes: 9 additions & 7 deletions src/components/ExchangeCard.js → src/components/PartnerCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Props = {
t: T,
};

export default class ExchangeCard extends Component<Props> {
export default class PartnerCard extends Component<Props> {
onClick = () => {
const { card } = this.props;
Linking.openURL(card.url).catch(err =>
Expand All @@ -24,21 +24,23 @@ export default class ExchangeCard extends Component<Props> {

render() {
const {
card: { logo, url, id },
card: { Logo, url, id },
t,
} = this.props;

return (
<Card style={styles.cardStyle}>
<View style={styles.cardTextBlock}>
<View style={styles.logoContainer}>{logo}</View>
<LText style={styles.description}>{t(`exchange.${id}`)}</LText>
<View style={styles.logoContainer}>
<Logo />
</View>
<LText style={styles.description}>{t(`partners.${id}`)}</LText>
<View>
<Button
event="OpenExchange"
eventProperties={{ exchange: id, exchangeUrl: url }}
event="OpenPartner"
eventProperties={{ partner: id, partnerUrl: url }}
type="tertiary"
title={<Trans i18nKey="exchange.visit" />}
title={<Trans i18nKey="partners.visit" />}
onPress={this.onClick}
/>
</View>
Expand Down
12 changes: 8 additions & 4 deletions src/components/SettingsRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default class SettingsRow extends Component<{
eventProperties={eventProperties}
>
{iconLeft && <View style={styles.iconLeft}>{iconLeft}</View>}
<View style={styles.textBlock}>
<View style={[styles.textBlock, { marginLeft: iconLeft ? 0 : 16 }]}>
{title$}
{desc &&
!noTextDesc && <LText style={styles.description}>{desc}</LText>}
Expand Down Expand Up @@ -105,11 +105,10 @@ const styles = StyleSheet.create({
root: {
minHeight: 50,
flexDirection: "row",
alignItems: "center",
paddingHorizontal: 16,
paddingVertical: 24,
backgroundColor: "white",
marginBottom: 2,
justifyContent: "space-between",
},
rootAlignedTop: {
alignItems: "flex-start",
Expand All @@ -121,13 +120,17 @@ const styles = StyleSheet.create({
paddingVertical: 16,
},
textBlock: {
marginRight: "auto",
paddingRight: 16,
flexGrow: 1,
flexShrink: 1,
},
rightBlock: {
flexDirection: "row",
alignItems: "center",
justifyContent: "flex-end",
flexShrink: 0,
maxWidth: "50%",
marginRight: 16,
},
titleContainer: {
flexDirection: "row",
Expand All @@ -151,6 +154,7 @@ const styles = StyleSheet.create({
},
iconLeft: {
paddingRight: 16,
marginLeft: 16,
},
iconLeftContainer: {
marginRight: 8,
Expand Down
102 changes: 0 additions & 102 deletions src/config/exchange.js

This file was deleted.

22 changes: 10 additions & 12 deletions src/context/AuthPass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const mapStateToProps = createStructuredSelector({
type State = {
isLocked: boolean,
biometricsError: ?Error,
appState: string,
};

type Props = {
Expand All @@ -34,6 +35,7 @@ class AuthPass extends PureComponent<Props, State> {
state = {
isLocked: !!this.props.privacy && !wasUnlocked,
biometricsError: null,
appState: AppState.currentState || "",
};

static getDerivedStateFromProps({ privacy }, { isLocked }) {
Expand All @@ -48,24 +50,20 @@ class AuthPass extends PureComponent<Props, State> {
AppState.addEventListener("change", this.handleAppStateChange);
}

timeout: *;
appInBg: number;

handleAppStateChange = appState => {
clearTimeout(this.timeout);
if (appState === "background") {
this.appInBg = Date.now();
this.timeout = setTimeout(() => {
if (!this.state.isLocked) {
this.lock();
}
}, AUTOLOCK_TIMEOUT);
} else if (
appState === "active" &&
handleAppStateChange = nextAppState => {
if (
this.state.appState.match(/inactive|background/) &&
nextAppState === "active" &&
this.appInBg + AUTOLOCK_TIMEOUT < Date.now()
) {
this.lock();
this.appInBg = Date.now();
} else if (nextAppState === "background") {
this.appInBg = Date.now();
}
this.setState({ appState: nextAppState });
};

// auth: try to auth with biometrics and fallback on password
Expand Down
Loading

0 comments on commit 3bc4c9a

Please sign in to comment.