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

Reverting PR #499 #509

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ exports[`Grant complete tests basic tests matches the snapshot 1`] = `
>
<div
className="c2"
/>
>
MISSING: newTokenGrant
</div>
<div
className="c3"
>
Expand Down
7 changes: 3 additions & 4 deletions src/features/rewards/grantComplete/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@ 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, tokenTitle } = this.props
const { id, testId, onClose, amount, date, isMobile } = this.props

return (
<StyledWrapper id={id} data-test-id={testId}>
<StyledBox>
<StyledTitle>{tokenTitle}</StyledTitle>
<StyledTitle>{getLocale('newTokenGrant')}</StyledTitle>
<StyledValue>{amount} BAT</StyledValue>
{
date && date.length > 0
Expand Down
9 changes: 3 additions & 6 deletions src/features/rewards/walletWrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ 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 @@ -461,10 +458,10 @@ export default class WalletWrapper extends React.PureComponent<Props, State> {
? <GrantWrapper
isPanel={true}
onClose={this.onFinish}
title={grant.finishTitle || ''}
text={grant.finishText}
title={getLocale('captchaLuckyDay')}
text={getLocale('captchaOnTheWay')}
>
<GrantComplete isMobile={true} onClose={this.onFinish} amount={tokens} date={date} tokenTitle={grant.finishTokenTitle} />
<GrantComplete isMobile={true} onClose={this.onFinish} amount={tokens} date={date} />
</GrantWrapper>
: null
}
Expand Down
2 changes: 2 additions & 0 deletions stories/assets/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ 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 @@ -108,6 +109,7 @@ 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: 4 additions & 10 deletions stories/features/rewards/concepts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ const defaultGrant = {
probi: '',
expiryTime: 0,
captcha: '',
hint: '',
finishTitle: 'It\'s your lucky day!',
finishText: 'Your token grant is on its way.',
finishTokenTitle: 'Free Token Grant'
hint: ''
}

const grantNotification = {
Expand Down Expand Up @@ -284,20 +281,17 @@ storiesOf('Feature Components/Rewards/Concepts/Desktop', module)
{
tokens: '8.0',
expireDate: '7/15/2018',
type: 'ugp',
tokenText: 'Free Token Grant'
type: 'ugp'
},
{
tokens: '10.0',
expireDate: '9/10/2018',
type: 'ugp',
tokenText: 'Free Token Grant'
type: 'ugp'
},
{
tokens: '10.0',
expireDate: '10/10/2018',
type: 'ads',
tokenText: 'Your Brave Ads Token Grant'
type: 'ads'
}
])}
>
Expand Down
1 change: 0 additions & 1 deletion stories/features/rewards/grant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ 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'} tokenTitle={'Free token grant'} />
<GrantComplete onClose={this.onComplete} amount={'30.0'} date={'8/15/2018'} />
</GrantWrapper>
: null
}
Expand Down
1 change: 0 additions & 1 deletion stories/features/rewards/settingsMobile/grantMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ 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