-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for 24 word wallets (#1014)
* poc add expandable component UI feedback remaining work * bug fixes * remove chimericAccountAddr and add rewardAddressHex in wallet classes and state. Rationale: Having the reward address in redux's state was necessary for tx history UI logic (in particular, to know if deregistration tx concerns the current wallet). Note: chimericAccountAddr was used during the ITN era but is not used anywhere now. Replaced by rewardAddressHex because it's more ituitive. * flow fix * rename DAEDALUS_HASKELL_SHELLEY by HASKELL_SHELLEY_24, plus other minor changes * use generic intl description message for non-15-word wallets * add utility function to derive reward address * (missing in previous commit) * refactor processTxHistoryData to match logic in yoroi extension. Use fee from backend when available * keep fees negative in UI * use account index from config and update jest snapshot of tx history
- Loading branch information
1 parent
924a6c1
commit a40ac5e
Showing
37 changed files
with
486 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// @flow | ||
import React from 'react' | ||
import {compose} from 'redux' | ||
import {withStateHandlers} from 'recompose' | ||
import {TouchableOpacity, View, Image} from 'react-native' | ||
|
||
import {Text} from '../UiKit' | ||
import chevronDown from '../../assets/img/chevron_down.png' | ||
import chevronUp from '../../assets/img/chevron_up.png' | ||
|
||
import styles from './styles/ExpandableItem.style' | ||
|
||
import type {ComponentType} from 'react' | ||
|
||
type Props = { | ||
label: string, | ||
content: string, | ||
disabled?: boolean, | ||
onPress: () => void, | ||
expanded: boolean, | ||
style?: Object, | ||
} | ||
|
||
export const ExpandableItem = ({ | ||
label, | ||
content, | ||
disabled, | ||
onPress, | ||
expanded, | ||
style, | ||
}: Props) => ( | ||
<TouchableOpacity onPress={onPress} activeOpacity={0.5}> | ||
<View style={style}> | ||
<View style={styles.labelWrapper}> | ||
<Text secondary style={[disabled === true && styles.disabled]}> | ||
{label} | ||
</Text> | ||
<Image | ||
style={styles.icon} | ||
source={expanded ? chevronUp : chevronDown} | ||
/> | ||
</View> | ||
{expanded && ( | ||
<View style={styles.contentWrapper}> | ||
<Text>{content}</Text> | ||
</View> | ||
)} | ||
</View> | ||
</TouchableOpacity> | ||
) | ||
|
||
type ExternalProps = { | ||
label: string, | ||
content: string, | ||
disabled?: boolean, | ||
style?: Object, | ||
} | ||
|
||
export default (compose( | ||
withStateHandlers( | ||
{ | ||
expanded: false, | ||
}, | ||
{ | ||
onPress: (state) => () => ({expanded: !state.expanded}), | ||
}, | ||
), | ||
)(ExpandableItem): ComponentType<ExternalProps>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// @flow | ||
import {StyleSheet} from 'react-native' | ||
|
||
import {COLORS} from '../../../styles/config' | ||
|
||
export default StyleSheet.create({ | ||
labelWrapper: { | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
padding: 12, | ||
}, | ||
icon: { | ||
marginLeft: 5, | ||
}, | ||
disabled: { | ||
color: COLORS.DISABLED, | ||
}, | ||
contentWrapper: { | ||
padding: 16, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.