filter with date ; working backend and frontend
This commit is contained in:
46
web/src/components/DomainList.js
Normal file
46
web/src/components/DomainList.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import React, { Component } from 'react';
|
||||
import {getDomains} from '../helpers/api';
|
||||
import Domain from './Domain';
|
||||
|
||||
import ReactTable from "react-table";
|
||||
import "react-table/react-table.css";
|
||||
|
||||
class DomainList extends Component {
|
||||
|
||||
constructor(props){
|
||||
super(props);
|
||||
|
||||
getDomains().then(l => l.text()).then(l => {
|
||||
let parsedList = JSON.parse(l);
|
||||
this.setState({domains:parsedList});
|
||||
});
|
||||
|
||||
this.state = {domains:[]};
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<ReactTable
|
||||
data = {this.state.domains}
|
||||
columns={[
|
||||
{
|
||||
Header: 'Domain name',
|
||||
accessor: 'domainName',
|
||||
},
|
||||
{
|
||||
Header: 'TLD domain',
|
||||
accessor: 'tld',
|
||||
},
|
||||
{
|
||||
Header: 'Expiration date',
|
||||
accessor: 'expirationDate',
|
||||
}
|
||||
]}
|
||||
defaultPageSize={10}
|
||||
className="-striped -highlight"
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default DomainList;
|
||||
Reference in New Issue
Block a user