-
Notifications
You must be signed in to change notification settings - Fork 877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update "Sponsored Images" toggle UI #14986
Conversation
be67258
to
d81cf9c
Compare
A Storybook has been deployed to preview UI for the latest push |
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.
Mostly looks good, couple of comments about CSS variables
components/brave_new_tab_ui/containers/newTab/settings/backgroundImage.tsx
Outdated
Show resolved
Hide resolved
components/brave_new_tab_ui/containers/newTab/settings/sponsoredImagesToggle.tsx
Outdated
Show resolved
Hide resolved
components/brave_new_tab_ui/containers/newTab/settings/sponsoredImagesToggle.tsx
Outdated
Show resolved
Hide resolved
components/brave_new_tab_ui/containers/newTab/settings/sponsoredImagesToggle.tsx
Outdated
Show resolved
Hide resolved
justify-content: space-between; | ||
padding: 12px 14px; | ||
border-radius: 10px; | ||
background-color: ${p => isDarkTheme(p) ? css`#1E2029` : css`white`}; |
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.
background-color: ${p => isDarkTheme(p) ? css`#1E2029` : css`white`}; | |
background-color: var(--background1); |
should automatically handle light/dark mode (and you can remove isDarkTheme
)
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.
See brave/components/web-components/app.global.scss
for the CSS variables we have. I think there's a convention for transforming the color name in Figma to the css variable name, but there are a bunch of missing colors in there sadly.
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.
convention for transforming the color name in Figma to the css variable name
Great! Is there a doc for this part? I was wondering how we manage all these variable stuffs. Also this is my first time to use Figma, It'd be really nice to learn best practices.
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.
I haven't really used it much either 😆 I think in the new design system the Figma ==> CSS variable transformation is more straightforward. I often just search for the hex color in app.global.css
or the last bit of the color name in figma but without leading 0s
(ie. Light Theme/Text/text01
becomes --text1
).
@petemill is probably the best person to ask about this.
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.
Theme/Text/text01 becomes --text1).
Aha! that's the convention! thanks a lot :)
components/brave_new_tab_ui/containers/newTab/settings/sponsoredImagesToggle.tsx
Outdated
Show resolved
Hide resolved
d81cf9c
to
c78d781
Compare
components/brave_new_tab_ui/containers/newTab/settings/sponsoredImagesToggle.tsx
Outdated
Show resolved
Hide resolved
components/brave_new_tab_ui/containers/newTab/settings/sponsoredImagesToggle.tsx
Show resolved
Hide resolved
A Storybook has been deployed to preview UI for the latest push |
probably @PrivacyMatters needs to take a look here to review the strings and overall opt-in UI |
@sangwoo108 It's important to use correct terminology. The images show the toggle set to ON and which makes it an opt-out (not an opt-in). If the toggle was off, and the user turned it ON, it would be opt-in. The default chosen by Brave is that Sponsored Images are ON by default (so an opt-out), even when Brave Rewards have NOT been enabled by a user. Has it been implemented differently in South Korea? |
Oh, my bad. There are no changes intended default state of sponsored image. I just update UI of the toggle UI. updated pr description and commit message |
c78d781
to
eb1a2e5
Compare
cc. @rebron since strings are from spec. |
A Storybook has been deployed to preview UI for the latest push |
@sangwoo108 is this is about providing users who do not have Rewards enabled with a notice that they can earn BAT by enabling it? |
@PrivacyMatters Yes, I think so. This is part of brave/brave-browser#15252 and you can find the spec for this there. cc. @rebron |
A Storybook has been deployed to preview UI for the latest push |
Hi, @PrivacyMatters . Do you have anything else for me to address? |
Rough requirements: - The toggle UI should be below background image options - The new toggle UI should contain descriptions about Sponsored Images - When Brave Rewards or Brave Ad are not enabled, a button should be visible - When a user opts in the option and Reward & Ads are enabled, the description should notify the user that they're earning from it. - When clicking the "Rewards" button, "Reward tour" UI appears or "Brave Ads" option is enabled.
646dbce
to
485bf65
Compare
A Storybook has been deployed to preview UI for the latest push |
@sangwoo108 no more comment from me. It is only being presented to people with the SI default ON. |
Thank you so much @PrivacyMatters ! @fallaciousreasoning Could you take another look please? |
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.
LGTM, sorry for the delay @sangwoo108
No problem at all. You're one of the most responsive reviewers around me so that I count on 😎 Thanks for the review! I checked reviewers checklist on behalf of you as it's blocking. |
Rough requirements:
should notify the user that they're earning from it.
Light theme
Dark theme
Resolves brave/brave-browser#25197
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Manual: Described from PR description