diff --git a/browser/ui/webui/brave_webui_source.cc b/browser/ui/webui/brave_webui_source.cc
index 4fb066f2def6..de1d8e46f90c 100644
--- a/browser/ui/webui/brave_webui_source.cc
+++ b/browser/ui/webui/brave_webui_source.cc
@@ -439,13 +439,15 @@ void CustomizeWebUIHTMLSource(const std::string &name, content::WebUIDataSource*
}
}, {
std::string("sync"), {
- { "done", IDS_BRAVE_SYNC_SHARED_DONE_BUTTON },
+ // Shared strings
{ "remove", IDS_BRAVE_SYNC_SHARED_REMOVE_PARTIAL },
{ "copied", IDS_BRAVE_SYNC_SHARED_COPIED_TEXT },
{ "wordCount", IDS_BRAVE_SYNC_SHARED_WORD_COUNT_TEXT },
{ "ok", IDS_BRAVE_SYNC_SHARED_OK_BUTTON },
{ "cancel", IDS_BRAVE_SYNC_SHARED_CANCEL_BUTTON },
{ "thisSyncChain", IDS_BRAVE_SYNC_SHARED_FROM_THIS_CHAIN_PARTIAL },
+ { "lookingForDevice", IDS_BRAVE_SYNC_SCAN_CODE_LOOKING_FOR_DEVICE_BUTTON },
+ { "viewSyncCode", IDS_BRAVE_SYNC_ENABLED_VIEW_CODE_BUTTON },
// Enabled Content
{ "braveSync", IDS_BRAVE_SYNC_ENABLED_BRAVE_TITLE },
{ "syncChainDevices", IDS_BRAVE_SYNC_ENABLED_DEVICES_CHAIN_TITLE },
@@ -453,7 +455,6 @@ void CustomizeWebUIHTMLSource(const std::string &name, content::WebUIDataSource*
{ "thisDevice", IDS_BRAVE_SYNC_ENABLED_TABLE_THIS_DEVICE_TEXT },
{ "addedOn", IDS_BRAVE_SYNC_ENABLED_TABLE_ADDED_ON_TITLE },
{ "addDevice", IDS_BRAVE_SYNC_ENABLED_ADD_DEVICE_BUTTON },
- { "viewSyncCode", IDS_BRAVE_SYNC_ENABLED_VIEW_CODE_BUTTON },
{ "settingsTitle", IDS_BRAVE_SYNC_ENABLED_SETTINGS_TITLE },
{ "settingsDescription", IDS_BRAVE_SYNC_ENABLED_SETTINGS_DESCRIPTION },
{ "settings", IDS_BRAVE_SYNC_ENABLED_TABLE_SETTINGS },
@@ -466,7 +467,6 @@ void CustomizeWebUIHTMLSource(const std::string &name, content::WebUIDataSource*
{ "syncDescription", IDS_BRAVE_SYNC_DISABLED_NEW_CHAIN_DESCRIPTION },
{ "startSyncChain", IDS_BRAVE_SYNC_DISABLED_START_NEW_CHAIN_BUTTON },
{ "enterSyncChainCode", IDS_BRAVE_SYNC_DISABLED_ENTER_CODE_BUTTON },
- { "confirmSyncCode", IDS_BRAVE_SYNC_DISABLED_CONFIRM_CODE_BUTTON },
// [modal] Enter Sync Code
{ "enterSyncCode", IDS_BRAVE_SYNC_ENTER_CODE_TITLE },
{ "enterSyncCodeDescription", IDS_BRAVE_SYNC_ENTER_CODE_DESCRIPTION },
@@ -483,27 +483,23 @@ void CustomizeWebUIHTMLSource(const std::string &name, content::WebUIDataSource*
{ "deleteSyncDescription", IDS_BRAVE_SYNC_RESET_REMOVAL_INSTRUCTIONS },
{ "startSyncChainHowTo", IDS_BRAVE_SYNC_RESET_START_NEW_INSTRUCTIONS },
{ "areYouSure", IDS_BRAVE_SYNC_RESET_ARE_YOU_SURE_TITLE },
- // [modal] Add New Chain
- { "scanThisCode", IDS_BRAVE_SYNC_NEW_CHAIN_MAIN_DESCRIPTION },
- { "scanThisCodeHowTo", IDS_BRAVE_SYNC_NEW_CHAIN_MAIN_INSTRUCTIONS },
- { "enterCodeWordsInstead", IDS_BRAVE_SYNC_NEW_CHAIN_MAIN_CODE_WORDS_BUTTON },
- { "previous", IDS_BRAVE_SYNC_NEW_CHAIN_MAIN_PREVIOUS_BUTTON },
- { "lookingForDevice", IDS_BRAVE_SYNC_NEW_CHAIN_MAIN_LOOKING_FOR_DEVICE_BUTTON },
- // [modal] Add New Chain (Camera Option)
- // [modal] Add New Chain (no Camera)
- { "enterThisCode", IDS_BRAVE_SYNC_NEW_CHAIN_DESKTOP_TITLE },
- { "mobileEnterThisCode", IDS_BRAVE_SYNC_NEW_CHAIN_MOBILE_TITLE },
- { "syncChainCodeHowTo", IDS_BRAVE_SYNC_NEW_CHAIN_DESCRIPTION },
- { "useCameraInstead", IDS_BRAVE_SYNC_NEW_CHAIN_USE_CAMERA_BUTTON },
+ // [modal] Scan Code
+ { "scanThisCode", IDS_BRAVE_SYNC_SCAN_CODE_TITLE },
+ { "scanThisCodeHowToPartial1", IDS_BRAVE_SYNC_SCAN_CODE_DESCRIPTION_PARTIAL_1 },
+ { "scanThisCodeHowToPartial2", IDS_BRAVE_SYNC_SCAN_CODE_DESCRIPTION_PARTIAL_2 },
+ { "scanThisCodeHowToPartial3", IDS_BRAVE_SYNC_SCAN_CODE_DESCRIPTION_PARTIAL_3 },
+ // [modal] View Code
+ { "chainCode", IDS_BRAVE_SYNC_VIEW_CODE_TITLE },
+ { "chainCodeDescriptionPartial1", IDS_BRAVE_SYNC_VIEW_CODE_DESCRIPTION_PARTIAL_1 },
+ { "chainCodeDescriptionPartial2", IDS_BRAVE_SYNC_VIEW_CODE_DESCRIPTION_PARTIAL_2 },
+ { "chainCodeDescriptionPartial3", IDS_BRAVE_SYNC_VIEW_CODE_DESCRIPTION_PARTIAL_3 },
+ { "useCameraInstead", IDS_BRAVE_SYNC_VIEW_CODE_USE_CAMERA_BUTTON },
+ { "qrCode", IDS_BRAVE_SYNC_VIEW_CODE_QR_CODE },
// [modal] Choose Device Type
- { "letsSync", IDS_BRAVE_SYNC_CHOOSE_DEVICE_NEW_DEVICE_TITLE },
- { "chooseDeviceType", IDS_BRAVE_SYNC_CHOOSE_DEVICE_CHOOSE_DEVICE_TITLE },
+ { "letsSync", IDS_BRAVE_SYNC_CHOOSE_DEVICE_TITLE },
+ { "chooseDeviceType", IDS_BRAVE_SYNC_CHOOSE_DEVICE_DESCRIPTION },
{ "phoneTablet", IDS_BRAVE_SYNC_CHOOSE_DEVICE_MOBILE_TITLE },
{ "computer", IDS_BRAVE_SYNC_CHOOSE_DEVICE_COMPUTER_TITLE },
- // [modal] View Sync Code
- { "qrCode", IDS_BRAVE_SYNC_VIEW_CODE_QR_CODE_TITLE },
- { "wordCode", IDS_BRAVE_SYNC_VIEW_CODE_WORD_CODE_TITLE },
- { "privateKey", IDS_BRAVE_SYNC_VIEW_CODE_PRIVATE_KEY_PHRASE },
// errors
{ "errorWrongCodeTitle", IDS_BRAVE_SYNC_ERROR_WRONG_CODE_TITLE },
{ "errorWrongCodeDescription", IDS_BRAVE_SYNC_ERROR_WRONG_CODE_DESCRIPTION },
diff --git a/components/brave_sync/ui/BUILD.gn b/components/brave_sync/ui/BUILD.gn
index c1f015272312..15c775f09dee 100644
--- a/components/brave_sync/ui/BUILD.gn
+++ b/components/brave_sync/ui/BUILD.gn
@@ -3,8 +3,6 @@ import("//brave/components/common/typescript.gni")
transpile_web_ui("ui") {
inputs = [
"actions/sync_actions.ts",
- "components/modals/addNewChainCameraOption.tsx",
- "components/modals/addNewChainNoCamera.tsx",
"components/modals/deviceType.tsx",
"components/modals/enterSyncCode.tsx",
"components/modals/removeDevice.tsx",
diff --git a/components/brave_sync/ui/brave_sync.html b/components/brave_sync/ui/brave_sync.html
index 1748d21c05b1..a158d9af503b 100644
--- a/components/brave_sync/ui/brave_sync.html
+++ b/components/brave_sync/ui/brave_sync.html
@@ -22,7 +22,8 @@
diff --git a/components/brave_sync/ui/components/modals/addNewChainCameraOption.tsx b/components/brave_sync/ui/components/modals/addNewChainCameraOption.tsx
deleted file mode 100644
index d05c283d4f9d..000000000000
--- a/components/brave_sync/ui/components/modals/addNewChainCameraOption.tsx
+++ /dev/null
@@ -1,122 +0,0 @@
-/* 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'
-
-// Components
-import { Button, Modal, TextAreaClipboard } from 'brave-ui'
-
-// Feature-specific components
-import {
- ModalHeader,
- ModalTitle,
- ModalSubTitle,
- ModalContent,
- ThreeColumnButtonGrid,
- ThreeColumnButtonGridCol2,
- ThreeColumnButtonGridCol1
-} from 'brave-ui/features/sync'
-
-// Modals
-import ScanCodeModal from './scanCode'
-
-// Utils
-import { getLocale } from '../../../../common/locale'
-
-interface Props {
- fromMobileScreen?: boolean
- syncData: Sync.State
- actions: any
- onClose: () => void
-}
-
-interface State {
- useCameraInstead: boolean
-}
-
-export default class AddNewChainCameraOptionModal extends React.PureComponent {
- constructor (props: Props) {
- super(props)
- this.state = {
- useCameraInstead: false
- }
- }
-
- onClickUseCameraInsteadButton = () => {
- this.setState({ useCameraInstead: !this.state.useCameraInstead })
- }
-
- render () {
- const { fromMobileScreen, onClose, syncData, actions } = this.props
- const { useCameraInstead } = this.state
-
- return (
-
- {
- useCameraInstead
- ?
- : null
- }
-
-
-
- {
- fromMobileScreen
- ? getLocale('mobileEnterThisCode')
- : getLocale('enterThisCode')
- }
-
- {getLocale('syncChainCodeHowTo')}
-
-
-
- {
- syncData.syncWords
- ? (
-
- )
- : null
- }
-
-
-
-
-
-
-
-
-
-
-
- )
- }
-}
diff --git a/components/brave_sync/ui/components/modals/addNewChainNoCamera.tsx b/components/brave_sync/ui/components/modals/addNewChainNoCamera.tsx
deleted file mode 100644
index 6d537d635a5c..000000000000
--- a/components/brave_sync/ui/components/modals/addNewChainNoCamera.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* 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'
-
-// Components
-import { Button, Modal, TextAreaClipboard } from 'brave-ui'
-
-// Feature-specific components
-import {
- ModalHeader,
- ModalTitle,
- ModalSubTitle,
- ModalContent,
- TwoColumnButtonGrid,
- OneColumnButtonGrid
-} from 'brave-ui/features/sync'
-
-// Utils
-import { getLocale } from '../../../../common/locale'
-
-interface Props {
- syncData: Sync.State
- actions: any
- onClose: () => void
-}
-
-export default class AddNewChainNoCameraModal extends React.PureComponent {
- render () {
- const { onClose, syncData } = this.props
-
- return (
-
-
-
- {getLocale('enterThisCode')}
- {getLocale('syncChainCodeHowTo')}
-
-
-
- {
- syncData.syncWords
- ? (
-
- )
- : null
- }
-
-
-
-
-
-
-
-
- )
- }
-}
diff --git a/components/brave_sync/ui/components/modals/deviceType.tsx b/components/brave_sync/ui/components/modals/deviceType.tsx
index f5aec3c09bc5..d86dedfcbbb6 100644
--- a/components/brave_sync/ui/components/modals/deviceType.tsx
+++ b/components/brave_sync/ui/components/modals/deviceType.tsx
@@ -5,7 +5,7 @@
import * as React from 'react'
// Components
-import { Button, Modal, AlertBox } from 'brave-ui'
+import { Modal, AlertBox } from 'brave-ui'
// Feature-specific components
import {
@@ -19,8 +19,8 @@ import {
} from 'brave-ui/features/sync'
// Modals
-import AddNewChainNoCameraModal from './addNewChainNoCamera'
-import ScanCodeModal from './scanCode'
+import ViewSyncCode from './viewSyncCode'
+import ScanCode from './scanCode'
// Utils
import { getLocale } from '../../../../common/locale'
@@ -35,7 +35,7 @@ interface Props {
}
interface State {
- addNewChainNoCamera: boolean
+ viewSyncCode: boolean
scanCode: boolean
}
@@ -43,7 +43,7 @@ export default class DeviceTypeModal extends React.PureComponent {
constructor (props: Props) {
super(props)
this.state = {
- addNewChainNoCamera: false,
+ viewSyncCode: false,
scanCode: false
}
}
@@ -79,12 +79,12 @@ export default class DeviceTypeModal extends React.PureComponent {
}
onClickComputerButton = () => {
- this.setState({ addNewChainNoCamera: !this.state.addNewChainNoCamera })
+ this.setState({ viewSyncCode: !this.state.viewSyncCode })
}
render () {
const { actions, syncData } = this.props
- const { addNewChainNoCamera, scanCode } = this.state
+ const { viewSyncCode, scanCode } = this.state
return (
@@ -106,40 +106,28 @@ export default class DeviceTypeModal extends React.PureComponent {
}
{
scanCode
- ?
+ ?
: null
}
{
- addNewChainNoCamera
- ?
+ viewSyncCode
+ ?
: null
}
- {getLocale('letsSync')} “{syncData.thisDeviceName}”.
+ {getLocale('letsSync')}
{getLocale('chooseDeviceType')}
-
+
-
+ {getLocale('phoneTablet')}
-
+
-
+ {getLocale('computer')}
diff --git a/components/brave_sync/ui/components/modals/scanCode.tsx b/components/brave_sync/ui/components/modals/scanCode.tsx
index ef2fd401febd..ef4ff8355a70 100644
--- a/components/brave_sync/ui/components/modals/scanCode.tsx
+++ b/components/brave_sync/ui/components/modals/scanCode.tsx
@@ -6,20 +6,21 @@ import * as React from 'react'
// Components
import { Button, Modal } from 'brave-ui'
+import { LoaderIcon } from 'brave-ui/components/icons'
// Feature-specific components
import {
ModalHeader,
- ModalTitle,
- ModalSubTitle,
+ Title,
+ Bold,
+ Paragraph,
ScanGrid,
ThreeColumnButtonGrid,
- ThreeColumnButtonGridCol1,
- ThreeColumnButtonGridCol2
+ Link
} from 'brave-ui/features/sync'
// Modals
-import AddNewChainCameraOptionModal from './addNewChainCameraOption'
+import ViewSyncCode from './viewSyncCode'
// Utils
import { getLocale } from '../../../../common/locale'
@@ -33,36 +34,43 @@ interface Props {
onClose: () => void
}
interface State {
- enterCodeWordsInstead: boolean
+ viewSyncCode: boolean
}
export default class ScanCodeModal extends React.PureComponent {
constructor (props: Props) {
super(props)
this.state = {
- enterCodeWordsInstead: false
+ viewSyncCode: false
}
}
onClickEnterCodeWordsInstead = () => {
- this.setState({ enterCodeWordsInstead: !this.state.enterCodeWordsInstead })
+ this.setState({ viewSyncCode: !this.state.viewSyncCode })
+ }
+
+ onCancel = (event: React.MouseEvent) => {
+ event.preventDefault()
+ this.props.onClose()
}
render () {
const { onClose, syncData, actions } = this.props
- const { enterCodeWordsInstead } = this.state
+ const { viewSyncCode } = this.state
return (
-
+
{
- enterCodeWordsInstead
- ?
+ viewSyncCode
+ ?
: null
}
-
{getLocale('scanThisCode')}
-
{getLocale('scanThisCodeHowTo')}
+
{getLocale('scanThisCode')}
+
+ {getLocale('scanThisCodeHowToPartial1')} {getLocale('scanThisCodeHowToPartial2')} {getLocale('scanThisCodeHowToPartial3')}
+
@@ -74,36 +82,38 @@ export default class ScanCodeModal extends React.PureComponent {
}
-
+
+ {getLocale('cancel')}
+
+
-
-
-
-