aboutsummaryrefslogtreecommitdiff
path: root/src/App.js
blob: adbdf16b220b6f6bec8ff682c376ff72a93585c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*global chrome*/
import React from 'react';
import { DataTable } from 'primereact/datatable';
import { Column } from 'primereact/column';
class App extends React.Component {

  /* 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;