Skip to content

Commit 42a3ef8

Browse files
committed
Private New Tab Page now shows only applicable Mac / non-Mac keys to open Tor
Also corrects the actual keys in the string Fix brave/brave-browser#1688
1 parent 0d965c4 commit 42a3ef8

File tree

4 files changed

+34
-17
lines changed

4 files changed

+34
-17
lines changed

components/brave_new_tab_ui/components/privateTab/privateTab.tsx

+2-7
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ import {
1717
Text,
1818
PrivateImage,
1919
DuckDuckGoImage,
20-
TorLockImage,
2120
Separator,
2221
FakeButton,
2322
Link
2423
} from 'brave-ui/features/newTab'
2524

2625
// Components
2726
import { Toggle } from 'brave-ui/features/shields'
27+
import TorContent from './torContent'
2828

2929
// Helpers
3030
import { getLocale } from '../../../common/locale'
@@ -74,12 +74,7 @@ export default class PrivateTab extends React.PureComponent<Props, {}> {
7474
</ButtonGroup>
7575
</Box>
7676
<Box>
77-
<Content>
78-
<TorLockImage />
79-
<SubTitle>{getLocale('boxTorLabel')}</SubTitle>
80-
<Title>{getLocale('boxTorTitle')}</Title>
81-
<Text>{getLocale('boxTorText2')}</Text>
82-
</Content>
77+
<TorContent />
8378
<Separator />
8479
<FakeButton href='https://support.brave.com/hc/en-us/articles/360018121491' target='_blank'>
8580
{getLocale('boxTorButton')}

components/brave_new_tab_ui/components/privateTab/qwantTab.tsx

+2-9
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@ import * as React from 'react'
88
import {
99
Grid2Columns,
1010
Box,
11-
Content,
1211
HeaderBox,
1312
Title,
1413
SubTitle,
1514
Text,
1615
TorImage,
17-
TorLockImage,
1816
Separator,
1917
FakeButton
2018
} from 'brave-ui/features/newTab'
21-
19+
import TorContent from './torContent'
2220
// Helpers
2321
import { getLocale } from '../../../common/locale'
2422

@@ -40,12 +38,7 @@ export default class QwantTab extends React.PureComponent<{}, {}> {
4038
</div>
4139
</HeaderBox>
4240
<Box>
43-
<Content>
44-
<TorLockImage />
45-
<SubTitle>{getLocale('boxTorLabel')}</SubTitle>
46-
<Title>{getLocale('boxTorTitle')}</Title>
47-
<Text>{getLocale('boxTorText2')}</Text>
48-
</Content>
41+
<TorContent />
4942
<Separator />
5043
<FakeButton
5144
href='https://support.brave.com/hc/en-us/articles/360018121491'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
3+
// you can obtain one at http://mozilla.org/MPL/2.0/.
4+
5+
import * as React from 'react'
6+
// Feature-specific components
7+
import {
8+
Content,
9+
Title,
10+
SubTitle,
11+
Text,
12+
TorLockImage
13+
} from 'brave-ui/features/newTab'
14+
// Helpers
15+
import { getLocale } from '../../../common/locale'
16+
17+
const isMac = window.navigator.userAgent.includes('Macintosh')
18+
const torKeyboardShortcutText = isMac ? '⌥⌘N' : 'Alt+Shift+N'
19+
20+
export default function TorContent () {
21+
return (
22+
<Content>
23+
<TorLockImage />
24+
<SubTitle>{getLocale('boxTorLabel')}</SubTitle>
25+
<Title>{getLocale('boxTorTitle')}</Title>
26+
<Text>{getLocale('boxTorText2', { key: torKeyboardShortcutText })}</Text>
27+
</Content>
28+
)
29+
}

components/resources/brave_components_resources.grd

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
<message name="IDS_BRAVE_PRIVATE_NEW_TAB_BOX_TOR_LABEL_2" desc="">This Private Window is much more private</message>
189189
<message name="IDS_BRAVE_PRIVATE_NEW_TAB_BOX_TOR_TITLE" desc="">with Tor</message>
190190
<message name="IDS_BRAVE_PRIVATE_NEW_TAB_BOX_TOR_TEXT_1" desc="">Tor hides your IP address from the sites you visit, by routing your browsing through several Tor servers before it reaches your destination. These connections are encrypted, so your ISP or employer can’t see which sites you’re visiting either. Tor can slow down browsing and some sites might not work at all.</message>
191-
<message name="IDS_BRAVE_PRIVATE_NEW_TAB_BOX_TOR_TEXT_2" desc="">Using Private Tabs only changes what Brave does on your device — it doesn't change anyone else's behavior. Tor hides your IP address from the sites you visit, and hides the sites you visit from your ISP or your employer. Open a Private Window with Tor from the menu, or with Alt+Shift+N or Option+Shift+N.</message>
191+
<message name="IDS_BRAVE_PRIVATE_NEW_TAB_BOX_TOR_TEXT_2" desc="">Using Private Tabs only changes what Brave does on your device — it doesn't change anyone else's behavior. Tor hides your IP address from the sites you visit, and hides the sites you visit from your ISP or your employer. Open a Private Window with Tor from the menu, or with {{ key }}.</message>
192192
<message name="IDS_BRAVE_PRIVATE_NEW_TAB_BOX_TOR_BUTTON" desc="">Learn more about Tor in Brave</message>
193193

194194
<!-- WebUI adblock resources -->

0 commit comments

Comments
 (0)