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

Commit

Permalink
Merge pull request #499 from brave/grant-text
Browse files Browse the repository at this point in the history
Adds token text to grant final screen
  • Loading branch information
NejcZdovc authored Jun 12, 2019
2 parents b126af5 + 8879e50 commit 624be47
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ exports[`Grant complete tests basic tests matches the snapshot 1`] = `
>
<div
className="c2"
>
MISSING: newTokenGrant
</div>
/>
<div
className="c3"
>
Expand Down
7 changes: 4 additions & 3 deletions src/features/rewards/grantComplete/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ export interface Props {
testId?: string
onClose: () => void
amount: string
date: string,
date: string
isMobile?: boolean
tokenTitle?: string
}

export default class GrantComplete extends React.PureComponent<Props, {}> {
render () {
const { id, testId, onClose, amount, date, isMobile } = this.props
const { id, testId, onClose, amount, date, isMobile, tokenTitle } = this.props

return (
<StyledWrapper id={id} data-test-id={testId}>
<StyledBox>
<StyledTitle>{getLocale('newTokenGrant')}</StyledTitle>
<StyledTitle>{tokenTitle}</StyledTitle>
<StyledValue>{amount} BAT</StyledValue>
{
date && date.length > 0
Expand Down
9 changes: 6 additions & 3 deletions src/features/rewards/walletWrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ type GrantClaim = {
captcha?: string
hint?: string
status?: 'wrongPosition' | 'grantGone' | 'generalError' | 'grantAlreadyClaimed' | number | null
finishTokenTitle?: string
finishTitle?: string
finishText?: string
}

export interface AlertWallet {
Expand Down Expand Up @@ -458,10 +461,10 @@ export default class WalletWrapper extends React.PureComponent<Props, State> {
? <GrantWrapper
isPanel={true}
onClose={this.onFinish}
title={getLocale('captchaLuckyDay')}
text={getLocale('captchaOnTheWay')}
title={grant.finishTitle || ''}
text={grant.finishText}
>
<GrantComplete isMobile={true} onClose={this.onFinish} amount={tokens} date={date} />
<GrantComplete isMobile={true} onClose={this.onFinish} amount={tokens} date={date} tokenTitle={grant.finishTokenTitle} />
</GrantWrapper>
: null
}
Expand Down
2 changes: 0 additions & 2 deletions stories/assets/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const locale: Record<string, string> = {
braveVerified: 'Verified Creators',
cancel: 'Cancel',
captchaDrag: 'Drag the BAT Icon on to the',
captchaLuckyDay: 'It’s your lucky day!',
captchaOnTheWay: 'Your token grant is on its way.',
captchaProveHuman: 'Prove that you are human!',
captchaTarget: 'target.',
Expand Down Expand Up @@ -109,7 +108,6 @@ const locale: Record<string, string> = {
monthlyText: 'Monthly',
monthlyTips: 'Monthly Tips!',
newGrant: 'A free token grant is available.',
newTokenGrant: 'New Token Grant',
noActivity: 'No activities yet…',
noGrants: 'Currently no token grant is available.',
notEnoughTokens: 'Not enough tokens. Please',
Expand Down
14 changes: 10 additions & 4 deletions stories/features/rewards/concepts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ const defaultGrant = {
probi: '',
expiryTime: 0,
captcha: '',
hint: ''
hint: '',
finishTitle: 'It\'s your lucky day!',
finishText: 'Your token grant is on its way.',
finishTokenTitle: 'Free Token Grant'
}

const grantNotification = {
Expand Down Expand Up @@ -264,17 +267,20 @@ storiesOf('Feature Components/Rewards/Concepts/Desktop', module)
{
tokens: '8.0',
expireDate: '7/15/2018',
type: 'ugp'
type: 'ugp',
tokenText: 'Free Token Grant'
},
{
tokens: '10.0',
expireDate: '9/10/2018',
type: 'ugp'
type: 'ugp',
tokenText: 'Free Token Grant'
},
{
tokens: '10.0',
expireDate: '10/10/2018',
type: 'ads'
type: 'ads',
tokenText: 'Your Brave Ads Token Grant'
}
])}
>
Expand Down
1 change: 1 addition & 0 deletions stories/features/rewards/grant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ storiesOf('Feature Components/Rewards/Grant', module)
onClose={dummyClick}
amount={'30.0'}
date={text('Date', '8/15/2018')}
tokenTitle={'Free token grant'}
/>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion stories/features/rewards/settings/grant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Grant extends React.Component<Props, State > {
title={'It’s your lucky day!'}
text={'Your token grant is on its way.'}
>
<GrantComplete onClose={this.onComplete} amount={'30.0'} date={'8/15/2018'} />
<GrantComplete onClose={this.onComplete} amount={'30.0'} date={'8/15/2018'} tokenTitle={'Free token grant'} />
</GrantWrapper>
: null
}
Expand Down
1 change: 1 addition & 0 deletions stories/features/rewards/settingsMobile/grantMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class GrantMobile extends React.Component<Props, State > {
onClose={this.onComplete}
amount={'30.0'}
date={'8/15/2018'}
tokenTitle={'Free token grant'}
/>
</GrantWrapper>
: null
Expand Down

0 comments on commit 624be47

Please sign in to comment.