From 0b6b746607805d892ae0ee6acc112e2556cd1b0f Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Thu, 17 May 2018 10:54:00 -0700 Subject: [PATCH] Revert Aphrodite changes that were breaking bookmark modals Fixes https://github.com/brave/browser-laptop/issues/12498 Unfixes https://github.com/brave/browser-laptop/issues/10977 Auditors: @NejcZdovc, @cezaraugusto Revert "Polish CommonForm" This reverts commit c5186d5829e6aa5cd18ec3d6b125aaa4c9d810fe. Revert "Add FlyoutDialog" This reverts commit 32dca6fb276e0c4ef4773dba81e8fa596316c182. --- .../autofill/autofillAddressPanel.js | 14 +- .../autofill/autofillCreditCardPanel.js | 16 +- .../bookmarks/addEditBookmarkFolder.js | 30 ++- .../bookmarks/addEditBookmarkFolderForm.js | 5 +- .../bookmarks/addEditBookmarkForm.js | 5 +- .../bookmarks/addEditBookmarkHanger.js | 29 ++- app/renderer/components/common/commonForm.js | 191 +++++++++++------- .../components/common/flyoutDialog.js | 45 ----- app/renderer/components/common/messageBox.js | 7 +- app/renderer/components/main/braveryPanel.js | 12 +- .../main/checkDefaultBrowserDialog.js | 17 +- .../components/main/clearBrowsingDataPanel.js | 21 +- .../components/main/importBrowserDataPanel.js | 27 +-- app/renderer/components/main/loginRequired.js | 22 +- app/renderer/components/main/releaseNotes.js | 17 +- app/renderer/components/main/siteInfo.js | 11 +- app/renderer/components/main/widevinePanel.js | 25 ++- .../components/styles/commonStyles.js | 17 ++ js/about/styles.js | 83 ++++---- 19 files changed, 332 insertions(+), 262 deletions(-) delete mode 100644 app/renderer/components/common/flyoutDialog.js diff --git a/app/renderer/components/autofill/autofillAddressPanel.js b/app/renderer/components/autofill/autofillAddressPanel.js index 1e4d7422bd6..bac1b2c69fc 100644 --- a/app/renderer/components/autofill/autofillAddressPanel.js +++ b/app/renderer/components/autofill/autofillAddressPanel.js @@ -11,9 +11,11 @@ const ReduxComponent = require('../reduxComponent') const Dialog = require('../common/dialog') const Button = require('../common/button') const { - CommonForm, + CommonFormLarge, CommonFormSection, + CommonFormTitle, CommonFormDropdown, + CommonFormButtonWrapper, commonFormStyles } = require('../common/commonForm') @@ -158,8 +160,8 @@ class AutofillAddressPanel extends React.Component { render () { return - - + +
@@ -271,7 +273,7 @@ class AutofillAddressPanel extends React.Component {
- +
} } diff --git a/app/renderer/components/autofill/autofillCreditCardPanel.js b/app/renderer/components/autofill/autofillCreditCardPanel.js index 390055ae68c..064ec72e443 100644 --- a/app/renderer/components/autofill/autofillCreditCardPanel.js +++ b/app/renderer/components/autofill/autofillCreditCardPanel.js @@ -13,8 +13,10 @@ const Button = require('../common/button') const { CommonForm, CommonFormSection, + CommonFormTitle, CommonFormDropdown, CommonFormTextbox, + CommonFormButtonWrapper, commonFormStyles } = require('../common/commonForm') @@ -126,9 +128,9 @@ class AutofillCreditCardPanel extends React.Component { render () { return -
@@ -200,7 +202,7 @@ class AutofillCreditCardPanel extends React.Component {
- +
} } +module.exports = ReduxComponent.connect(AutofillCreditCardPanel) + const styles = StyleSheet.create({ // Copied from textbox.js input: { @@ -235,5 +239,3 @@ const styles = StyleSheet.create({ marginLeft: `calc(${globalStyles.spacing.dialogInsideMargin} / 3)` } }) - -module.exports = ReduxComponent.connect(AutofillCreditCardPanel) diff --git a/app/renderer/components/bookmarks/addEditBookmarkFolder.js b/app/renderer/components/bookmarks/addEditBookmarkFolder.js index 9eef561e312..2bed10a30f0 100644 --- a/app/renderer/components/bookmarks/addEditBookmarkFolder.js +++ b/app/renderer/components/bookmarks/addEditBookmarkFolder.js @@ -4,15 +4,13 @@ const React = require('react') const Immutable = require('immutable') +const {StyleSheet, css} = require('aphrodite/no-important') // Components const ReduxComponent = require('../reduxComponent') const Dialog = require('../common/dialog') const AddEditBookmarkFolderForm = require('./addEditBookmarkFolderForm') -const { - CommonFormHanger, - CommonFormSection -} = require('../common/commonForm') +const {CommonFormBookmarkHanger} = require('../common/commonForm') // State const bookmarkFoldersState = require('../../../common/state/bookmarkFoldersState') @@ -25,6 +23,9 @@ const windowActions = require('../../../../js/actions/windowActions') const cx = require('../../../../js/lib/classSet') const bookmarkFoldersUtil = require('../../../common/lib/bookmarkFoldersUtil') +// Styles +const globalStyles = require('../styles/global') + class AddEditBookmarkFolder extends React.Component { constructor (props) { super(props) @@ -67,8 +68,11 @@ class AddEditBookmarkFolder extends React.Component { return - - + +
- +
} } +const styles = StyleSheet.create({ + // Copied from commonForm.js + commonFormSection: { + // PR #7985 + margin: `${globalStyles.spacing.dialogInsideMargin} 30px` + }, + commonFormTitle: { + color: globalStyles.color.braveOrange, + fontSize: '1.2em' + } +}) + module.exports = ReduxComponent.connect(AddEditBookmarkFolder) diff --git a/app/renderer/components/bookmarks/addEditBookmarkFolderForm.js b/app/renderer/components/bookmarks/addEditBookmarkFolderForm.js index 7b1d55a8d50..ab500a44b35 100644 --- a/app/renderer/components/bookmarks/addEditBookmarkFolderForm.js +++ b/app/renderer/components/bookmarks/addEditBookmarkFolderForm.js @@ -11,6 +11,7 @@ const BrowserButton = require('../common/browserButton') const { CommonFormSection, CommonFormDropdown, + CommonFormButtonWrapper, commonFormStyles } = require('../common/commonForm') @@ -192,7 +193,7 @@ class AddEditBookmarkFolderForm extends React.Component { - + { this.props.editKey != null ? - + } } diff --git a/app/renderer/components/bookmarks/addEditBookmarkForm.js b/app/renderer/components/bookmarks/addEditBookmarkForm.js index ba4da7e1b97..c3115f2e6bb 100644 --- a/app/renderer/components/bookmarks/addEditBookmarkForm.js +++ b/app/renderer/components/bookmarks/addEditBookmarkForm.js @@ -12,6 +12,7 @@ const { CommonFormSection, CommonFormDropdown, CommonFormTextbox, + CommonFormButtonWrapper, commonFormStyles } = require('../common/commonForm') @@ -228,7 +229,7 @@ class AddEditBookmarkForm extends React.Component { - + { this.props.editKey != null ? - + } } diff --git a/app/renderer/components/bookmarks/addEditBookmarkHanger.js b/app/renderer/components/bookmarks/addEditBookmarkHanger.js index 645b40ee3c0..3a225f88993 100644 --- a/app/renderer/components/bookmarks/addEditBookmarkHanger.js +++ b/app/renderer/components/bookmarks/addEditBookmarkHanger.js @@ -11,8 +11,8 @@ const ReduxComponent = require('../reduxComponent') const Dialog = require('../common/dialog') const AddEditBookmarkForm = require('./addEditBookmarkForm') const { - CommonFormHanger, - CommonFormSection + CommonFormBookmarkHanger, + CommonFormBottomWrapper } = require('../common/commonForm') // States @@ -108,8 +108,8 @@ class AddEditBookmarkHanger extends React.Component { bookmarkDialog: this.props.isModal, bookmarkHanger: !this.props.isModal, [css(styles.bookmarkHanger)]: !this.props.isModal - })} isClickDismiss> - + })} onHide={this.onClose} isClickDismiss> + { !this.props.isModal ?
: null } - +
{ !this.props.isModal - ? + ?
- + : null } - + } } const styles = StyleSheet.create({ + // Copied from commonForm.js + commonFormSection: { + // PR #7985 + margin: `${globalStyles.spacing.dialogInsideMargin} 30px` + }, + commonFormTitle: { + color: globalStyles.color.braveOrange, + fontSize: '1.2em' + }, + bookmarkHanger: { // See: #9040 justifyContent: 'flex-start !important', diff --git a/app/renderer/components/common/commonForm.js b/app/renderer/components/common/commonForm.js index 8577908248b..3f1bb390383 100644 --- a/app/renderer/components/common/commonForm.js +++ b/app/renderer/components/common/commonForm.js @@ -7,8 +7,8 @@ const ImmutableComponent = require('../immutableComponent') const {StyleSheet, css} = require('aphrodite/no-important') const globalStyles = require('../styles/global') +const commonStyles = require('../styles/commonStyles') -const FlyoutDialog = require('./flyoutDialog') const {FormDropdown} = require('./dropdown') const {FormTextbox} = require('./textbox') @@ -16,30 +16,50 @@ const {FormTextbox} = require('./textbox') class CommonForm extends ImmutableComponent { render () { - return + } +} + +class CommonFormSmall extends ImmutableComponent { + render () { + return
+ } +} + +class CommonFormMedium extends ImmutableComponent { + render () { + return
+ } +} + +class CommonFormLarge extends ImmutableComponent { + render () { + return
- {this.props.children} - + styles.commonFormLarge + )} {...this.props} /> } } -class CommonFormHanger extends ImmutableComponent { +class CommonFormBookmarkHanger extends ImmutableComponent { render () { - return - {this.props.children} - + return
} } @@ -55,39 +75,60 @@ class CommonFormTextbox extends ImmutableComponent { } } +class CommonFormClickable extends ImmutableComponent { + render () { + return
+ } +} + class CommonFormSection extends ImmutableComponent { + render () { + return
+ } +} + +class CommonFormTitle extends ImmutableComponent { render () { return
- {this.props.children} -
+ styles.commonFormSection, + styles.commonFormTitle + )} {...this.props} /> } } -class CommonFormClickable extends ImmutableComponent { +class CommonFormSubSection extends ImmutableComponent { render () { return
- {this.props.children} -
+ styles.commonFormSection, + styles.commonFormSubSection + )} {...this.props} /> + } +} + +class CommonFormButtonWrapper extends ImmutableComponent { + render () { + return
+ } +} + +class CommonFormBottomWrapper extends ImmutableComponent { + render () { + return
} } const styles = StyleSheet.create({ + flexJustifyEnd: { + display: 'flex', + justifyContent: 'flex-end' + }, + commonForm: { background: globalStyles.color.modalVeryLightGray, color: globalStyles.color.commonTextColor, @@ -98,10 +139,8 @@ const styles = StyleSheet.create({ maxWidth: globalStyles.spacing.dialogWidth, minWidth: '310px', height: 'auto', - userSelect: 'none', - - // #8634: commonStyles.flyoutDialog, - maxHeight: '100vh' + maxHeight: '100vh', // #8634: commonStyles.flyoutDialog, + userSelect: 'none' // Need a general solution // See: #7930 @@ -109,62 +148,53 @@ const styles = StyleSheet.create({ // maxHeight: '100%' }, - commonForm_small: { + commonFormSmall: { maxWidth: globalStyles.spacing.dialogSmallWidth }, - commonForm_medium: { + commonFormMedium: { maxWidth: globalStyles.spacing.dialogMediumWidth }, - commonForm_large: { + commonFormLarge: { maxWidth: globalStyles.spacing.dialogLargeWidth }, - commonForm_hanger: { + commonFormBookmarkHanger: { + maxWidth: globalStyles.spacing.bookmarkHangerMaxWidth, + height: 'initial', // #8634 + // Cancel the inherited value from .navbarMenubarFlexContainer, which is 'nowrap'. - whiteSpace: 'normal', + whiteSpace: 'normal' + }, - // #8634 - height: 'initial' + commonFormClickable: { + color: '#5b5b5b', + + ':hover': { + color: '#000' + } }, - commonForm_hanger_bookmark: { - maxWidth: globalStyles.spacing.bookmarkHangerMaxWidth + commonFormTitle: { + color: globalStyles.color.braveOrange, + fontSize: '1.2em' }, - commonForm__section: { + commonFormSection: { // PR #7985 margin: `${globalStyles.spacing.dialogInsideMargin} 30px` }, - commonForm__section_sub: { + commonFormSubSection: { margin: `0 0 ${globalStyles.spacing.dialogInsideMargin} ${globalStyles.spacing.dialogInsideMargin}` }, - commonForm__section_title: { - color: globalStyles.color.braveOrange, - fontSize: '1.2em' - }, - - commonForm__section_buttons: { - display: 'flex', - justifyContent: 'flex-end' - }, - - commonForm__section_bottom: { + commonFormBottomWrapper: { margin: 0, padding: `${globalStyles.spacing.dialogInsideMargin} 30px`, background: globalStyles.color.commonFormBottomWrapperBackground, borderRadius: `0 0 ${globalStyles.radius.borderRadius} ${globalStyles.radius.borderRadius}` - }, - - commonForm__clickable: { - color: '#5b5b5b', - - ':hover': { - color: '#000' - } } }) @@ -199,10 +229,17 @@ const commonFormStyles = StyleSheet.create({ module.exports = { CommonForm, - CommonFormHanger, + CommonFormSmall, + CommonFormMedium, + CommonFormLarge, + CommonFormBookmarkHanger, CommonFormDropdown, CommonFormTextbox, - CommonFormSection, CommonFormClickable, + CommonFormSection, + CommonFormTitle, + CommonFormSubSection, + CommonFormButtonWrapper, + CommonFormBottomWrapper, commonFormStyles } diff --git a/app/renderer/components/common/flyoutDialog.js b/app/renderer/components/common/flyoutDialog.js deleted file mode 100644 index a95b4f68053..00000000000 --- a/app/renderer/components/common/flyoutDialog.js +++ /dev/null @@ -1,45 +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/. */ - -const React = require('react') -const ImmutableComponent = require('../immutableComponent') - -const {StyleSheet, css} = require('aphrodite/no-important') -const globalStyles = require('../styles/global') - -class FlyoutDialog extends ImmutableComponent { - render () { - return
- {this.props.children} -
- } -} - -const styles = StyleSheet.create({ - flyoutDialog: { - background: globalStyles.color.toolbarBackground, - borderRadius: globalStyles.radius.borderRadius, - boxShadow: globalStyles.shadow.flyoutDialogBoxShadow, - color: '#000', - fontSize: '13px', - - // Issue #7949 - padding: `${globalStyles.spacing.dialogInsideMargin} 30px`, - position: 'absolute', - top: globalStyles.spacing.dialogTopOffset, - - // Issue #7930 - boxSizing: 'border-box', - maxWidth: '600px', - maxHeight: `calc(80vh - ${globalStyles.spacing.downloadsBarHeight})` - } -}) - -module.exports = FlyoutDialog diff --git a/app/renderer/components/common/messageBox.js b/app/renderer/components/common/messageBox.js index 7f234cb1bce..ea70445c699 100644 --- a/app/renderer/components/common/messageBox.js +++ b/app/renderer/components/common/messageBox.js @@ -9,7 +9,6 @@ const {StyleSheet, css} = require('aphrodite/no-important') // Components const ReduxComponent = require('../reduxComponent') const Dialog = require('./dialog') -const FlyoutDialog = require('./flyoutDialog') const BrowserButton = require('../common/browserButton') const SwitchControl = require('./switchControl') const {PromptTextBox} = require('./textbox') @@ -142,8 +141,8 @@ class MessageBox extends React.Component { render () { return -
@@ -186,7 +185,7 @@ class MessageBox extends React.Component { {this.messageBoxButtons}
- +
} } diff --git a/app/renderer/components/main/braveryPanel.js b/app/renderer/components/main/braveryPanel.js index 735868526c7..e8630c47eba 100644 --- a/app/renderer/components/main/braveryPanel.js +++ b/app/renderer/components/main/braveryPanel.js @@ -9,7 +9,6 @@ const {StyleSheet, css} = require('aphrodite/no-important') // Components const ReduxComponent = require('../reduxComponent') const Dialog = require('../common/dialog') -const FlyoutDialog = require('../common/flyoutDialog') const BrowserButton = require('../common/browserButton') const SwitchControl = require('../common/switchControl') const {FormDropdown} = require('../common/dropdown') @@ -38,6 +37,7 @@ const urlUtil = require('../../../../js/lib/urlutil') // Styles const globalStyles = require('../styles/global') +const commonStyles = require('../styles/commonStyles') const closeButton = require('../../../../img/toolbar/braveryPanel_btn.svg') class BraveryPanel extends React.Component { @@ -249,13 +249,13 @@ class BraveryPanel extends React.Component { }) return - e.stopPropagation()} - testId={this.props.isCompactBraveryPanel ? 'braveryPanelCompact' : 'braveryPanel'} - > + data-test-id={this.props.isCompactBraveryPanel ? 'braveryPanelCompact' : 'braveryPanel'}> { this.props.isCompactBraveryPanel ? this.compactBraveryPanelHeader @@ -649,7 +649,7 @@ class BraveryPanel extends React.Component {
- +
} } diff --git a/app/renderer/components/main/checkDefaultBrowserDialog.js b/app/renderer/components/main/checkDefaultBrowserDialog.js index 11e7107b61e..f03d90a69d8 100644 --- a/app/renderer/components/main/checkDefaultBrowserDialog.js +++ b/app/renderer/components/main/checkDefaultBrowserDialog.js @@ -11,8 +11,9 @@ const Dialog = require('../common/dialog') const BrowserButton = require('../common/browserButton') const SwitchControl = require('../common/switchControl') const { - CommonForm, - CommonFormSection + CommonFormMedium, + CommonFormSection, + CommonFormButtonWrapper } = require('../common/commonForm') // Actions @@ -77,7 +78,7 @@ class CheckDefaultBrowserDialog extends React.Component { render () { return - +
@@ -92,7 +93,7 @@ class CheckDefaultBrowserDialog extends React.Component {
- + - -
+ +
} } +module.exports = ReduxComponent.connect(CheckDefaultBrowserDialog) + const styles = StyleSheet.create({ flexAlignCenter: { display: 'flex', @@ -131,5 +134,3 @@ const styles = StyleSheet.create({ marginTop: `calc(${globalStyles.spacing.dialogInsideMargin} / 2)` } }) - -module.exports = ReduxComponent.connect(CheckDefaultBrowserDialog) diff --git a/app/renderer/components/main/clearBrowsingDataPanel.js b/app/renderer/components/main/clearBrowsingDataPanel.js index c17f2e3795e..045a5a2195c 100644 --- a/app/renderer/components/main/clearBrowsingDataPanel.js +++ b/app/renderer/components/main/clearBrowsingDataPanel.js @@ -11,8 +11,11 @@ const Dialog = require('../common/dialog') const Button = require('../common/button') const SwitchControl = require('../common/switchControl') const { - CommonForm, - CommonFormSection + CommonFormSmall, + CommonFormSection, + CommonFormTitle, + CommonFormButtonWrapper, + CommonFormBottomWrapper } = require('../common/commonForm') // Actions @@ -81,8 +84,8 @@ class ClearBrowsingDataPanel extends React.Component { render () { return - e.stopPropagation()}> - + e.stopPropagation()}> + - + } } diff --git a/app/renderer/components/main/importBrowserDataPanel.js b/app/renderer/components/main/importBrowserDataPanel.js index d81ffec9f46..4d3da2aa094 100644 --- a/app/renderer/components/main/importBrowserDataPanel.js +++ b/app/renderer/components/main/importBrowserDataPanel.js @@ -14,7 +14,10 @@ const SwitchControl = require('../common/switchControl') const { CommonForm, CommonFormDropdown, - CommonFormSection + CommonFormSection, + CommonFormTitle, + CommonFormButtonWrapper, + CommonFormBottomWrapper } = require('../common/commonForm') // Actions @@ -98,12 +101,12 @@ class ImportBrowserDataPanel extends React.Component { render () { return - e.stopPropagation()}> - e.stopPropagation()}> + - +
- +
} } +module.exports = ReduxComponent.connect(ImportBrowserDataPanel) + const styles = StyleSheet.create({ dropdownWrapper: { marginBottom: `calc(${globalStyles.spacing.dialogInsideMargin} / 2)` } }) - -module.exports = ReduxComponent.connect(ImportBrowserDataPanel) diff --git a/app/renderer/components/main/loginRequired.js b/app/renderer/components/main/loginRequired.js index 213e5022cbc..67271b7419d 100644 --- a/app/renderer/components/main/loginRequired.js +++ b/app/renderer/components/main/loginRequired.js @@ -11,7 +11,9 @@ const Button = require('../common/button') const { CommonForm, CommonFormSection, + CommonFormTitle, CommonFormTextbox, + CommonFormButtonWrapper, commonFormStyles } = require('../common/commonForm') @@ -93,10 +95,8 @@ class LoginRequired extends React.Component { } return - - - - + +
{
+ commonFormStyles.inputWrapper, + commonFormStyles.inputWrapper__input + )}> - +
} } +module.exports = LoginRequired + const styles = StyleSheet.create({ sectionWrapper: { display: 'flex', justifyContent: 'space-between' } }) - -module.exports = LoginRequired diff --git a/app/renderer/components/main/releaseNotes.js b/app/renderer/components/main/releaseNotes.js index 5501197857b..a5b3cab74f9 100644 --- a/app/renderer/components/main/releaseNotes.js +++ b/app/renderer/components/main/releaseNotes.js @@ -9,11 +9,13 @@ const Immutable = require('immutable') // Components const ReduxComponent = require('../reduxComponent') const Dialog = require('../common/dialog') -const FlyoutDialog = require('../common/flyoutDialog') // Actions const windowActions = require('../../../../js/actions/windowActions') +// Styles +const commonStyles = require('../styles/commonStyles') + class ReleaseNotes extends React.Component { constructor (props) { super(props) @@ -39,15 +41,22 @@ class ReleaseNotes extends React.Component { } render () { + const className = css( + commonStyles.flyoutDialog, + styles.releaseNotes + ) + return - +

