+ // 'notificationItem' for styling with notificationBar.less
+ return
{
updateStatus === UpdateStatus.UPDATE_AVAILABLE ? : null
}
@@ -202,4 +216,22 @@ class UpdateBar extends ImmutableComponent {
}
}
+const styles = StyleSheet.create({
+ flexJustifyBetween: {
+ display: 'flex',
+ justifyContent: 'space-between',
+ flexFlow: 'row wrap'
+ },
+ flexAlignCenter: {
+ display: 'flex',
+ alignItems: 'center'
+ }
+})
+
+const updateBarStyle = css(
+ commonStyles.notificationBar,
+ commonStyles.notificationBar__notificationItem,
+ commonStyles.notificationBar__greetingStyle
+)
+
module.exports = UpdateBar
diff --git a/js/entry.js b/js/entry.js
index 34fec11bb5..323e2e6a40 100644
--- a/js/entry.js
+++ b/js/entry.js
@@ -14,7 +14,6 @@ require('../less/switchControls.less')
require('../less/tabs.less')
require('../less/findbar.less')
require('../less/dialogs.less')
-require('../less/updateBar.less')
require('../less/downloadBar.less')
require('../less/bookmarksToolbar.less')
require('../less/notificationBar.less')
diff --git a/less/notificationBar.less b/less/notificationBar.less
index e6a524eedd..3185fd9c76 100644
--- a/less/notificationBar.less
+++ b/less/notificationBar.less
@@ -3,108 +3,61 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
@import "variables.less";
-@import (reference) "button.less";
-.notificationBar {
- display: inline-block;
- width: 100%;
- cursor: default;
- -webkit-user-select: none;
+// TODO: refactor notificationBar.js and updateBar.js
+.notificationItem {
- .notificationItem {
- background-color: #ffefc0;
- border-bottom: 1px solid #888;
- line-height: 24px;
- padding: 6px 12px 6px 20px;
+ // TODO: refactor button.less
+ .browserButton {
+ border: none;
+ box-shadow: none;
+ line-height: 1;
- &.greetingStyle {
- background-color: #fff;
- padding: 8px 20px 6px 20px;
-
- .button {
- .browserButton();
-
- background-color: #eee;
- border-style: none;
- font-size: 14px;
- height: 25px;
- line-height: 27px;
- margin: auto 0 auto 4px;
- padding: 0px 25px;
- width: auto;
-
- &.primary {
- background-color: @braveOrange;
- color: #fff;
- margin-right: 0px;
-
- &:hover {
- background-color: lighten(@braveOrange, 10%);
- color: #fff !important;
- }
- &:active {
- background-color: darken(@braveOrange, 10%);
- color: #fff !important;
- }
- }
- }
- }
-
- label {
- font-size: 15px;
- padding: 0 10px 0 0;
- color: #666;
- }
-
- input[type="checkbox"] {
- margin: 0 3px;
+ &:hover {
+ border: none;
}
- .button {
- font-size: 13px;
- margin-right: 10px;
- padding: 2px 15px;
- text-transform: capitalize;
- width: auto;
+ &.whiteButton {
+ border: 1px solid @gray;
}
- .greeting {
- color: @braveOrange;
- font-size: 16px;
- margin: auto 10px auto 0;
- user-select: none;
- }
+ &.primaryButton {
+ background: @braveOrange;
+ border: 1px solid @braveOrange;
+ box-shadow: none;
+ font-weight: normal;
- .message {
- color: #000;
- font-size: 15px;
- margin: auto 0;
- user-select: none;
- cursor: default;
+ &:hover {
+ background: lighten(@braveOrange, 10%);
+ border: 1px solid lighten(@braveOrange, 10%);
+ }
- &.secondary {
- color: #888;
- font-size: 14px;
- padding: 0;
- margin: auto 0 auto 10px;
+ &:active {
+ background: darken(@braveOrange, 10%);
+ border: 1px solid darken(@braveOrange, 10%);
}
}
+ }
- .options {
- float: right;
- margin-left: 6px;
- }
+ // Copied to commonStyles.js - notificationItem__greetingStyle
+ // TODO: refactor app/ledger.js (style: 'greetingStyle')
+ &.greetingStyle {
+ background: #fff;
+ padding: 8px 20px;
+ width: 100%;
+ }
+}
- .spacer {
- flex-grow: 1;
- }
+// TODO: remove
+div[class*='notificationBar'] {
+ // Cancel the top margin of notificationBar (except the 1st one)
+ + div[class*='notificationBar'] {
+ margin-top: 0;
+ border-top: 0;
- .notificationAdvanced {
- color: grey;
- cursor: pointer;
- text-decoration: underline;
- font-size: 13px;
- margin: 5px;
+ // Cancel the top border of notificationItem (except the 1st one)
+ > div[class*='notificationItem'] {
+ border-top: 0;
}
}
}
diff --git a/less/tabs.less b/less/tabs.less
index f0ce3b78cd..c8d2151a26 100644
--- a/less/tabs.less
+++ b/less/tabs.less
@@ -122,7 +122,7 @@
background: @tabsBackground;
display: flex;
height: @tabsToolbarHeight;
- border-top: 1px solid #bbb;
+ border-top: 1px solid @tabsToolbarBorderColor;
-webkit-user-select: none;
}
diff --git a/less/updateBar.less b/less/updateBar.less
deleted file mode 100644
index 10ec46b097..0000000000
--- a/less/updateBar.less
+++ /dev/null
@@ -1,14 +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 "variables.less";
-@import (reference) "notificationBar.less";
-
-.updateBar {
- &:extend(.notificationBar.greetingStyle);
- .notificationBar .notificationItem();
- .notificationBar .notificationItem.greetingStyle();
-
- padding: 8px 16px 8px 20px;
-}
diff --git a/less/variables.less b/less/variables.less
index 6180aac0ff..e5646ac135 100644
--- a/less/variables.less
+++ b/less/variables.less
@@ -22,6 +22,7 @@
@tabsBackground: #ddd;
@tabsBackgroundInactive: #ddd;
+@tabsToolbarBorderColor: #bbb;
@navigationBarBackground: @chromeSecondary;
@navigationBarBackground: #f7f7f7;
@navigationBarBackgroundActive: #fff;
diff --git a/test/bravery-components/notificationBarTest.js b/test/bravery-components/notificationBarTest.js
index 8fb330d9f0..a4fdc32f03 100644
--- a/test/bravery-components/notificationBarTest.js
+++ b/test/bravery-components/notificationBarTest.js
@@ -40,7 +40,7 @@ describe('notificationBar permissions', function () {
.loadUrl(this.notificationUrl)
.windowByUrl(Brave.browserWindowUrl)
.waitForExist(notificationBar)
- .element('.notificationItem:nth-Child(1) .options')
+ .element('.notificationItem:nth-Child(1) [data-test-id="notificationOptions"]')
.click('button=Deny')
.activateTitleMode()
.waitUntil(function () {
diff --git a/test/lib/selectors.js b/test/lib/selectors.js
index 73c914ddef..afd524f64b 100644
--- a/test/lib/selectors.js
+++ b/test/lib/selectors.js
@@ -22,7 +22,7 @@ module.exports = {
navigatorBookmarked: '#navigator .removeBookmarkButton',
navigatorNotBookmarked: '#navigator .bookmarkButton',
bookmarksToolbar: '.bookmarksToolbar',
- notificationBar: '.notificationBar',
+ notificationBar: '[data-test-id="notificationBar"]',
errorContent: '.errorContent',
errorUrl: '.errorUrl',
errorText: '.errorText',