From e231230f1b2045b705602b2c9d3a14c47f276273 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Tue, 2 Apr 2019 13:59:03 +0300 Subject: [PATCH] - client: fixed leases table on mobile Closes #688 --- client/src/components/Settings/Dhcp/Leases.js | 65 ++++++++++++------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/client/src/components/Settings/Dhcp/Leases.js b/client/src/components/Settings/Dhcp/Leases.js index 3fb1197a..04935c80 100644 --- a/client/src/components/Settings/Dhcp/Leases.js +++ b/client/src/components/Settings/Dhcp/Leases.js @@ -1,32 +1,49 @@ -import React from 'react'; +import React, { Component } from 'react'; import PropTypes from 'prop-types'; import ReactTable from 'react-table'; import { Trans, withNamespaces } from 'react-i18next'; -const columns = [{ - Header: 'MAC', - accessor: 'mac', -}, { - Header: 'IP', - accessor: 'ip', -}, { - Header: dhcp_table_hostname, - accessor: 'hostname', -}, { - Header: dhcp_table_expires, - accessor: 'expires', -}]; +class Leases extends Component { + cellWrap = ({ value }) => ( +
+ + {value} + +
+ ); -const Leases = props => ( - -); + render() { + const { leases, t } = this.props; + return ( + dhcp_table_hostname, + accessor: 'hostname', + Cell: this.cellWrap, + }, { + Header: dhcp_table_expires, + accessor: 'expires', + Cell: this.cellWrap, + }, + ]} + showPagination={false} + noDataText={t('dhcp_leases_not_found')} + minRows={6} + className="-striped -highlight card-table-overflow" + /> + ); + } +} Leases.propTypes = { leases: PropTypes.array,