{this.props.name}

{this.props.notes}
- +
} } +module.exports = ReduxComponent.connect(ReleaseNotes) + const styles = StyleSheet.create({ releaseNotes: { width: 'auto', @@ -60,5 +69,3 @@ const styles = StyleSheet.create({ marginBottom: '10px' } }) - -module.exports = ReduxComponent.connect(ReleaseNotes) diff --git a/app/renderer/components/main/siteInfo.js b/app/renderer/components/main/siteInfo.js index 425f1458394..5fe9ac28acb 100644 --- a/app/renderer/components/main/siteInfo.js +++ b/app/renderer/components/main/siteInfo.js @@ -9,7 +9,6 @@ const {StyleSheet, css} = require('aphrodite/no-important') // Components const ReduxComponent = require('../reduxComponent') const Dialog = require('../common/dialog') -const FlyoutDialog = require('../common/flyoutDialog') const Button = require('../common/button') // Actions @@ -29,6 +28,7 @@ const urlUtil = require('../../../../js/lib/urlutil') // Styles const globalStyles = require('../styles/global') +const commonStyles = require('../styles/commonStyles') class SiteInfo extends React.Component { constructor (props) { @@ -242,11 +242,12 @@ class SiteInfo extends React.Component { render () { return - e.stopPropagation()} - custom={[ +
e.stopPropagation()} + className={css( + commonStyles.flyoutDialog, styles.siteInfo, (this.props.isBlockedRunInsecureContent || this.props.runInsecureContent) && styles.siteInfo_large - ]}> + )}> { this.secureIcon } @@ -256,7 +257,7 @@ class SiteInfo extends React.Component { { this.connectionInfo } - +
} } diff --git a/app/renderer/components/main/widevinePanel.js b/app/renderer/components/main/widevinePanel.js index 9ad533ab522..f398237f894 100644 --- a/app/renderer/components/main/widevinePanel.js +++ b/app/renderer/components/main/widevinePanel.js @@ -13,8 +13,11 @@ const Button = require('../common/button') const WidevineInfo = require('./widevineInfo') const SwitchControl = require('../common/switchControl') const { - CommonForm, - CommonFormSection + CommonFormLarge, + CommonFormTitle, + CommonFormSection, + CommonFormButtonWrapper, + CommonFormBottomWrapper } = require('../common/commonForm') // Constants @@ -76,12 +79,12 @@ class WidevinePanel extends React.Component { to be installed on the computer. */ return - e.stopPropagation()}> - + e.stopPropagation()}> + - + } } +module.exports = ReduxComponent.connect(WidevinePanel) + const styles = StyleSheet.create({ flexJustifyCenter: { display: 'flex', justifyContent: 'center' } }) - -module.exports = ReduxComponent.connect(WidevinePanel) diff --git a/app/renderer/components/styles/commonStyles.js b/app/renderer/components/styles/commonStyles.js index 18d0e4fe1ac..466a9495efb 100644 --- a/app/renderer/components/styles/commonStyles.js +++ b/app/renderer/components/styles/commonStyles.js @@ -47,6 +47,23 @@ const styles = StyleSheet.create({ fontSize: globalStyles.spacing.textAreaFontSize }, + // Dialogs + flyoutDialog: { + background: globalStyles.color.toolbarBackground, + borderRadius: globalStyles.radius.borderRadius, + boxShadow: globalStyles.shadow.flyoutDialogBoxShadow, + color: '#000', + fontSize: '13px', + // Issue #7949 + padding: `${globalStyles.spacing.dialogInsideMargin} 30px`, + position: 'absolute', + top: globalStyles.spacing.dialogTopOffset, + // Issue #7930 + boxSizing: 'border-box', + maxWidth: '600px', + maxHeight: `calc(80vh - ${globalStyles.spacing.downloadsBarHeight})` + }, + // itemList.less listItem: { cursor: 'default', diff --git a/js/about/styles.js b/js/about/styles.js index f05a9e146c4..809c0678de1 100644 --- a/js/about/styles.js +++ b/js/about/styles.js @@ -36,9 +36,13 @@ const { const { CommonForm, + CommonFormTitle, CommonFormSection, CommonFormDropdown, - CommonFormClickable + CommonFormClickable, + CommonFormSubSection, + CommonFormButtonWrapper, + CommonFormBottomWrapper } = require('../../app/renderer/components/common/commonForm') class Container extends ImmutableComponent { @@ -404,7 +408,7 @@ class AboutStyle extends ImmutableComponent { bottom: '40px' }}> - Title + CommonFormTitle CommonFormSection - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. @@ -415,37 +419,41 @@ class AboutStyle extends ImmutableComponent { - Sub Section - + CommonFormSubSection + - + CommonFormSection - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - + - - + + CommonFormClickable - +

             const {{'\n'}
             CommonForm,{'\n'}
+            CommonFormTitle,{'\n'}
             CommonFormSection,{'\n'}
             CommonFormDropdown,{'\n'}
-            CommonFormClickable{'\n'}
+            CommonFormClickable,{'\n'}
+            CommonFormSubSection,{'\n'}
+            CommonFormButtonWrapper,{'\n'}
+            CommonFormBottomWrapper{'\n'}
             } = require('../../app/renderer/components/common/commonForm'){'\n'}
             {'\n'}
             <CommonForm>{'\n'}
