From 42dc457d53f83634cab2932a09990d56c9674758 Mon Sep 17 00:00:00 2001 From: Pete Miller Date: Tue, 16 Oct 2018 17:11:48 -0700 Subject: [PATCH] Merge pull request #654 from brave/qwant add qwant support --- .../components/privateTab/index.tsx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/components/brave_new_tab_ui/components/privateTab/index.tsx b/components/brave_new_tab_ui/components/privateTab/index.tsx index 4cc3e54bea94..ce352787afcf 100644 --- a/components/brave_new_tab_ui/components/privateTab/index.tsx +++ b/components/brave_new_tab_ui/components/privateTab/index.tsx @@ -9,6 +9,8 @@ import { Page, PageWrapper } from 'brave-ui/features/newTab' // Components group import PrivateTab from './privateTab' +import QwantTab from './qwantTab' +import QwantTorTab from './qwantTorTab' import TorTab from './torTab' interface Props { @@ -18,12 +20,30 @@ interface Props { } export default class NewPrivateTab extends React.PureComponent { + get isQwant () { + // This is not technically accurately describing whether + // the browser has been automatically set to a Qwant region. + // Temporarily we are detecting language here, but we should + // use the same setting logic as used during first-run. + // https://github.com/brave/brave-browser/issues/1632 + return navigator.language && + navigator.language.startsWith('de') || + navigator.language.startsWith('fr') + } + get currentWindow () { const { isTor, useAlternativePrivateSearchEngine, onChangePrivateSearchEngine } = this.props if (isTor) { + if (this.isQwant) { + return + } return } + if (this.isQwant) { + return + } + return ( { render () { const { isTor } = this.props return ( - + {this.currentWindow}