New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create about:welcome and about:newtab WebUI placeholders #20
+341
−13
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ff6b2f5
Remove new tab page override
bbondy e67b72a
Add new tab web UI placeholder
bbondy b2e17a4
Add welcome page placeholder
bbondy e359b9c
Remove specific handling from BasicUI
bbondy 4e2ae00
Transpile new-tab webui using webpack
bbondy File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
| @@ -0,0 +1,12 @@ | ||
| <!doctype html> | ||
| <html> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <meta name="viewport" content="width=device-width"> | ||
| <title>New Tab</title> | ||
| <link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script src="chrome://bravenewtab/brave_new_tab.js"></script> | ||
| </body> | ||
| </html> |
| @@ -0,0 +1,17 @@ | ||
| import React from 'react' | ||
| import { render } from 'react-dom' | ||
| import { Provider } from 'react-redux' | ||
| import { createStore } from 'redux' | ||
| import reducers from './reducers' | ||
| import App from './components/app' | ||
|
|
||
| let store = createStore(reducers) | ||
|
|
||
| render( | ||
| <Provider store={store}> | ||
| <App /> | ||
| </Provider>, | ||
| document.getElementById('root') | ||
| ) | ||
|
|
||
| console.log('brave_new_tab.js loaded') |
| @@ -0,0 +1,7 @@ | ||
| import React from 'react' | ||
|
|
||
| const App = () => ( | ||
| <div>New Tab!</div> | ||
| ) | ||
|
|
||
| export default App |
| @@ -0,0 +1,8 @@ | ||
| import { combineReducers } from 'redux' | ||
| import newTabReducer from './newTabReducer' | ||
|
|
||
| const combinedReducer = combineReducers({ | ||
| newTabReducer | ||
| }) | ||
|
|
||
| export default combinedReducer |
| @@ -0,0 +1,8 @@ | ||
| const newTabReducer = (state = {}, action) => { | ||
| switch (action.type) { | ||
| default: | ||
| return state | ||
| } | ||
| } | ||
|
|
||
| export default newTabReducer |
| @@ -0,0 +1,51 @@ | ||
| const path = require('path') | ||
| const webpack = require('webpack') | ||
| const postCSSConfig = require('./postcss.config') | ||
|
|
||
| module.exports = { | ||
| entry: { | ||
| brave_new_tab: path.join(__dirname, '../brave_new_tab_ui/brave_new_tab'), | ||
| welcome: path.join(__dirname, '../welcome_ui/welcome'), | ||
| brave_payments: path.join(__dirname, '../brave_payments_ui/brave_payments') | ||
| }, | ||
| output: { | ||
| path: path.join(__dirname, '..', '..', '..', process.env.TARGET_GEN_DIR, 'brave'), | ||
bbondy
Author
Member
|
||
| filename: '[name].bundle.js', | ||
| chunkFilename: '[id].chunk.js' | ||
| }, | ||
| plugins: [ | ||
| new webpack.optimize.OccurrenceOrderPlugin(), | ||
| new webpack.IgnorePlugin(/[^/]+\/[\S]+.dev$/), | ||
| new webpack.DefinePlugin({ | ||
| 'process.env': { | ||
| NODE_ENV: JSON.stringify('development') | ||
| } | ||
| }) | ||
| ], | ||
| resolve: { | ||
| extensions: ['.ts', '.tsx', '.js'] | ||
| }, | ||
| module: { | ||
| rules: [ | ||
| { | ||
| test: /\.tsx?$/, | ||
| loader: 'awesome-typescript-loader' | ||
| }, | ||
| { | ||
| test: /\.js$/, | ||
| loader: 'babel-loader', | ||
| exclude: /node_modules/, | ||
| query: { | ||
| presets: ['react-optimize'] | ||
| } | ||
| }, { | ||
| test: /\.css$/, | ||
| loaders: [ | ||
| 'style-loader', | ||
| 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', | ||
| {loader: 'postcss-loader', options: postCSSConfig} | ||
| ] | ||
| }] | ||
| } | ||
| } | ||
|
|
||
| @@ -0,0 +1,4 @@ | ||
| module.exports = { | ||
| plugins: [ | ||
| ] | ||
| } |
Oops, something went wrong.
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
with just one env var this isn't a big deal, but might want to think about generating from a template so we can inject directly from gn