-
Notifications
You must be signed in to change notification settings - Fork 137
Tip banner display is now customized for Reddit inline tipping #498
Conversation
7523209
to
a89b07b
Compare
df7f6db
to
93107ec
Compare
@@ -100,6 +104,10 @@ storiesOf('Feature Components/Rewards/Concepts/Desktop', module) | |||
return screenName.length > 0 || tweetText.length > 0 | |||
} | |||
|
|||
const isRedditTip = () => { | |||
return !isTwitterTip() && (redditUserName.length !== 0 && redditPost.length !== 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this check !isTwitterTip()
as isRedditTip()
is else to twitter check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is not needed. removed
93107ec
to
08c0250
Compare
8629dc2
to
9926ce7
Compare
<StyledMediaBox> | ||
<StyledMediaIcon> | ||
{ | ||
this.props.mediaType === 'twitter' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you extract this into separate function, so that render is small
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
</StyledMediaIcon> | ||
<StyledMediaTimestamp> | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you extract this into separate function, so that render is small
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -83,6 +83,9 @@ storiesOf('Feature Components/Rewards/Concepts/Desktop', module) | |||
.add('Site Banner', withState({ donationAmounts, currentAmount: '5.0', showBanner: true }, (store) => { | |||
const screenName = text('Screen Name', '') | |||
const tweetText = text('Tweet Text', '') | |||
const redditUserName = text('Reddit User Name', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try to use same knobs and have select with types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
stories/features/rewards/other.tsx
Outdated
tweetTimestamp={number('Timestamp in seconds', 46420000)} | ||
tweetText={text('Tweet text', 'This is my tweet.')} | ||
<MediaBox | ||
mediaType={'twitter'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this select option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
9926ce7
to
ef24596
Compare
ef24596
to
ecf7d81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ other feedback has been addressed, lgtm
@@ -113,7 +118,7 @@ storiesOf('Feature Components/Rewards/Concepts/Desktop', module) | |||
<SiteBanner | |||
domain={text('Domain', 'duckduckgo.com')} | |||
name={text('Name', 'duckduckgo.com')} | |||
screenName={screenName} | |||
screenName={screenName || ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed? is it possible to be undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Removed
export interface Props { | ||
mediaType: 'twitter' | 'reddit' | ||
mediaText: string | ||
mediaTimestamp: number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need mediaTimestamp
and mediaTimetext
? Wouldn't time displayed in the box be the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why twitter would have different format then reddit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should try to have box as general as possible so when we add github we would just add timestamp in and everything would just work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed via DM
ecf7d81
to
22b9e06
Compare
Reopening for pending security review for brave/brave-core#2624 |
Changes
Test plan
Link / storybook path to visual changes
https://brave-ui-3ev1bujlm.now.sh/?path=/story/feature-components-rewards-concepts-desktop--site-banner
Integration
Does this contain changes to src/components or src/
Does this contain changes to src/features for brave-core?