}
@@ -307,52 +458,99 @@ class SyncTab extends ImmutableComponent {
return
{
this.isSetup && this.props.syncNewDeviceOverlayVisible
- ?
+ ?
: null
}
{
!this.isSetup && this.props.syncStartOverlayVisible
- ?
+ ?
: null
}
{
!this.isSetup && this.props.syncAddOverlayVisible
- ?
+ ?
: null
}
{
this.isSetup && this.props.syncResetOverlayVisible
- ?
+ ?
: null
}
-
-
- beta
-
-
-
-
-
-
-
- {
- this.setupError
- ? this.errorContent
- : this.isSetup
- ? this.postSetupContent
- : this.setupContent
- }
-
+
+
+
+ beta
+
+
+
+
+
+
+
+
+ {
+ this.setupError
+ ? this.errorContent
+ : this.isSetup
+ ? this.postSetupContent
+ : this.setupContent
+ }
+
+
{
this.isSetup && this.enabled
- ?
+ ?
+
: null
}
{
@@ -364,4 +562,99 @@ class SyncTab extends ImmutableComponent {
}
}
+const styles = StyleSheet.create({
+ marginButton: {
+ marginLeft: globalStyles.spacing.overlayButtonMargin
+ },
+ settingsListContainerMargin__top: {
+ marginTop: globalStyles.spacing.settingsListContainerMargin
+ },
+ settingsListContainerMargin__bottom: {
+ marginBottom: globalStyles.spacing.settingsListContainerMargin
+ },
+ passphrase: {
+ font: '18px monospace'
+ },
+ subText: {
+ color: globalStyles.color.gray,
+ fontSize: '.9rem',
+ marginTop: '.5rem'
+ },
+
+ setupContent: {
+ marginTop: globalStyles.spacing.dialogInsideMargin
+ },
+ errorContent__setupError: {
+ color: globalStyles.color.braveDarkOrange,
+ fontWeight: 'bold',
+ margin: `calc(${globalStyles.spacing.panelPadding} / 2) 0 ${globalStyles.spacing.dialogInsideMargin}`
+ },
+
+ device__box: {
+ display: 'flex',
+ alignItems: 'center',
+ background: globalStyles.color.lightGray,
+ borderRadius: globalStyles.radius.borderRadiusUIbox,
+ color: globalStyles.color.mediumGray,
+ margin: `${globalStyles.spacing.panelMargin} 0`,
+ padding: globalStyles.spacing.panelPadding,
+ width: '500px'
+ },
+ device__item: {
+ flex: 1
+ },
+ device__syncDeviceLabel: {
+ fontSize: '.9rem'
+ },
+ device__deviceName: {
+ marginTop: `calc(${globalStyles.spacing.panelPadding} / 2)`
+ },
+
+ devices__devicesList: {
+ // TODO: refactor sortableTable to remove !important
+ marginBottom: `${globalStyles.spacing.dialogInsideMargin} !important`,
+ width: '34em !important'
+ },
+ devices__devicesListCell: {
+ padding: '4px 8px'
+ },
+
+ textArea__passphrase: {
+ width: '80%',
+ height: '100px'
+ },
+
+ listItem__passphrase: {
+ margin: `${globalStyles.spacing.dialogInsideMargin} 0`,
+ color: globalStyles.color.braveDarkOrange
+ },
+
+ syncOverlayBody__wrapper: {
+ padding: `${globalStyles.spacing.dialogInsideMargin} 50px`,
+ background: '#fff'
+ },
+ syncOverlayBody__listWrapper: {
+ listStyle: 'none'
+ },
+ syncOverlayBody__listItem: {
+ margin: globalStyles.spacing.dialogInsideMargin
+ },
+
+ syncOverlayBody__syncQRImg: {
+ position: 'relative',
+ right: globalStyles.spacing.dialogInsideMargin
+ },
+ syncOverlayBody__label: {
+ // TODO: refactor preferences.less
+ // See: .settingsList .settingItem > *:not(.switchControl)
+ marginBottom: `${globalStyles.spacing.modalPanelHeaderMarginBottom} !important`
+ },
+ syncOverlayBody__form: {
+ marginBottom: globalStyles.spacing.settingsListContainerMargin
+ },
+ syncOverlayBody__formBottomMargin: {
+ marginBottom: globalStyles.spacing.dialogInsideMargin
+ }
+})
+
module.exports = SyncTab
diff --git a/app/renderer/components/styles/commonStyles.js b/app/renderer/components/styles/commonStyles.js
index 2f720accfd8..f8793b5e53f 100644
--- a/app/renderer/components/styles/commonStyles.js
+++ b/app/renderer/components/styles/commonStyles.js
@@ -34,6 +34,17 @@ const styles = StyleSheet.create({
outlineWidth: '1px'
}
},
+ textbox__isSettings: {
+ width: '280px'
+ },
+
+ // TextArea -- copied from textbox.js
+ textArea: {
+ padding: '5px'
+ },
+ textArea__isDefault: {
+ fontSize: globalStyles.spacing.textAreaFontSize
+ },
// Dialogs
flyoutDialog: {
@@ -52,6 +63,29 @@ const styles = StyleSheet.create({
maxHeight: `calc(80vh - ${globalStyles.spacing.downloadsBarHeight})`
},
+ // modalOverlay
+ // TODO: refactor modalOverlay
+ modalOverlay__dialog: {
+ // TODO: refactor preferences.less to remove !important
+ background: `linear-gradient(${globalStyles.color.modalVeryLightGray}, ${globalStyles.color.modalLightGray}) !important`,
+ borderRadius: `${globalStyles.radius.borderRadiusModal} !important`
+ },
+ modalOverlay__title: {
+ marginBottom: 0,
+
+ // TODO: refactor modalOverlay.less to remove !important
+ padding: '25px 0 !important'
+ },
+
+ modalOverlay__footer: {
+ padding: '20px'
+ },
+ modalOverlay__footerButton: {
+ display: 'flex',
+ flexFlow: 'nowrap',
+ justifyContent: 'flex-end'
+ },
+
// itemList.less
listItem: {
cursor: 'default',
diff --git a/app/renderer/components/styles/global.js b/app/renderer/components/styles/global.js
index 4acee7ec816..775073f9af2 100644
--- a/app/renderer/components/styles/global.js
+++ b/app/renderer/components/styles/global.js
@@ -58,6 +58,8 @@ const globalStyles = {
gray: 'rgb(153, 153, 153)',
mediumGray: 'rgb(101, 101, 101)',
darkGray: 'rgb(68, 68, 68)',
+ modalVeryLightGray: 'rgb(247, 247, 247)',
+ modalLightGray: 'rgb(231, 231, 231)',
white25: 'rgba(255, 255, 255, 0.25)',
white50: 'rgba(255, 255, 255, 0.5)',
white100: 'rgba(255, 255, 255, 1)',
@@ -90,6 +92,7 @@ const globalStyles = {
borderRadiusTabs: '4px',
borderRadiusURL: '4px',
borderRadiusUIbox: '8px',
+ borderRadiusModal: '8px',
bigBorderRadius: '14px',
switchRadius: '10px',
carotRadius: '8px'
@@ -140,9 +143,14 @@ const globalStyles = {
dialogTopOffset: '30px',
dialogInsideMargin: '18px',
paymentsMargin: '20px',
- modalPanelHeaderMarginBottom: '.5em',
- paddingHorizontal: '30px',
- privateTabPadding: '40px'
+ privateTabPaddingHorizontal: '30px',
+ privateTabPadding: '40px',
+ settingsListContainerMargin: '2rem',
+ modalPanelHeaderMarginBottom: '.5rem',
+ overlayButtonMargin: '8px',
+ panelMargin: '15px',
+ panelItemMargin: '12px',
+ panelPadding: '18px'
},
shadow: {
switchShadow: 'inset 0 1px 4px rgba(0, 0, 0, 0.35)',
diff --git a/app/renderer/components/styles/payment.js b/app/renderer/components/styles/payment.js
index 83b54186408..427d4744d6b 100644
--- a/app/renderer/components/styles/payment.js
+++ b/app/renderer/components/styles/payment.js
@@ -9,16 +9,18 @@ const paymentStyles = {
font: {
regular: '14.5px'
},
+ width: {
+ tableRow: '235px',
+ tableCell: '265px' // width.tableRow + 30px
+ },
+
+ // Copied to global.js
margin: {
bar: '15px',
barItem: '12px'
},
padding: {
bar: '18px' // margin.barItem * 1.5
- },
- width: {
- tableRow: '235px',
- tableCell: '265px' // width.tableRow + 30px
}
}
@@ -41,13 +43,7 @@ const paymentCommon = StyleSheet.create({
padding: '20px 20px 20px 50px'
},
marginButtons: {
- marginLeft: '8px'
- },
- advanceFooter: {
- padding: '20px',
- display: 'flex',
- flexWrap: 'wrap',
- justifyContent: 'flex-end'
+ marginLeft: globalStyles.spacing.overlayButtonMargin
}
})
diff --git a/js/about/newprivatetab.js b/js/about/newprivatetab.js
index fc907af84b7..20878a06609 100644
--- a/js/about/newprivatetab.js
+++ b/js/about/newprivatetab.js
@@ -54,7 +54,7 @@ const styles = StyleSheet.create({
display: 'flex',
alignSelf: 'center',
maxWidth: '780px',
- padding: `${globalStyles.spacing.paddingHorizontal} 0`,
+ padding: `${globalStyles.spacing.privateTabPaddingHorizontal} 0`,
[atBreakpoint]: {
flexDirection: 'column'
diff --git a/js/components/sortableTable.js b/js/components/sortableTable.js
index 27ad94b1e44..8dd3b32bb9c 100644
--- a/js/components/sortableTable.js
+++ b/js/components/sortableTable.js
@@ -360,7 +360,15 @@ class SortableTable extends React.Component {
const value = typeof item === 'object' ? item.value : item
const html = typeof item === 'object' ? item.html : item
const cell = typeof item === 'object' ? item.cell : item
- return
+
+ let hasColumnClassNames = (this.hasColumnClassNames ? this.props.columnClassNames[j] : '')
+ let customCellClassesStr = (this.props.customCellClasses ? this.props.customCellClasses : '')
+
+ return |
{
cell || (value === true ? '✕' : html)
}
diff --git a/less/about/preferences.less b/less/about/preferences.less
index 1c6bbbfb61c..3ede8c061e5 100644
--- a/less/about/preferences.less
+++ b/less/about/preferences.less
@@ -56,7 +56,7 @@ a {
}
.settingsListContainer {
- margin-bottom: 2em;
+ margin-bottom: @settingsListContainerMargin;
}
.settingsListTitle,
@@ -286,6 +286,7 @@ table.sortableTable {
}
// This defines the styling of modal dialogs on "Add funds..." and "Advanced Settings..."
+ // TODO: Use modalOverlay in commonStyles.js
.modal {
.dialog {
background: linear-gradient(@modalVeryLightGray, @modalLightGray);
@@ -565,96 +566,3 @@ table.sortableTable {
cursor: pointer;
}
}
-
-.syncContainer {
- .modal {
- textarea {
- width: 80%;
- height: 100px;
- font-size: 18px;
- font-family: monospace;
- }
- li {
- margin: 1em;
- }
- .settingsListContainer {
- margin-bottom: 1.5em;
- }
- .dialog-body, .dialog-footer {
- padding-left: 50px;
- padding-right: 50px;
- }
- .dialog-footer {
- margin-top: 1.5em;
- padding-bottom: 2em;
- display: flex;
- flex-wrap: wrap;
- justify-content: flex-start;
- }
- }
- .browserButton + .browserButton {
- margin-left: 0.75em;
- }
- .setupContent, .setupError {
- margin: 1em 0;
- }
- .setupError {
- color: red;
- font-weight: bold;
- }
- .deviceNameInput {
- width: 50%;
- }
- .syncBetaMessage {
- color: grey;
- margin-top: 8px;
- }
- .device {
- background-color: @lightGray;
- border-radius: @borderRadiusUIbox;
- color: @mediumGray;
- display: table;
- line-height: 1.8em;
- margin: 1em 0;
- padding: 0.5em 1em;
- width: 32em;
- & > div, .settingItem {
- display: table-cell;
- vertical-align: middle;
- }
- #syncEnableSwitch {
- width: 50%;
- }
- .syncDeviceLabel {
- font-size: 0.9em;
- margin: 0;
- }
- .deviceName {
- margin-bottom: 0.5em;
- }
- }
- .devices {
- margin: 1em 0;
- }
- .devicesList {
- width: 34em;
- margin-bottom: 1em;
- td {
- padding: 4px 8px;
- }
- }
- .settingsListContainer {
- margin-bottom: 1.5em;
- }
-}
-
-#syncPassphrase {
- margin: 1em;
- color: #ff0400;
- font-size: 15px;
- font-family: monospace;
-}
-
-#syncQR {
- margin: 1em;
-}
diff --git a/less/button.less b/less/button.less
index 694a7af583d..b167aa2ac29 100644
--- a/less/button.less
+++ b/less/button.less
@@ -140,19 +140,6 @@ span.buttonSeparator {
}
}
-.linkButton {
- color: @braveOrange;
- cursor: pointer;
- font-size: 0.9rem;
-
- &:not([disabled]):hover {
- color: black;
- }
- &[disabled] {
- color: @gray;
- }
-}
-
// for about:preferences
.prefBody {
.settingsList > .settingItem + button,
@@ -177,7 +164,9 @@ span.buttonSeparator {
margin-top: 5px;
}
- .paymentsContainer {
+ .paymentsContainer,
+ // TODO: refactor button.less to remove this and apply overlayButtonMargin in global.js
+ .syncContainer {
.browserButton + .browserButton {
margin-left: 8px;
}
diff --git a/less/forms.less b/less/forms.less
index aef79b23eb2..3bf6a0bbece 100644
--- a/less/forms.less
+++ b/less/forms.less
@@ -348,19 +348,3 @@ select {
}
}
}
-
-// From commonStyles.js
-.formControl {
- background: white;
- border: solid 1px @black10;
- border-radius: @borderRadius;
- box-shadow: inset 0 1px 1px @black10;
- box-sizing: border-box;
- display: block;
- color: @darkGray;
- font-size: 14.5px;
- height: 2.25em;
- outline: none;
- padding: 0.4em;
- width: 100%;
-}
diff --git a/less/variables.less b/less/variables.less
index 7e0074c006f..dac97f1d620 100644
--- a/less/variables.less
+++ b/less/variables.less
@@ -89,6 +89,8 @@
@bookmarksFileIconSize: 13px;
@bookmarksFolderIconSize: 15px;
+@settingsListContainerMargin: 2rem;
+
@navbarMenubarMargin: 7px;
@navbarButtonSpacing: 4px;
@navbarButtonWidth: 20px;
diff --git a/test/misc-components/syncTest.js b/test/misc-components/syncTest.js
index 2487d5e92c6..e9e9731b0bc 100644
--- a/test/misc-components/syncTest.js
+++ b/test/misc-components/syncTest.js
@@ -12,10 +12,10 @@ const aboutBookmarksUrl = getTargetAboutUrl('about:bookmarks')
const aboutHistoryUrl = getTargetAboutUrl('about:history')
const prefsUrl = 'about:preferences'
-const startButton = '[data-l10n-id="syncStart"]'
-const addButton = '[data-l10n-id="syncAdd"]'
-const createButton = '[data-l10n-id="syncCreate"]'
-const newDeviceButton = '[data-l10n-id="syncNewDevice"]'
+const startButton = '[data-test-id="syncStartButton"]'
+const addButton = '[data-test-id="syncAddButton"]'
+const createButton = '[data-test-id="syncCreateButton"]'
+const newDeviceButton = '[data-test-id="syncNewDeviceButton"]'
const PANEL_SEED = Immutable.fromJS(Array(32).fill(0))
@@ -187,8 +187,8 @@ describe('Sync Panel', function () {
.click(syncTab)
.waitForExist(newDeviceButton)
.click(newDeviceButton)
- .click('[data-l10n-id="syncShowPassphrase"]')
- .waitForTextValue('#syncPassphrase', 'idyllic undergrowth sheepman chez\nwishy undergrounder verseman plyer\na a a a\na a a a')
+ .click('[data-test-id="syncShowPassphraseButton"]')
+ .waitForTextValue('[data-test-id="syncPassphrase"]', 'idyllic undergrowth sheepman chez\nwishy undergrounder verseman plyer\na a a a\na a a a')
})
})
@@ -210,7 +210,7 @@ describe('Sync Panel', function () {
.waitForVisible(createButton)
.click(createButton)
.waitUntil(function () {
- return this.getText('.setupError').then((val) => {
+ return this.getText('[data-test-id="syncSetupError"]').then((val) => {
return val.includes('connection failed')
})
})
@@ -276,8 +276,8 @@ describe('Sync Panel', function () {
.click(syncTab)
.waitForVisible(syncSwitch)
.click(syncSwitch)
- .waitForExist('#syncData .switchBackground')
- .click('#syncData .switchBackground')
+ .waitForExist('[data-test-id="syncDataSection"] .switchBackground')
+ .click('[data-test-id="syncDataSection"] .switchBackground')
.windowByUrl(Brave.browserWindowUrl)
.waitUntil(function () {
return this.getAppState().then((val) => {
@@ -296,11 +296,11 @@ describe('Sync Panel', function () {
.click(syncSwitch)
.waitForExist(newDeviceButton)
.click(newDeviceButton)
- .click('[data-l10n-id="syncShowPassphrase"]')
- .waitForTextValue('#syncPassphrase', 'a a a a\na a a a\na a a a\na a a a')
- .click('[data-l10n-id="syncShowQR"]')
+ .click('[data-test-id="syncShowPassphraseButton"]')
+ .waitForTextValue('[data-test-id="syncPassphrase"]', 'a a a a\na a a a\na a a a\na a a a')
+ .click('[data-test-id="syncShowQRButton"]')
.waitUntil(function () {
- return this.getAttribute('#syncQR', 'src').then((text) => {
+ return this.getAttribute('[data-test-id="syncQRImg"]', 'src').then((text) => {
return text === 'data:image/png;base64,foo'
})
})
|