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

Commit b65e332

Browse files
committed
Merge pull request #343 from brave/ads-disabled-color
Updating disabled text, text color, and icon for ads
1 parent 2559426 commit b65e332

File tree

9 files changed

+55
-39
lines changed

9 files changed

+55
-39
lines changed

src/features/rewards/disabledContent/__snapshots__/spec.tsx.snap

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Disabled Content tests basic tests matches the snapshot 1`] = `
4-
.c3 {
4+
.c4 {
55
font-family: Poppins,sans-serif;
66
font-size: 16px;
77
font-weight: 500;
@@ -11,13 +11,13 @@ exports[`Disabled Content tests basic tests matches the snapshot 1`] = `
1111
color: var(--disabled-content-color);
1212
}
1313
14-
.c3 b,
15-
.c3 a {
14+
.c4 b,
15+
.c4 a {
1616
color: var(--disabled-content-bold);
1717
font-weight: 500;
1818
}
1919
20-
.c3 h3 {
20+
.c4 h3 {
2121
margin: 0;
2222
display: inline-block;
2323
padding: 0;
@@ -47,7 +47,7 @@ exports[`Disabled Content tests basic tests matches the snapshot 1`] = `
4747
justify-content: flex-end;
4848
}
4949
50-
.c2 {
50+
.c3 {
5151
display: -webkit-box;
5252
display: -webkit-flex;
5353
display: -ms-flexbox;
@@ -62,6 +62,10 @@ exports[`Disabled Content tests basic tests matches the snapshot 1`] = `
6262
grid-column: span 2;
6363
}
6464
65+
.c2 {
66+
width: 110px;
67+
}
68+
6569
<div
6670
id="disabled"
6771
>
@@ -71,13 +75,15 @@ exports[`Disabled Content tests basic tests matches the snapshot 1`] = `
7175
<div
7276
className="c1"
7377
>
74-
<img />
78+
<div
79+
className="c2"
80+
/>
7581
</div>
7682
<div
77-
className="c2"
83+
className="c3"
7884
>
7985
<div
80-
className="c3"
86+
className="c4"
8187
/>
8288
</div>
8389
</div>

src/features/rewards/disabledContent/index.tsx

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,54 @@ import {
77
StyledContent,
88
StyledGrid,
99
StyledOneColumn,
10-
StyledTwoColumn
10+
StyledTwoColumn,
11+
StyledIcon
1112
} from './style'
13+
import {
14+
AdsMegaphoneIcon,
15+
RewardsActivateIcon,
16+
RewardsSendTipsIcon
17+
} from '../../../components/icons'
1218

1319
export type Type = 'ads' | 'contribute' | 'donation'
1420

1521
export interface Props {
1622
children: React.ReactNode
1723
id?: string
18-
image?: string
1924
type?: Type
2025
}
2126

2227
export default class DisabledContent extends React.PureComponent<Props, {}> {
28+
getIcon = (type?: Type) => {
29+
let icon = null
30+
31+
switch (type) {
32+
case 'ads':
33+
icon = <AdsMegaphoneIcon />
34+
break
35+
case 'contribute':
36+
icon = <RewardsActivateIcon />
37+
break
38+
case 'donation':
39+
icon = <RewardsSendTipsIcon />
40+
break
41+
}
42+
43+
return (
44+
<StyledIcon>
45+
{icon}
46+
</StyledIcon>
47+
)
48+
}
49+
2350
render () {
24-
const { id, image, children, type } = this.props
51+
const { id, children, type } = this.props
2552

2653
return (
2754
<div id={id}>
2855
<StyledGrid>
2956
<StyledOneColumn>
30-
<img src={image} />
57+
{this.getIcon(type)}
3158
</StyledOneColumn>
3259
<StyledTwoColumn>
3360
<StyledContent type={type}>

src/features/rewards/disabledContent/style.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const getColors = (p: Props) => {
1111

1212
switch (p.type) {
1313
case 'ads':
14-
color = '#ceb4e1'
14+
color = '#d666a2'
1515
boldColor = '#b490cf'
1616
break
1717
case 'contribute':
@@ -75,3 +75,7 @@ export const StyledTwoColumn = styled<{}, 'div'>('div')`
7575
flex-direction: column;
7676
grid-column: span 2;
7777
`
78+
79+
export const StyledIcon = styled<{}, 'div'>('div')`
80+
width: 110px;
81+
`

stories/assets/img/rewards_ads.svg

Lines changed: 0 additions & 9 deletions
This file was deleted.

stories/assets/img/rewards_contribute.svg

Lines changed: 0 additions & 6 deletions
This file was deleted.

stories/features/rewards/other.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import {
3333
import { BatColorIcon, SettingsIcon, UpholdColorIcon } from '../../../src/components/icons'
3434
import GrantClaim from '../../../src/features/rewards/grantClaim'
3535

36-
const donate = require('../../assets/img/rewards_donate.svg')
3736
const bart = require('../../assets/img/bartBaker.jpeg')
3837
const tipScreen = require('../../assets/img/tip_site.jpg')
3938
const siteBgLogo = require('../../assets/img/ddgo_siteBanner.svg')
@@ -83,8 +82,7 @@ storiesOf('Feature Components/Rewards/Other/Desktop', module)
8382
.add('Disabled content',() => {
8483
return (
8584
<DisabledContent
86-
image={donate}
87-
type={'donation'}
85+
type={select('Type', { contribute: 'contribute', donation: 'donation', ads: 'ads' }, 'donation')}
8886
>
8987
• Donate on the spot as you find gems. <br/>
9088
<b>Enable Tips </b> on Twitter, YouTube, and more, to give tips to posts you ‘Like’.

stories/features/rewards/settings/adsBox.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@ import { DisabledContent, Box } from '../../../../src/features/rewards'
1010
// Utils
1111
import locale from './fakeLocale'
1212

13-
// Assets
14-
const adsImg = require('../../../assets/img/rewards_ads.svg')
15-
1613
class AdsBox extends React.Component {
1714
adsDisabled () {
1815
return (
1916
<DisabledContent
20-
image={adsImg}
2117
type={'ads'}
2218
>
23-
<h3>{locale.adsDisabledText}</h3>
19+
{locale.adsDisabledTextOne} <br />
20+
{locale.adsDisabledTextTwo}
2421
</DisabledContent>
2522
)
2623
}

stories/features/rewards/settings/contributeBox.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import locale from './fakeLocale'
2323
// Assets
2424
const bartBaker = require('../../../assets/img/bartBaker.jpeg')
2525
const buzz = require('../../../assets/img/buzz.jpg')
26-
const contributeImg = require('../../../assets/img/rewards_contribute.svg')
2726
const ddgo = require('../../../assets/img/ddgo.jpg')
2827
const guardian = require('../../../assets/img/guardian.jpg')
2928
const wiki = require('../../../assets/img/wiki.jpg')
@@ -152,7 +151,6 @@ class ContributeBox extends React.Component<{}, State> {
152151
contributeDisabled () {
153152
return (
154153
<DisabledContent
155-
image={contributeImg}
156154
type={'contribute'}
157155
>
158156
• Pay directly for the content you love. <br/>

stories/features/rewards/settings/fakeLocale.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
const locale = {
66
adsDesc: 'Earn tokens by seeing ads on Brave. Ads are matched from machine learning and the data temporarily present in your browser without tracking your information or sending it outside.',
7-
adsDisabledText: 'Coming soon',
7+
adsDisabledTextOne: 'Earnings are paid every month.',
8+
adsDisabledTextTwo: 'Set your desired frequency to increase or decrease earnings.',
89
adsDisplayed: 'Ads displayed',
910
adsEarnings: 'Earnings this month',
1011
adsFreq: 'Ad Frequency',

0 commit comments

Comments
 (0)