Skip to content

Show loading text on incomplete exchange rate - #9

Merged
paullinator merged 4 commits into
developfrom
fix/exchange-rate-loading
Sep 21, 2017
Merged

Show loading text on incomplete exchange rate#9
paullinator merged 4 commits into
developfrom
fix/exchange-rate-loading

Conversation

@wolverineks

Copy link
Copy Markdown
Contributor

Move all loading text and logic into the ExchangeRate component
Display loading text when ExchangeRate has incomplete data
Localize text in exchange rate component

}
})

const EXCHANGE_RATE_LOADING_TEXT = sprintf(strings.enUS['drawer_exchange_rate_loading'])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sprintf is not needed as there is no string replacement happening

secondaryDisplayAmount: string,
cryptoCurrencyCode: string,
fiatSymbol: string,
fiatExchangeAmount: string, fiatCurrencyCode: string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fiatCurrencyCode should be on a newline

@paullinator paullinator Sep 19, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could have saved a lot of typing and made this routine clearer to read by making completeData accept separate parameters vs an object.

@paullinator paullinator left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary use of sprintf and cleanup completeData and this is good to go

Sprintf not needed as the display text does not require interpolation
Data validation moved out of the component to improve readability
Tests added to exercise the data validation
this.props.secondaryDisplayAmount === 0
? <Text style={styles.text}>Exchange Rate loading...</Text>
!this.completeData({secondaryDisplayAmount, cryptoCurrencyCode, fiatSymbol, fiatExchangeAmount, fiatCurrencyCode})
? <Text style={styles.text}>

@smilingkylan smilingkylan Sep 20, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wolverineks Is this <Text> element the default from react-native? If so, then please use the FormattedText component instead so that it has correct font, etc.

Rest looks fine to me.

@paullinator

paullinator commented Sep 21, 2017

Copy link
Copy Markdown
Member

I approve the PR but it needs merge conflicts resolved

@paullinator
paullinator merged commit 5859d5e into develop Sep 21, 2017
@thehobbit85
thehobbit85 deleted the fix/exchange-rate-loading branch September 22, 2017 01:34
@j0ntz j0ntz mentioned this pull request Jul 24, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants