-
Notifications
You must be signed in to change notification settings - Fork 973
Add support for welcome page #8097
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
<!DOCTYPE html> | ||
<!-- 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/. --> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="availableLanguages" content=""> | ||
<meta name="defaultLanguage" content="en-US"> | ||
<link rel="shortcut icon" type="image/x-icon" href="data:image/x-icon;,"> | ||
<title data-l10n-id="aboutWelcome"></title> | ||
<script src="ext/l20n.min.js"></script> | ||
<script src="gen/aboutPages.entry.js" async></script> | ||
<link rel="localization" href="locales/{locale}/app.properties"> | ||
<link rel="stylesheet" href="content/styles/defaultStyles.css"> | ||
</head> | ||
<body> | ||
<div id="appContainer" class="welcomePage" /> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* 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/. */ | ||
|
||
/** | ||
* Use this file as a normalizer | ||
* to edit webview for about:pages. | ||
*/ | ||
|
||
html, body { | ||
font-family: "Helvetica Neue", Arial, sans-serif; | ||
font-weight: 400; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
html, body, #appContainer, #appContainer > div { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
font-size: 100%; | ||
} | ||
|
||
.welcomePage { | ||
overflow: hidden; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here's our hero for double scrollbars |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* 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 {StyleSheet, css} = require('aphrodite/no-important') | ||
|
||
class AboutWelcome extends React.Component { | ||
render () { | ||
return <iframe data-test-id='welcomeIframe' | ||
className={css(styles.welcomeIframe)} src='https://brave.com/welcome.html' /> | ||
} | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
welcomeIframe: { | ||
width: '100%', | ||
height: '100%', | ||
border: 0 | ||
} | ||
}) | ||
|
||
module.exports = <AboutWelcome /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed to Enzyme instead of Webdriver |
||
* 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/. */ | ||
/* global describe, before, after, it */ | ||
|
||
const mockery = require('mockery') | ||
const {shallow} = require('enzyme') | ||
const assert = require('assert') | ||
let AboutWelcome | ||
require('../braveUnit') | ||
|
||
describe('AboutWelcome component', function () { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this intentional? The test plan says There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just updated it 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks し( ・∀・)/\(・∀・) /// |
||
before(function () { | ||
mockery.enable({ | ||
warnOnReplace: false, | ||
warnOnUnregistered: false, | ||
useCleanCache: true | ||
}) | ||
AboutWelcome = require('../../../app/renderer/about/welcome') | ||
mockery.registerMock('../../../less/about/common.less', {}) | ||
}) | ||
|
||
after(function () { | ||
mockery.disable() | ||
}) | ||
|
||
describe('Rendering', function () { | ||
it('renders an iframe', function () { | ||
const wrapper = shallow( | ||
AboutWelcome | ||
) | ||
assert.equal(wrapper.find('[data-test-id="welcomeIframe"]').length, 1) | ||
}) | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
future refactoring of about pages will benefit from this instead of relying on
common.less
file so I took advantage of this PR to add it since it's needed anyway for welcome page