Skip to content

Commit

Permalink
Rewards: Imported from brave-ui: GitHub as Provider for panel support
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkuki authored and NejcZdovc committed Sep 19, 2019
1 parent a0f864b commit c653488
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
import { getLocale } from '../../../helpers'
import { VerifiedSIcon, UnVerifiedSIcon, LoaderIcon, CheckmarkCircleS } from '../../../components/icons'

export type Provider = 'twitter' | 'youtube' | 'twitch' | 'reddit' | 'vimeo'
export type Provider = 'twitter' | 'youtube' | 'twitch' | 'reddit' | 'vimeo' | 'github'

export interface Props {
id?: string
Expand Down Expand Up @@ -68,6 +68,8 @@ export default class Profile extends React.PureComponent<Props, {}> {
return `${getLocale('on')} Reddit`
case 'vimeo':
return `${getLocale('on')} Vimeo`
case 'github':
return `${getLocale('on')} GitHub`
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ import {
YoutubeColorIcon,
TwitchColorIcon,
RedditColorIcon,
GitHubColorIcon,
AlertCircleIcon
} from '../../../components/icons'

export type Social = { type: SocialType, url: string }
export type SocialType = 'twitter' | 'youtube' | 'twitch' | 'reddit' | 'vimeo'
export type SocialType = 'twitter' | 'youtube' | 'twitch' | 'reddit' | 'vimeo' | 'github'
export type Donation = { tokens: string, converted: string, selected?: boolean }

export interface Props {
Expand Down Expand Up @@ -113,6 +114,9 @@ export default class SiteBanner extends React.PureComponent<Props, State> {
case 'twitch':
logo = <TwitchColorIcon />
break
case 'github':
logo = <GitHubColorIcon />
break
case 'reddit':
logo = <RedditColorIcon />
break
Expand Down Expand Up @@ -165,6 +169,8 @@ export default class SiteBanner extends React.PureComponent<Props, State> {
return `${identifier} ${getLocale('on')} Reddit`
case 'vimeo':
return `${identifier} ${getLocale('on')} Vimeo`
case 'github':
return `${identifier} ${getLocale('on')} GitHub`
default:
return identifier
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from './style'
import {
RedditColorIcon,
GitHubColorIcon,
ThumbsUpIcon,
TwitchColorIcon,
TwitterColorIcon,
Expand All @@ -26,7 +27,7 @@ import {
} from '../../../components/icons'
import { Toggle } from '../../../components'

export type Provider = 'twitter' | 'youtube' | 'twitch' | 'reddit' | 'vimeo'
export type Provider = 'twitter' | 'youtube' | 'twitch' | 'reddit' | 'vimeo' | 'github'

export interface Props {
id?: string
Expand All @@ -48,6 +49,8 @@ export default class ToggleTips extends React.PureComponent<Props, {}> {
return <RedditColorIcon />
case 'vimeo':
return <VimeoColorIcon />
case 'github':
return <GitHubColorIcon />
}
}

Expand Down
10 changes: 9 additions & 1 deletion components/brave_rewards/resources/ui/stories/concepts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ storiesOf('Feature Components/Rewards/Concepts/Desktop', module)
/>
))
.add('Site Banner', withState({ donationAmounts, currentAmount: '5.0', showBanner: true }, (store) => {
const mediaProvider = select<any>('Provider', { youtube: 'youtube', twitter: 'twitter', twitch: 'twitch', reddit: 'reddit' }, 'youtube')
const mediaProvider = select<any>('Provider', { youtube: 'youtube', twitter: 'twitter', twitch: 'twitch', reddit: 'reddit', github: 'github' }, 'youtube')
const screenName = text('Screen Name', '')
const commentText = text('Post Text', '')

Expand Down Expand Up @@ -147,6 +147,10 @@ storiesOf('Feature Components/Rewards/Concepts/Desktop', module)
{
type: 'reddit',
url: 'https://www.reddit.com/r/duckduckgo'
},
{
type: 'github',
url: 'https://github.com/duckduckgo'
}
]}
showUnVerifiedNotice={boolean('Show unverified notice', false)}
Expand Down Expand Up @@ -542,6 +546,10 @@ storiesOf('Feature Components/Rewards/Concepts/Mobile', module)
{
type: 'reddit',
url: 'https://www.reddit.com/r/duckduckgo'
},
{
type: 'github',
url: 'https://github.com/duckduckgo'
}
]}
/>
Expand Down
4 changes: 2 additions & 2 deletions components/brave_rewards/resources/ui/stories/other.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ storiesOf('Feature Components/Rewards/Other/Desktop', module)
type={select<any>('Type', { big: 'big', small: 'small' }, 'big')}
title={'Jonathon Doe'}
verified={boolean('Verified', false)}
provider={select<any>('Provider', { youtube: 'youtube', twitter: 'twitter', twitch: 'twitch', reddit: 'reddit', vimeo: 'vimeo' }, 'youtube')}
provider={select<any>('Provider', { youtube: 'youtube', twitter: 'twitter', twitch: 'twitch', reddit: 'reddit', vimeo: 'vimeo', github: 'github' }, 'youtube')}
src={favicon}
/>
</div>
Expand Down Expand Up @@ -233,7 +233,7 @@ storiesOf('Feature Components/Rewards/Other/Desktop', module)
id={'toggle-tips'}
onToggleTips={onToggle}
tipsEnabled={boolean('Selected', store.state.tipsEnabled)}
provider={select<any>('Provider', { youtube: 'youtube', twitter: 'twitter', twitch: 'twitch', reddit: 'reddit', vimeo: 'vimeo' }, 'youtube')}
provider={select<any>('Provider', { youtube: 'youtube', twitter: 'twitter', twitch: 'twitch', reddit: 'reddit', vimeo: 'vimeo', github: 'github' }, 'youtube')}
/>
)
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class DonationsBox extends React.Component<{}, State> {
<div data-key='yt'>YouTube</div>
<div data-key='tw'>Twitter</div>
<div data-key='rd'>Reddit</div>
<div data-key='gh'>GitHub</div>
<div data-key='inst'>Instagram</div>
</Checkbox>
</ControlWrapper>
Expand Down
2 changes: 1 addition & 1 deletion components/brave_rewards/resources/ui/stories/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ storiesOf('Feature Components/Rewards/Wallet/Desktop', module)
<div style={{ width: '373px', background: '#fff' }}>
<WalletPanel
id={'wallet-panel'}
platform={select<any>('Provider', { youtube: 'youtube', twitter: 'twitter', twitch: 'twitch', reddit: 'reddit', vimeo: 'vimeo' }, 'youtube')}
platform={select<any>('Provider', { youtube: 'youtube', twitter: 'twitter', twitch: 'twitch', reddit: 'reddit', vimeo: 'vimeo', github: 'github' }, 'youtube')}
publisherImg={favicon}
publisherName={'Jonathan Doe'}
monthlyAmount={'10.0'}
Expand Down

0 comments on commit c653488

Please sign in to comment.