-            <CommonFormSection title>Title</CommonFormSection>{'\n'}
+            <CommonFormTitle>CommonFormTitle</CommonFormTitle>{'\n'}
             <CommonFormSection>{'\n'}
             CommonFormSection - Lorem ipsum dolor sit amet, consectetur adipisicing elit,{'\n'}
             sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{'\n'}
@@ -456,24 +464,24 @@ class AboutStyle extends ImmutableComponent {
             </CommonFormDropdown>{'\n'}
             </CommonFormSection>{'\n'}
             <CommonFormSection>{'\n'}
-            <CommonFormSection subSection>Sub Section</CommonFormSection>{'\n'}
-            <CommonFormSection subSection>{'\n'}
+            <CommonFormSubSection>CommonFormSubSection</CommonFormSubSection>{'\n'}
+            <CommonFormSubSection>{'\n'}
             <CommonFormDropdown>{'\n'}
             <option value='CommonFormDropdown'>CommonFormDropdown</option>{'\n'}
             </CommonFormDropdown>{'\n'}
-            </CommonFormSection>{'\n'}
+            </CommonFormSubSection>{'\n'}
             </CommonFormSection>{'\n'}
             <CommonFormSection>{'\n'}
             CommonFormSection - Lorem ipsum dolor sit amet, consectetur adipisicing elit,{'\n'}
             sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{'\n'}
             </CommonFormSection>{'\n'}
-            <CommonFormSection buttons>{'\n'}
+            <CommonFormButtonWrapper>{'\n'}
             <BrowserButton groupedItem secondaryColor l10nId='Cancel' />{'\n'}
             <BrowserButton groupedItem primaryColor l10nId='Done' />{'\n'}
-            </CommonFormSection>{'\n'}
-            <CommonFormSection bottom>{'\n'}
+            </CommonFormButtonWrapper>{'\n'}
+            <CommonFormBottomWrapper>{'\n'}
             <CommonFormClickable>CommonFormClickable</CommonFormClickable>{'\n'}
-            </CommonFormSection>{'\n'}
+            </CommonFormBottomWrapper>{'\n'}
             </CommonForm>{'\n'}
           
@@ -496,18 +504,18 @@ class AboutStyle extends ImmutableComponent { bottom: '40px' }}> - Title + CommonFormTitle

             const {{'\n'}
             CommonForm,{'\n'}
-            CommonFormSection{'\n'}
+            CommonFormTitle{'\n'}
             } = require('../../app/renderer/components/common/commonForm'){'\n'}
             {'\n'}
             <CommonForm>{'\n'}
