diff options
author | Indrajith K L | 2019-07-12 19:59:42 +0530 |
---|---|---|
committer | Indrajith K L | 2019-07-12 19:59:42 +0530 |
commit | fa8316a94c092e986b4b2616f1992ee2a3eec01a (patch) | |
tree | 94a425f0ec03570f815274ba1039ce2951578e77 /src | |
parent | 481bbb5a2271c521265dd20280324435854dbb12 (diff) | |
download | bookmark-manager-fa8316a94c092e986b4b2616f1992ee2a3eec01a.tar.gz bookmark-manager-fa8316a94c092e986b4b2616f1992ee2a3eec01a.tar.bz2 bookmark-manager-fa8316a94c092e986b4b2616f1992ee2a3eec01a.zip |
Initial Commit
:tada:
* Adds Manifest for Extension
* Adds barebone messaging from extension and front-end
* Adds .env to run react app under CSP
Diffstat (limited to 'src')
-rw-r--r-- | src/App.css | 33 | ||||
-rw-r--r-- | src/App.js | 77 | ||||
-rw-r--r-- | src/index.js | 3 |
3 files changed, 59 insertions, 54 deletions
diff --git a/src/App.css b/src/App.css index b41d297..e69de29 100644 --- a/src/App.css +++ b/src/App.css @@ -1,33 +0,0 @@ -.App { - text-align: center; -} - -.App-logo { - animation: App-logo-spin infinite 20s linear; - height: 40vmin; - pointer-events: none; -} - -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; -} - -.App-link { - color: #61dafb; -} - -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} @@ -1,26 +1,61 @@ +/*global chrome*/ import React from 'react'; -import logo from './logo.svg'; -import './App.css'; +import { DataTable } from 'primereact/datatable'; +import { Column } from 'primereact/column'; +class App extends React.Component { -function App() { - return ( - <div className="App"> - <header className="App-header"> - <img src={logo} className="App-logo" alt="logo" /> - <p> - Edit <code>src/App.js</code> and save to reload. - </p> - <a - className="App-link" - href="https://reactjs.org" - target="_blank" - rel="noopener noreferrer" - > - Learn React - </a> - </header> - </div> - ); + /* Open port on popup file */ + port = chrome.runtime.connect({ + name: "bookmarkArranger" + }); + + getBookMarks = () => { + this.port.postMessage({ + code: "getBookMarks" + }); + } + + listenMessages = () => { + this.port.onMessage.addListener(message => { + console.log(message) + }); + } + + componentDidMount(){ + this.listenMessages(); + } + + render(){ + return ( + <div> + <div className="content-section introduction"> + <div className="feature-intro"> + <h1>DataTable - Sort</h1> + <p>Enabling sortable property on a column is enough to make a column sortable. Multiple column sorting is enabled using sortMode property and + used with metaKey.</p> + </div> + </div> + + <div className="content-section implementation"> + <h3>Single Column</h3> + {/* <DataTable value={this.state.cars}> + <Column field="vin" header="Vin" sortable={true} /> + <Column field="year" header="Year" sortable={true} /> + <Column field="brand" header="Brand" sortable={true} /> + <Column field="color" header="Color" sortable={true} /> + </DataTable> + + <h3>Multiple Columns</h3> + <DataTable value={this.state.cars} sortMode="multiple"> + <Column field="vin" header="Vin" sortable={true} /> + <Column field="year" header="Year" sortable={true} /> + <Column field="brand" header="Brand" sortable={true} /> + <Column field="color" header="Color" sortable={true} /> + </DataTable> */} + </div> + </div> + ); + } } export default App; diff --git a/src/index.js b/src/index.js index 87d1be5..eb72966 100644 --- a/src/index.js +++ b/src/index.js @@ -3,6 +3,9 @@ import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import * as serviceWorker from './serviceWorker'; +import 'primereact/resources/themes/nova-light/theme.css'; +import 'primereact/resources/primereact.min.css'; +import 'primeicons/primeicons.css'; ReactDOM.render(<App />, document.getElementById('root')); |