diff --git a/browser/ui/webui/brave_webui_source.cc b/browser/ui/webui/brave_webui_source.cc index 91a50c771179..ceaea053ea1f 100644 --- a/browser/ui/webui/brave_webui_source.cc +++ b/browser/ui/webui/brave_webui_source.cc @@ -162,6 +162,7 @@ void CustomizeWebUIHTMLSource(const std::string &name, { "showTopSites", IDS_BRAVE_NEW_TAB_SHOW_TOP_SITES }, { "showRewards", IDS_BRAVE_NEW_TAB_SHOW_REWARDS }, { "showBinance", IDS_BRAVE_NEW_TAB_SHOW_BINANCE }, + { "moreCards", IDS_BRAVE_NEW_TAB_SHOW_MORE_CARDS }, { "brandedWallpaperOptIn", IDS_BRAVE_NEW_TAB_BRANDED_WALLPAPER_OPT_IN }, { "topSitesTitle", IDS_BRAVE_NEW_TAB_TOP_SITES }, { "statsTitle", IDS_BRAVE_NEW_TAB_STATS }, diff --git a/components/brave_new_tab_ui/components/default/index.ts b/components/brave_new_tab_ui/components/default/index.ts index 4d587e58e42d..d0da70d40ad3 100644 --- a/components/brave_new_tab_ui/components/default/index.ts +++ b/components/brave_new_tab_ui/components/default/index.ts @@ -4,7 +4,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ import { StatsContainer, StatsItem } from './stats' -import { SettingsMenu, SettingsRow, SettingsText, SettingsTitle, SettingsWrapper } from './settings' +export * from './settings' import { ListWidget, Tile, TileActionsContainer, TileAction, TileFavicon } from './gridSites' import { SiteRemovalNotification, SiteRemovalText, SiteRemovalAction } from './notification' import { ClockWidget } from './clock' @@ -26,11 +26,6 @@ export { SiteRemovalText, SiteRemovalAction, ClockWidget, - SettingsMenu, - SettingsRow, - SettingsText, - SettingsTitle, - SettingsWrapper, RewardsWidget, BinanceWidget, createWidget diff --git a/components/brave_new_tab_ui/components/default/page/index.ts b/components/brave_new_tab_ui/components/default/page/index.ts index 2634e6c347db..7b21ac076e3e 100644 --- a/components/brave_new_tab_ui/components/default/page/index.ts +++ b/components/brave_new_tab_ui/components/default/page/index.ts @@ -67,6 +67,11 @@ export const Page = styled('div')` min-height: 100vh; align-items: flex-start; + /* lock the screen so when brave today is scroled + NTP items remain in the same place */ + position: sticky; + top: 0; + @media screen and (max-width: ${breakpointEveryBlock}) { display: flex; flex-direction: column; @@ -139,6 +144,15 @@ export const GridItemNavigation = styled('section')` } ` +export const GridItemNavigationBraveToday = styled<{}, 'span'>('span')` + position: absolute; + bottom: 60px; + text-align: center; + width: 100%; + color: white; + font-size: 24px; +` + export const Footer = styled<{}, 'footer'>('footer')` /* Child items are primary Grid items and can slot in to free spaces, so this element doesn't do anything on wider viewport widths. */ @@ -183,6 +197,7 @@ export const App = styled('div')` box-sizing: border-box; display: flex; flex: 1; + flex-direction: column; transition: opacity .125s ease-out; opacity: ${p => p.dataIsReady ? 1 : 0}; ` @@ -327,3 +342,22 @@ export const IconButtonSideText = styled('labe outline: 0; } ` + +interface IconButtonContainerProps { + textDirection: string +} + +export const IconButtonContainer = styled('div')` + font-family: ${p => p.theme.fontFamily.heading}; + font-size: 13px; + font-weight: 600; + color: rgba(255,255,255,0.8); + margin-right: ${p => p.textDirection === 'ltr' && '8px'}; + margin-left: ${p => p.textDirection === 'rtl' && '8px'}; + border-right: ${p => p.textDirection === 'ltr' && '1px solid rgba(255, 255, 255, 0.6)'}; + border-left: ${p => p.textDirection === 'rtl' && '1px solid rgba(255, 255, 255, 0.6)'}; + + &:hover { + color: #ffffff; + } +` diff --git a/components/brave_new_tab_ui/components/default/settings/index.ts b/components/brave_new_tab_ui/components/default/settings/index.ts index e59fd2f209e4..927efd1cda11 100644 --- a/components/brave_new_tab_ui/components/default/settings/index.ts +++ b/components/brave_new_tab_ui/components/default/settings/index.ts @@ -1,32 +1,168 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public -* License, v. 2.0. If a copy of the MPL was not distributed with this file, -* You can obtain one at http://mozilla.org/MPL/2.0/. */ +// Copyright (c) 2020 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. -import styled, { css } from 'styled-components' +import styled, { css } from 'brave-ui/theme' interface Props { textDirection: string } export const SettingsMenu = styled('div')` - bottom: 48px; - width: auto; - position: absolute; + width: 680px; ${p => p.textDirection && (p.textDirection === 'rtl') ? `left: 12px` : `right: 12px`} background-color: ${p => p.theme.color.contextMenuBackground}; color: ${p => p.theme.color.contextMenuForeground}; border-radius: 8px; - padding: 24px 24px 17px 24px; + padding: 24px; box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.24); font-family: ${p => p.theme.fontFamily.body}; ` +export const SettingsContent = styled<{}, 'div'>('div')` + display: grid; + grid-template-columns: auto 1fr; + grid-gap: 40px; +` + +export const SettingsSidebar = styled<{}, 'aside'>('aside')` + position: relative; + /* normalize against SettingsMenu default padding */ + margin-left: -24px; + padding-left: 24px; +` + +interface SettingsSidebarActiveButtonSliderProps { + translateTo: number +} + +export const SettingsSidebarActiveButtonSlider = + styled('div')` + position: absolute; + top: 0; + left: 0; + height: 48px; + width: 4px; + background: linear-gradient(93.83deg, ${p => p.theme.color.brandBrave} -3.53%, ${p => p.theme.palette.magenta500} 110.11%); + transform: translateY(${p => p.translateTo * 48}px); + transition-delay: 0.05s; + transition-duration: 0.3s; + transition-timing-function: ease-in; + transition-property: transform; +` +interface SettingsSidebarSVGContentProps { + src: string +} + +export const SettingsSidebarSVGContent = styled('div')` + width: 20px; + height: 20px; + background: ${p => p.theme.palette.grey800}; + -webkit-mask-image: url(${p => p.src}); + -webkit-mask-repeat: no-repeat; + -webkit-mask-position: center; +` + +export const SettingsSidebarButtonText = styled<{}, 'span'>('span')` + margin-left: 16px; + font-weight: 500; + font-size: 13px; + font-family: ${p => p.theme.fontFamily.heading}; + color: ${p => p.theme.palette.grey800}; + position: relative; + + &:hover { + color: ${p => p.theme.color.brandBrave}; + } +` +interface SettingsSidebarButtonProps { + activeTab: boolean +} + +export const SettingsSidebarButton = styled('button')` + appearance: none; + padding: 0; + margin: 0; + border: 0; + width: 220px; + height: 48px; + text-align: left; + cursor: pointer; + display: flex; + align-items: center; + + &:focus { + outline: none; + } + + &:hover { + ${SettingsSidebarSVGContent} { + background: ${p => p.theme.color.brandBrave}; + } + ${SettingsSidebarButtonText} { + color: ${p => p.theme.color.brandBrave}; + } + } + + ${SettingsSidebarSVGContent} { + ${p => p.activeTab && css` + background: linear-gradient(93.83deg, ${p => p.theme.color.brandBrave} -3.53%, ${p => p.theme.palette.magenta500} 110.11%); + `} + } + + ${SettingsSidebarButtonText} { + // Gradientify text + ${p => p.activeTab && css` + background: ${p => p.theme.color.panelBackground}; + `} + + // Gradientify text part 2 + &::before { + ${p => p.activeTab && css` + mix-blend-mode: screen; + content: ''; + display: block; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + transition: linear 0.3s background-image; + background-image: linear-gradient(93.83deg, ${p => p.theme.color.brandBrave} -3.53%, ${p => p.theme.palette.magenta500} 110.11%); + `} + } +` + +export const SettingsFeatureBody = styled<{}, 'section'>('section')` + padding: 10px 16px 0; +` + export const SettingsTitle = styled<{}, 'div'>('div')` - font-family: ${p => p.theme.fontFamily.body}; - font-size: 18px; - font-weight: bold; - letter-spacing: 0px; margin-bottom: 17px; + grid-template-columns: 1fr 20px; + display: grid; + align-items: center; + + h1 { + font-family: ${p => p.theme.fontFamily.heading}; + margin: 0; + font-weight: 600; + font-size: 20px; + line-height: 30px; + letter-spacing: 0.02em; + color: ${p => p.theme.color.neutral900}; + } +` + +export const SettingsCloseIcon = styled<{}, 'button'>('button')` + appearance: none; + padding: 0; + margin: 0; + border: 0; + width: 20px; + height: 20px; + cursor: pointer; ` interface SettingsRowProps { @@ -37,11 +173,11 @@ export const SettingsRow = styled('div')` box-sizing: border-box; display: grid; grid-template-columns: 1fr 36px; - margin-top: 10px; - height: 30px; - width: 320px; + align-items: center; + width: 100%; + height: 28px; ${p => p.isChildSetting && css` - padding-left: 15px; + padding-left: 36px; `} ` @@ -57,9 +193,15 @@ interface SettingsWrapperProps { } export const SettingsWrapper = styled('div')` - position: relative; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 3; display: flex; - justify-content: flex-end; + justify-content: center; + align-items: center; font-family: ${p => p.theme.fontFamily.heading}; font-size: 13px; font-weight: 600; diff --git a/components/brave_new_tab_ui/containers/newTab/footerInfo.tsx b/components/brave_new_tab_ui/containers/newTab/footerInfo.tsx index b33a55173c18..ad64e29b3ab0 100644 --- a/components/brave_new_tab_ui/containers/newTab/footerInfo.tsx +++ b/components/brave_new_tab_ui/containers/newTab/footerInfo.tsx @@ -5,67 +5,42 @@ import * as React from 'react' // Feature-specific components -import { Link, Navigation, IconLink, PhotoName } from '../../components/default' +import { + Link, + Navigation, + IconButton, + IconButtonContainer, + IconButtonSideText, + IconLink, + PhotoName +} from '../../components/default' import * as S from '../../components/default/page' // Icons -import { SettingsAdvancedIcon, BookmarkBook, HistoryIcon } from 'brave-ui/components/icons' +import { + SettingsIcon, + SettingsAdvancedIcon, + BookmarkBook, + HistoryIcon +} from 'brave-ui/components/icons' // Helpers import { getLocale } from '../../../common/locale' -import Settings from './settings' interface Props { textDirection: string - onClickOutside: () => void + onClickSettings: (event: React.MouseEvent) => void backgroundImageInfo: any - onClickSettings: () => void - showSettingsMenu: boolean showPhotoInfo: boolean - toggleShowBackgroundImage: () => void - toggleShowClock: () => void - toggleShowStats: () => void - toggleShowTopSites: () => void - toggleShowRewards: () => void - toggleShowBinance: () => void - toggleBrandedWallpaperOptIn: () => void - showBackgroundImage: boolean - showClock: boolean - showStats: boolean - showTopSites: boolean - showRewards: boolean - showBinance: boolean - brandedWallpaperOptIn: boolean - allowSponsoredWallpaperUI: boolean - binanceSupported: boolean } export default class FooterInfo extends React.PureComponent { - render () { const { textDirection, - backgroundImageInfo, onClickSettings, - showSettingsMenu, - showPhotoInfo, - onClickOutside, - toggleShowBackgroundImage, - toggleShowClock, - toggleShowStats, - toggleShowTopSites, - toggleBrandedWallpaperOptIn, - showBackgroundImage, - showClock, - showStats, - showTopSites, - brandedWallpaperOptIn, - allowSponsoredWallpaperUI, - toggleShowRewards, - showRewards, - toggleShowBinance, - showBinance, - binanceSupported + backgroundImageInfo, + showPhotoInfo } = this.props return ( @@ -80,30 +55,21 @@ export default class FooterInfo extends React.PureComponent { } + { + + ⬇🟢⬇🟢⬇🟢⬇🟢⬇🟢 scroll to see more ⬇🟢⬇🟢⬇🟢⬇🟢⬇🟢 + + } - + + + + + + {getLocale('customize')} + + diff --git a/components/brave_new_tab_ui/containers/newTab/index.tsx b/components/brave_new_tab_ui/containers/newTab/index.tsx index 04f62579b2c8..592e7e97013d 100644 --- a/components/brave_new_tab_ui/containers/newTab/index.tsx +++ b/components/brave_new_tab_ui/containers/newTab/index.tsx @@ -31,6 +31,9 @@ import * as gridSitesActions from '../../actions/grid_sites_actions' import { getLocale } from '../../../common/locale' import currencyData from '../../components/default/binance/data' +// NTP features +import Settings from './settings' + interface Props { newTabData: NewTab.State gridSitesData: NewTab.GridSitesState @@ -655,31 +658,34 @@ class NewTabPage extends React.Component { } + ) } diff --git a/components/brave_new_tab_ui/containers/newTab/settings.tsx b/components/brave_new_tab_ui/containers/newTab/settings.tsx index 16338553c112..3c8b24f7b3d5 100644 --- a/components/brave_new_tab_ui/containers/newTab/settings.tsx +++ b/components/brave_new_tab_ui/containers/newTab/settings.tsx @@ -1,28 +1,46 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public -* License, v. 2.0. If a copy of the MPL was not distributed with this file, -* You can obtain one at http://mozilla.org/MPL/2.0/. */ +// Copyright (c) 2020 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. import * as React from 'react' import { SettingsMenu, - SettingsRow, - SettingsText, SettingsTitle, SettingsWrapper, - IconButton, - IconButtonSideText + SettingsSidebar, + SettingsFeatureBody, + SettingsContent, + SettingsCloseIcon, + SettingsSidebarButton, + SettingsSidebarActiveButtonSlider, + SettingsSidebarButtonText, + SettingsSidebarSVGContent } from '../../components/default' -import { Toggle } from '../../components/toggle' - import { getLocale } from '../../../common/locale' -import { SettingsIcon } from 'brave-ui/components/icons' + +// Icons +import { CloseStrokeIcon } from 'brave-ui/components/icons' +import BackgroundImageIcon from './settings/icons/backgroundImage.svg' +import NraveStatsIcon from './settings/icons/braveStats.svg' +import BraveRewardsIcon from './settings/icons/braveRewards.svg' +import TopSitesIcon from './settings/icons/topSites.svg' +import ClockIcon from './settings/icons/clock.svg' +import MoreCardsIcon from './settings/icons/moreCards.svg' + +// Tabs +import BackgroundImageSettings from './settings/backgroundImage' +import BraveStatsSettings from './settings/braveStats' +import BraveRewardsSettings from './settings/braveRewards' +import TopSitesSettings from './settings/topSites' +import ClockSettings from './settings/clock' +import MoreCardsSettings from './settings/moreCards' export interface Props { textDirection: string showSettingsMenu: boolean - onClick: () => void onClickOutside: () => void toggleShowBackgroundImage: () => void toggleShowClock: () => void @@ -42,28 +60,40 @@ export interface Props { binanceSupported: boolean } -export default class Settings extends React.PureComponent { +type ActiveTabType = 'backgroundImage' | 'braveStats' | 'braveRewards' | 'topSites' | 'clock' | 'moreCards' + +interface State { + activeTab: number +} + +export default class Settings extends React.PureComponent { settingsMenuRef: React.RefObject constructor (props: Props) { super(props) this.settingsMenuRef = React.createRef() + this.state = { activeTab: 0 } } handleClickOutside = (event: Event) => { - if (this.settingsMenuRef && !this.settingsMenuRef.current.contains(event.target)) { + if ( + this.settingsMenuRef && + this.settingsMenuRef.current && + !this.settingsMenuRef.current.contains(event.target) + ) { this.props.onClickOutside() } } componentDidMount () { document.addEventListener('mousedown', this.handleClickOutside) + document.addEventListener('keydown', this.onKeyPressSettings) } componentWillUnmount () { document.removeEventListener('mousedown', this.handleClickOutside) } - onKeyPressSettings = (event: React.KeyboardEvent) => { + onKeyPressSettings = (event: KeyboardEvent) => { if (event.key === 'Escape') { this.props.onClickOutside() } @@ -73,6 +103,35 @@ export default class Settings extends React.PureComponent { this.props.toggleShowBackgroundImage() } + setActiveTab (activeTab: number) { + this.setState({ activeTab }) + } + + get activeTabOptions (): ActiveTabType[] { + return [ + 'backgroundImage', 'braveStats', 'braveRewards', 'topSites', 'clock', 'moreCards' + ] + } + + getTabIcon (activeTab: number) { + switch (activeTab) { + case 0: + return + case 1: + return + case 2: + return + case 3: + return + case 4: + return + case 5: + return + default: + return + } + } + render () { const { textDirection, @@ -89,94 +148,108 @@ export default class Settings extends React.PureComponent { showRewards, brandedWallpaperOptIn, allowSponsoredWallpaperUI, - onClick, toggleShowBinance, showBinance, binanceSupported } = this.props - return ( - - - - {getLocale('customize')} - - {showSettingsMenu && - - {getLocale('dashboardSettingsTitle')} - {allowSponsoredWallpaperUI && - - {getLocale('showBackgroundImage')} - - - } - {allowSponsoredWallpaperUI && - - {getLocale('brandedWallpaperOptIn')} - - - } - - {getLocale('showRewards')} - - - { - binanceSupported - ? - {getLocale('showBinance')} - - - : null - } - - {getLocale('showBraveStats')} - - - - {getLocale('showClock')} - - - - {getLocale('showTopSites')} - - - - } - - ) + const { activeTab } = this.state + + return showSettingsMenu + ? ( + + + +

{getLocale('dashboardSettingsTitle')}

+ + + +
+ + + + { + this.activeTabOptions.map((tabName, index) => { + return ( + + {this.getTabIcon(index)} + + {getLocale(tabName)} + + + ) + }) + } + + + { + activeTab === 0 + ? ( + + ) : null + } + { + activeTab === 1 + ? ( + + ) : null + } + { + activeTab === 2 + ? ( + + ) : null + } + { + activeTab === 3 + ? ( + + ) : null + } + { + activeTab === 4 + ? ( + + ) : null + } + { + activeTab === 5 + ? ( + + ) : null + } + + +
+
+ ) : null } } diff --git a/components/brave_new_tab_ui/containers/newTab/settings/backgroundImage.tsx b/components/brave_new_tab_ui/containers/newTab/settings/backgroundImage.tsx new file mode 100644 index 000000000000..03695eea6a7d --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/backgroundImage.tsx @@ -0,0 +1,63 @@ +// Copyright (c) 2020 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +import * as React from 'react' + +import { + SettingsRow, + SettingsText +} from '../../../components/default' +import { Toggle } from '../../../components/toggle' + +import { getLocale } from '../../../../common/locale' + +interface Props { + toggleBrandedWallpaperOptIn: () => void + toggleShowBackgroundImage: () => void + allowSponsoredWallpaperUI: boolean + brandedWallpaperOptIn: boolean + showBackgroundImage: boolean +} + +class BackgroundImageSettings extends React.PureComponent { + render () { + const { + allowSponsoredWallpaperUI, + toggleShowBackgroundImage, + toggleBrandedWallpaperOptIn, + brandedWallpaperOptIn, + showBackgroundImage + } = this.props + + return ( +
+ {allowSponsoredWallpaperUI && + + {getLocale('showBackgroundImage')} + + + } + {allowSponsoredWallpaperUI && + + {getLocale('brandedWallpaperOptIn')} + + } +
+ ) + } +} + +export default BackgroundImageSettings diff --git a/components/brave_new_tab_ui/containers/newTab/settings/braveRewards.tsx b/components/brave_new_tab_ui/containers/newTab/settings/braveRewards.tsx new file mode 100644 index 000000000000..0c682ed049cf --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/braveRewards.tsx @@ -0,0 +1,39 @@ +// Copyright (c) 2020 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +import * as React from 'react' + +import { + SettingsRow, + SettingsText +} from '../../../components/default' +import { Toggle } from '../../../components/toggle' + +import { getLocale } from '../../../../common/locale' + +interface Props { + toggleShowRewards: () => void + showRewards: boolean +} + +class BraveRewardsSettings extends React.PureComponent { + render () { + const { toggleShowRewards, showRewards } = this.props + return ( +
+ + {getLocale('showRewards')} + + +
+ ) + } +} + +export default BraveRewardsSettings diff --git a/components/brave_new_tab_ui/containers/newTab/settings/braveStats.tsx b/components/brave_new_tab_ui/containers/newTab/settings/braveStats.tsx new file mode 100644 index 000000000000..88aabf8afb41 --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/braveStats.tsx @@ -0,0 +1,40 @@ +// Copyright (c) 2020 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +import * as React from 'react' + +import { + SettingsRow, + SettingsText +} from '../../../components/default' +import { Toggle } from '../../../components/toggle' + +import { getLocale } from '../../../../common/locale' + +interface Props { + toggleShowStats: () => void + showStats: boolean +} + +class BraveStatsSettings extends React.PureComponent { + render () { + const { toggleShowStats, showStats } = this.props + + return ( +
+ + {getLocale('showBraveStats')} + + +
+ ) + } +} + +export default BraveStatsSettings diff --git a/components/brave_new_tab_ui/containers/newTab/settings/clock.tsx b/components/brave_new_tab_ui/containers/newTab/settings/clock.tsx new file mode 100644 index 000000000000..977e84f3e0f4 --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/clock.tsx @@ -0,0 +1,39 @@ +// Copyright (c) 2020 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +import * as React from 'react' + +import { + SettingsRow, + SettingsText +} from '../../../components/default' +import { Toggle } from '../../../components/toggle' + +import { getLocale } from '../../../../common/locale' + +interface Props { + toggleShowClock: () => void + showClock: boolean +} + +class ClockSettings extends React.PureComponent { + render () { + const { toggleShowClock, showClock } = this.props + return ( +
+ + {getLocale('showClock')} + + +
+ ) + } +} + +export default ClockSettings diff --git a/components/brave_new_tab_ui/containers/newTab/settings/icons/backgroundImage.svg b/components/brave_new_tab_ui/containers/newTab/settings/icons/backgroundImage.svg new file mode 100644 index 000000000000..a1beb9946fbc --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/icons/backgroundImage.svg @@ -0,0 +1,7 @@ + + diff --git a/components/brave_new_tab_ui/containers/newTab/settings/icons/braveRewards.svg b/components/brave_new_tab_ui/containers/newTab/settings/icons/braveRewards.svg new file mode 100644 index 000000000000..68329585b336 --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/icons/braveRewards.svg @@ -0,0 +1,7 @@ + + diff --git a/components/brave_new_tab_ui/containers/newTab/settings/icons/braveStats.svg b/components/brave_new_tab_ui/containers/newTab/settings/icons/braveStats.svg new file mode 100644 index 000000000000..ce4c8fcb9d4b --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/icons/braveStats.svg @@ -0,0 +1,7 @@ + + diff --git a/components/brave_new_tab_ui/containers/newTab/settings/icons/clock.svg b/components/brave_new_tab_ui/containers/newTab/settings/icons/clock.svg new file mode 100644 index 000000000000..404c1f3cfbbe --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/icons/clock.svg @@ -0,0 +1,7 @@ + + diff --git a/components/brave_new_tab_ui/containers/newTab/settings/icons/moreCards.svg b/components/brave_new_tab_ui/containers/newTab/settings/icons/moreCards.svg new file mode 100644 index 000000000000..e13859e37202 --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/icons/moreCards.svg @@ -0,0 +1,7 @@ + + diff --git a/components/brave_new_tab_ui/containers/newTab/settings/icons/topSites.svg b/components/brave_new_tab_ui/containers/newTab/settings/icons/topSites.svg new file mode 100644 index 000000000000..89b5c9061f47 --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/icons/topSites.svg @@ -0,0 +1,7 @@ + + diff --git a/components/brave_new_tab_ui/containers/newTab/settings/moreCards.tsx b/components/brave_new_tab_ui/containers/newTab/settings/moreCards.tsx new file mode 100644 index 000000000000..d1b5ba1f5d6c --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/moreCards.tsx @@ -0,0 +1,44 @@ +// Copyright (c) 2020 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +import * as React from 'react' + +import { + SettingsRow, + SettingsText +} from '../../../components/default' +import { Toggle } from '../../../components/toggle' + +import { getLocale } from '../../../../common/locale' + +interface Props { + toggleShowBinance: () => void + showBinance: boolean + binanceSupported: boolean +} + +class MoreCardsSettings extends React.PureComponent { + render () { + const { binanceSupported, toggleShowBinance, showBinance } = this.props + return ( +
+ { + binanceSupported + ? + {getLocale('showBinance')} + + + : null + } +
+ ) + } +} + +export default MoreCardsSettings diff --git a/components/brave_new_tab_ui/containers/newTab/settings/topSites.tsx b/components/brave_new_tab_ui/containers/newTab/settings/topSites.tsx new file mode 100644 index 000000000000..06f3666b9db8 --- /dev/null +++ b/components/brave_new_tab_ui/containers/newTab/settings/topSites.tsx @@ -0,0 +1,39 @@ +// Copyright (c) 2020 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/.*/ + +import * as React from 'react' + +import { + SettingsRow, + SettingsText +} from '../../../components/default' +import { Toggle } from '../../../components/toggle' + +import { getLocale } from '../../../../common/locale' + +interface Props { + toggleShowTopSites: () => void + showTopSites: boolean +} + +class TopSitesSettings extends React.PureComponent { + render () { + const { toggleShowTopSites, showTopSites } = this.props + return ( +
+ + {getLocale('showTopSites')} + + +
+ ) + } +} + +export default TopSitesSettings diff --git a/components/resources/brave_components_strings.grd b/components/resources/brave_components_strings.grd index d63834b2200b..86233d31013f 100644 --- a/components/resources/brave_components_strings.grd +++ b/components/resources/brave_components_strings.grd @@ -182,6 +182,7 @@ Top Sites Brave Rewards Binance + More cards Sponsored Images top sites Brave Stats