From 563f8031dce889b076c91a4b3b6489241cd2b322 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Thu, 26 Sep 2019 12:17:58 +0300 Subject: [PATCH] - client: fix naming --- .../Settings/Clients/AutoClients.js | 21 +++++++++++-------- .../Settings/Clients/ClientsTable.js | 5 +++-- .../Clients/{wrapCell.js => WrapCell.js} | 6 +++--- 3 files changed, 18 insertions(+), 14 deletions(-) rename client/src/components/Settings/Clients/{wrapCell.js => WrapCell.js} (78%) diff --git a/client/src/components/Settings/Clients/AutoClients.js b/client/src/components/Settings/Clients/AutoClients.js index 4e6ea1a8..abfe8a0d 100644 --- a/client/src/components/Settings/Clients/AutoClients.js +++ b/client/src/components/Settings/Clients/AutoClients.js @@ -4,8 +4,11 @@ import { withNamespaces } from 'react-i18next'; import ReactTable from 'react-table'; import Card from '../../ui/Card'; +import WrapCell from './WrapCell'; + import whoisCell from './whoisCell'; -import wrapCell from './wrapCell'; + +const COLUMN_MIN_WIDTH = 200; class AutoClients extends Component { getStats = (ip, stats) => { @@ -21,31 +24,31 @@ class AutoClients extends Component { { Header: this.props.t('table_client'), accessor: 'ip', - minWidth: 200, - Cell: wrapCell, + minWidth: COLUMN_MIN_WIDTH, + Cell: WrapCell, }, { Header: this.props.t('table_name'), accessor: 'name', - minWidth: 200, - Cell: wrapCell, + minWidth: COLUMN_MIN_WIDTH, + Cell: WrapCell, }, { Header: this.props.t('source_label'), accessor: 'source', - minWidth: 200, - Cell: wrapCell, + minWidth: COLUMN_MIN_WIDTH, + Cell: WrapCell, }, { Header: this.props.t('whois'), accessor: 'whois_info', - minWidth: 200, + minWidth: COLUMN_MIN_WIDTH, Cell: whoisCell(this.props.t), }, { Header: this.props.t('requests_count'), accessor: 'statistics', - minWidth: 200, + minWidth: COLUMN_MIN_WIDTH, Cell: (row) => { const clientIP = row.original.ip; const clientStats = clientIP && this.getStats(clientIP, this.props.topClients); diff --git a/client/src/components/Settings/Clients/ClientsTable.js b/client/src/components/Settings/Clients/ClientsTable.js index eefa1157..6fee7217 100644 --- a/client/src/components/Settings/Clients/ClientsTable.js +++ b/client/src/components/Settings/Clients/ClientsTable.js @@ -6,7 +6,8 @@ import ReactTable from 'react-table'; import { MODAL_TYPE, CLIENT_ID } from '../../../helpers/constants'; import Card from '../../ui/Card'; import Modal from './Modal'; -import wrapCell from './wrapCell'; +import WrapCell from './WrapCell'; + import whoisCell from './whoisCell'; class ClientsTable extends Component { @@ -103,7 +104,7 @@ class ClientsTable extends Component { Header: this.props.t('table_name'), accessor: 'name', minWidth: 120, - Cell: wrapCell, + Cell: WrapCell, }, { Header: this.props.t('settings'), diff --git a/client/src/components/Settings/Clients/wrapCell.js b/client/src/components/Settings/Clients/WrapCell.js similarity index 78% rename from client/src/components/Settings/Clients/wrapCell.js rename to client/src/components/Settings/Clients/WrapCell.js index 54e13996..2a5413b7 100644 --- a/client/src/components/Settings/Clients/wrapCell.js +++ b/client/src/components/Settings/Clients/WrapCell.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -const wrapCell = ({ value }) => ( +const WrapCell = ({ value }) => (
{value || '–'} @@ -9,8 +9,8 @@ const wrapCell = ({ value }) => (
); -wrapCell.propTypes = { +WrapCell.propTypes = { value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), }; -export default wrapCell; +export default WrapCell;