diff options
author | Determinant <[email protected]> | 2019-02-07 01:32:45 -0500 |
---|---|---|
committer | Determinant <[email protected]> | 2019-02-07 01:32:45 -0500 |
commit | 735d8e5aa8b590b37a16c0e1b52a688c43dd5c10 (patch) | |
tree | 3fa81f703a18a6c3780d22c7a27867392412dafe /src | |
parent | 608f68cba0fa98f2db31b95a1bbc4cabb98586ea (diff) |
add popup
Diffstat (limited to 'src')
-rw-r--r-- | src/App.test.js | 9 | ||||
-rw-r--r-- | src/Dashboard.js (renamed from src/App.js) | 0 | ||||
-rw-r--r-- | src/index.html | 17 | ||||
-rw-r--r-- | src/index.js | 4 | ||||
-rw-r--r-- | src/popup.js | 29 |
5 files changed, 48 insertions, 11 deletions
diff --git a/src/App.test.js b/src/App.test.js deleted file mode 100644 index a754b20..0000000 --- a/src/App.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; - -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(<App />, div); - ReactDOM.unmountComponentAtNode(div); -}); diff --git a/src/App.js b/src/Dashboard.js index bd17cec..bd17cec 100644 --- a/src/App.js +++ b/src/Dashboard.js diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..a51779c --- /dev/null +++ b/src/index.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <meta + name="viewport" + content="width=device-width, initial-scale=1, shrink-to-fit=no" + /> + <meta name="theme-color" content="#000000" /> + <link rel="stylesheet" href="/fonts/TypoPRO-FantasqueSansMono-Regular.css" /> + <title>Chromicle</title> + </head> + <body> + <noscript>You need to enable JavaScript to run this app.</noscript> + <div id="root"></div> + </body> +</html> diff --git a/src/index.js b/src/index.js index 955691f..adcb634 100644 --- a/src/index.js +++ b/src/index.js @@ -1,9 +1,9 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import App from './App'; +import Dashboard from './Dashboard'; import * as serviceWorker from './serviceWorker'; -ReactDOM.render(<App />, document.getElementById('root')); +ReactDOM.render(<Dashboard />, document.getElementById('root')); // If you want your app to work offline and load faster, you can change // unregister() to register() below. Note this comes with some pitfalls. diff --git a/src/popup.js b/src/popup.js new file mode 100644 index 0000000..c4daf81 --- /dev/null +++ b/src/popup.js @@ -0,0 +1,29 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; +import * as serviceWorker from './serviceWorker'; +import { MuiThemeProvider } from '@material-ui/core/styles'; +import Button from '@material-ui/core/Button'; +import theme from './theme'; + +function openOptions() { + chrome.tabs.create({ url: "index.html" }); +} + +class Popup extends React.Component { + render() { + return ( + <MuiThemeProvider theme={theme}> + <span>No data available. + <Button variant="contained" color="primary" onClick={openOptions}>Go to Dashboard</Button> + </span> + </MuiThemeProvider> + ); + } +} + +ReactDOM.render(<Popup />, document.getElementById('root')); + +// If you want your app to work offline and load faster, you can change +// unregister() to register() below. Note this comes with some pitfalls. +// Learn more about service workers: http://bit.ly/CRA-PWA +serviceWorker.unregister(); |