Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
don't show USD conversion in wallet monthly tip
Browse files Browse the repository at this point in the history
  • Loading branch information
cg505 committed Jun 4, 2019
1 parent 0139aa3 commit 8113333
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
23 changes: 13 additions & 10 deletions src/features/rewards/walletPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
StyleToggleTips,
StyledNoticeWrapper,
StyledNoticeLink,
StyledOptionShown,
StyledProfileWrapper,
StyledSelect
} from './style'
Expand Down Expand Up @@ -98,25 +99,27 @@ export default class WalletPanel extends React.PureComponent<Props, {}> {
return (
<StyledSelectWrapper>
<StyledSelect
value={monthlyAmount}
value={'show'}
onChange={this.props.onAmountChange}
>
{donationAmounts.map((token: Token, index: number) => {
const tokenValue = token.tokens.toString()
const paddingLength = tokenValue.length < 5
? tokenValue.length === 4 ? 3 : 4
: 0
const padding = `${String.fromCharCode(160)}`.repeat(paddingLength)

return (
<option
key={`k-${token.tokens}`}
value={tokenValue}
value={token.tokens}
>
{padding}{token.tokens} {getLocale('bat')} ({token.converted} USD)
{token.tokens} {getLocale('bat')} ({token.converted} USD)
</option>
)
})}
}).concat(
<StyledOptionShown
key={'k-show'}
value={'show'}
disabled={true}
>
{monthlyAmount} {getLocale('bat')}
</StyledOptionShown>
)}
</StyledSelect>
</StyledSelectWrapper>
)
Expand Down
4 changes: 4 additions & 0 deletions src/features/rewards/walletPanel/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,7 @@ export const StyledSelect = styled<StyleProps, 'select'>('select')`
outline: 0;
}
`

export const StyledOptionShown = styled<{}, 'option'>('option')`
display: none;
`
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ exports[`WalletSummary tests basic tests matches the snapshot 1`] = `
<div
className="c3"
>
MISSING: monthMay
MISSING: monthJun
2019
</div>
Expand Down
2 changes: 1 addition & 1 deletion stories/features/rewards/concepts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ storiesOf('Feature Components/Rewards/Concepts/Desktop', module)
platform={'youtube'}
publisherImg={favicon}
publisherName={'Jonathon Doe'}
monthlyAmount={'5.0'}
monthlyAmount={text('Monthly contribution', '5.0')}
acEnabled={true}
isVerified={boolean('Verified', false)}
showUnVerified={boolean('Show Unverified', true)}
Expand Down

0 comments on commit 8113333

Please sign in to comment.