-            <CommonFormSection title>Title</CommonFormSection>{'\n'}
+            <CommonFormTitle>CommonFormTitle</CommonFormTitle>{'\n'}
             </CommonForm>{'\n'}
           
@@ -584,12 +592,12 @@ class AboutStyle extends ImmutableComponent { }}> - Sub Section - + CommonFormSubSection + - +
@@ -598,17 +606,18 @@ class AboutStyle extends ImmutableComponent { const {{'\n'} CommonForm,{'\n'} CommonFormSection,{'\n'} + CommonFormSubSection,{'\n'} CommonFormDropdown{'\n'} } = require('../../app/renderer/components/common/commonForm'){'\n'} {'\n'} <CommonForm>{'\n'} <CommonFormSection>{'\n'} - <CommonFormSection subSection>Sub Section</CommonFormSection>{'\n'} - <CommonFormSection subSection>{'\n'} + <CommonFormSubSection>CommonFormSubSection</CommonFormSubSection>{'\n'} + <CommonFormSubSection>{'\n'} <CommonFormDropdown>{'\n'} <option value='CommonFormDropdown'>CommonFormDropdown</option>{'\n'} </CommonFormDropdown>{'\n'} - </CommonFormSection>{'\n'} + </CommonFormSubSection>{'\n'} </CommonFormSection>{'\n'} </CommonForm>{'\n'} @@ -622,24 +631,24 @@ class AboutStyle extends ImmutableComponent { bottom: '40px' }}> - + - +

             const {{'\n'}
             CommonForm,{'\n'}
-            CommonFormSection{'\n'}
+            CommonFormButtonWrapper{'\n'}
             } = require('../../app/renderer/components/common/commonForm'){'\n'}
             {'\n'}
             <CommonForm>{'\n'}
-            <CommonFormSection buttons>{'\n'}
+            <CommonFormButtonWrapper>{'\n'}
             <BrowserButton groupedItem secondaryColor l10nId='Cancel' />{'\n'}
             <BrowserButton groupedItem primaryColor l10nId='Done' />{'\n'}
-            </CommonFormSection>{'\n'}
+            </CommonFormButtonWrapper>{'\n'}
             </CommonForm>{'\n'}
           
@@ -652,23 +661,23 @@ class AboutStyle extends ImmutableComponent { bottom: '40px' }}> - + CommonFormClickable - +

             const {{'\n'}
             CommonForm,{'\n'}
-            CommonFormSection,{'\n'}
+            CommonFormBottomWrapper,{'\n'}
             CommonFormClickable{'\n'}
             } = require('../../app/renderer/components/common/commonForm'){'\n'}
             {'\n'}
             <CommonForm>{'\n'}
-            <CommonFormSection bottom>{'\n'}
+            <CommonFormBottomWrapper>{'\n'}
             <CommonFormClickable>CommonFormClickable</CommonFormClickable>{'\n'}
-            </CommonFormSection>{'\n'}
+            </CommonFormBottomWrapper>{'\n'}
             </CommonForm>{'\n'}