Skip to content

Commit

Permalink
V almonacid/ch6154/misc ui ux improvements part 2 (#977)
Browse files Browse the repository at this point in the history
* remove network in app settings (forgot this in previous PR)

* fix crash when switching wallets

* change wording: 'Total ADA' by 'Available funds'

* fix overflow in copy address button
  • Loading branch information
v-almonacid committed Sep 21, 2020
1 parent 0923ded commit ba7082f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 18 deletions.
7 changes: 1 addition & 6 deletions src/components/Delegation/StakingDashboard.js
Expand Up @@ -191,11 +191,6 @@ class StakingDashboard extends React.Component<Props, State> {
navigation,
} = this.props

const totalBalance =
utxoBalance != null && accountBalance != null
? utxoBalance.plus(accountBalance)
: null

// TODO: shouldn't be haskell-shelley specific
const config = {
StartAt: CONFIG.NETWORKS.HASKELL_SHELLEY.START_AT,
Expand Down Expand Up @@ -289,7 +284,7 @@ class StakingDashboard extends React.Component<Props, State> {
/>
<UserSummary
totalAdaSum={
totalBalance != null ? formatAdaWithText(totalBalance) : '-'
utxoBalance != null ? formatAdaWithText(utxoBalance) : '-'
}
totalRewards={
accountBalance != null ? formatAdaWithText(accountBalance) : '-'
Expand Down
2 changes: 1 addition & 1 deletion src/components/Delegation/dashboard/UserSummary.js
Expand Up @@ -49,7 +49,7 @@ const UserSummary = ({
</View>
<View style={styles.amountBlock}>
<Text style={styles.label}>
{intl.formatMessage(globalMessages.totalAda)}:
{intl.formatMessage(globalMessages.availableFunds)}:
</Text>
<Text bold style={styles.value}>
{totalAdaSum}
Expand Down
9 changes: 0 additions & 9 deletions src/components/Settings/ApplicationSettingsScreen.js
Expand Up @@ -93,10 +93,6 @@ const messages = defineMessages({
id: 'components.settings.applicationsettingsscreen.version',
defaultMessage: '!!!Current version:',
},
network: {
id: 'components.settings.applicationsettingsscreen.network',
defaultMessage: '!!!Network:',
},
commit: {
id: 'components.settings.applicationsettingsscreen.commit',
defaultMessage: '!!!Commit:',
Expand Down Expand Up @@ -233,11 +229,6 @@ const ApplicationSettingsScreen = ({
value={version}
/>

<SettingsBuildItem
label={intl.formatMessage(messages.network)}
value={'Byron Mainnet / Shelley Testnet'}
/>

<SettingsBuildItem
label={intl.formatMessage(messages.commit)}
value={CONFIG.COMMIT}
Expand Down
9 changes: 7 additions & 2 deletions src/components/Settings/WalletSettingsScreen.js
Expand Up @@ -109,8 +109,13 @@ const styles = StyleSheet.create({
})

const _getNetworkName = (networkId: NetworkId) => {
const config = getNetworkConfigById(networkId)
return config.MARKETING_NAME
// note(v-almonacid): this throws when switching wallet
try {
const config = getNetworkConfigById(networkId)
return config.MARKETING_NAME
} catch (_e) {
return '-'
}
}

const _getWalletType = (implId: WalletImplementationId): ?MessageDescriptor => {
Expand Down
Expand Up @@ -43,6 +43,7 @@ export default StyleSheet.create({
flexDirection: 'row',
alignItems: 'center',
paddingBottom: 10,
flexWrap: 'wrap',
},
copyIcon: {
marginLeft: 4,
Expand Down

0 comments on commit ba7082f

Please sign in to comment.