From fa8316a94c092e986b4b2616f1992ee2a3eec01a Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Fri, 12 Jul 2019 19:59:42 +0530 Subject: Initial Commit :tada: * Adds Manifest for Extension * Adds barebone messaging from extension and front-end * Adds .env to run react app under CSP --- src/App.js | 77 +++++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 21 deletions(-) (limited to 'src/App.js') diff --git a/src/App.js b/src/App.js index ce9cbd2..adbdf16 100644 --- a/src/App.js +++ b/src/App.js @@ -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 ( -
-
- logo -

- Edit src/App.js and save to reload. -

- - Learn React - -
-
- ); + /* 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 ( +
+
+
+

DataTable - Sort

+

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.

+
+
+ +
+

Single Column

+ {/* + + + + + + +

Multiple Columns

+ + + + + + */} +
+
+ ); + } } export default App; -- cgit v1.2.3