-
Notifications
You must be signed in to change notification settings - Fork 879
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
add qwant support #654
add qwant support #654
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,23 @@ interface Props { | |
} | ||
|
||
export default class NewPrivateTab extends React.PureComponent<Props, {}> { | ||
get isQwant () { | ||
return navigator.language === 'de' || navigator.language === 'fr' | ||
} | ||
|
||
get currentWindow () { | ||
const { isTor, useAlternativePrivateSearchEngine, onChangePrivateSearchEngine } = this.props | ||
if (isTor) { | ||
if (this.isQwant) { | ||
return <QwantTorTab /> | ||
} | ||
return <TorTab /> | ||
} | ||
|
||
if (this.isQwant) { | ||
return <QwantTab /> | ||
} | ||
|
||
return ( | ||
<PrivateTab | ||
useAlternativePrivateSearchEngine={useAlternativePrivateSearchEngine} | ||
|
@@ -35,7 +48,7 @@ export default class NewPrivateTab extends React.PureComponent<Props, {}> { | |
render () { | ||
const { isTor } = this.props | ||
return ( | ||
<Page isPrivate={!isTor}> | ||
<Page isPrivate={!isTor && !this.isQwant}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not private if it's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is just to change the background color. I should have written There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cezaraugusto that's ok, when things calm down we should look to improve some naming all around the webui's |
||
<PageWrapper> | ||
{this.currentWindow} | ||
</PageWrapper> | ||
|
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.
Nit: This can be a static const defined at the module level, since it does not rely on any props or anything to do with the component