Skip to content

Commit

Permalink
Changing all files in components folder to use PascalCase for components
Browse files Browse the repository at this point in the history
  • Loading branch information
tjayrush committed Jan 28, 2020
1 parent 0089e02 commit 7ba68a1
Show file tree
Hide file tree
Showing 42 changed files with 83 additions and 90 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*-----------------------------------------------------------------------------*/
import React from 'react';
import PropTypes from 'prop-types';
import * as utils from '../../../utils';
import './data-table.css';
import * as utils from '../../utils';
import './DataTable.css';

//----------------------------------------------------------------------
export default class DataCell extends React.Component {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*-----------------------------------------------------------------------------*/
import React from 'react';
import DataCell from './data-cell';
import './data-table.css';
import DataCell from './DataCell';
import './DataTable.css';

//----------------------------------------------------------------------
export default class DataRow extends React.Component {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';

import TableControls from '../table-controls';
import HeaderRow from './header-row';
import DataRow from './data-row';
import { DataTableControls } from '../DataTableControls';
import HeaderRow from './HeaderRow';
import DataRow from './DataRow';

import * as utils from '../../../utils';
import './data-table.css';
import * as utils from '../../utils';
import './DataTable.css';

//----------------------------------------------------------------------
class DataTable extends React.Component {
Expand Down Expand Up @@ -86,7 +86,7 @@ class DataTable extends React.Component {
return (
<Fragment>
<h4>{'Table title: ' + str}</h4>
<TableControls
<DataTableControls
n_items={this.props.data ? this.props.data.length : 0}
pages={this.state.pages}
cur_page={this.state.cur_page}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*-----------------------------------------------------------------------------*/
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Icon } from '../../icon';
import './data-table.css';
import { Icon } from '../Icon';
import './DataTable.css';

//----------------------------------------------------------------------
export default class HeaderCell extends React.Component {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*-----------------------------------------------------------------------------*/
import React from 'react';
import PropTypes from 'prop-types';
import HeaderCell from './header-cell';
import * as utils from '../../../utils';
import './data-table.css';
import HeaderCell from './HeaderCell';
import * as utils from '../../utils';
import './DataTable.css';

//----------------------------------------------------------------------
export default class HeaderRow extends React.Component {
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/DataTable/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { ConnectedDataTable as DataTable } from './DataTable';
export { DataTable };
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
/*-----------------------------------------------------------------------------*/
import React from 'react';
import PropTypes from 'prop-types';
import TableScroll from './table-scroll';
import TableSearch from './table-search';
import '../data-table/data-table.css';
import { DataTableScroll } from './DataTableScroll';
import { DataTableSearch } from './DataTableSearch';
import '../DataTable/DataTable.css';

//----------------------------------------------------------------------
function TableControls(props) {
export function DataTableControls(props) {
return (
<div className={'data_table_half_wide_row ' + props.subpage}>
<TableSearch />
<TableScroll {...props}></TableScroll>
<DataTableSearch />
<DataTableScroll {...props}></DataTableScroll>
</div>
);
}

TableControls.propTypes = {
DataTableControls.propTypes = {
n_items: PropTypes.number.isRequired,
pages: PropTypes.number.isRequired,
cur_page: PropTypes.number.isRequired,
per_page: (PropTypes.number || PropTypes.number).isRequired
};

export default TableControls;
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*-----------------------------------------------------------------------------*/
import React, { Fragment } from 'react';
import { Icon } from '../../icon';
import '../data-table/data-table.css';
import { Icon } from '../Icon';
import '../DataTable/DataTable.css';

//----------------------------------------------------------------------
function TableScroll({ n_items, pages, cur_page, per_page, perPageChanged }) {
export function DataTableScroll({ n_items, pages, cur_page, per_page, perPageChanged }) {
return (
<div style={{ textAlign: 'right' }}>
<form onSubmit={null}>
Expand All @@ -22,5 +22,3 @@ function TableScroll({ n_items, pages, cur_page, per_page, perPageChanged }) {
</div>
);
}

export default TableScroll;
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*-----------------------------------------------------------------------------*/
import React from 'react';
import '../data-table/data-table.css';
import '../DataTable/DataTable.css';

//----------------------------------------------------------------------
function TableSearch({ size = '70', placeholder = 'Search...', style = { textAlign: 'left' } }) {
export function DataTableSearch({ size = '70', placeholder = 'Search...', style = { textAlign: 'left' } }) {
return (
<div style={style}>
<form onSubmit={null}>
Expand All @@ -12,5 +12,3 @@ function TableSearch({ size = '70', placeholder = 'Search...', style = { textAli
</div>
);
}

export default TableSearch;
2 changes: 2 additions & 0 deletions frontend/src/components/DataTableControls/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { DataTableControls } from './DataTableControls';
export { DataTableControls };
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*-----------------------------------------------------------------------------*/
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import './object-data-table.css';
import './DataTableObject.css';
import * as utils from '../../utils';

//----------------------------------------------------------------------
export class ObjectTable extends React.Component {
export class DataTableObject extends React.Component {
constructor(props) {
super(props);
var fields = [];
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/DataTableObject/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { DataTableObject } from './DataTableObject';
export { DataTableObject };
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//----------------------------------------------------------------------
import React, { Fragment } from 'react';
import './old-data-table.css';
import './DataTableOld.css';
import Identicon from './identicons';
import { Icon } from '../icon';
import { Icon } from '../Icon';
var Utils = require('../../utils');

//---------------------------------------------------------------------
export class OldDataTable extends React.Component {
export class DataTableOld extends React.Component {
render = () => {
return (
<table className="old-data-table">
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/DataTableOld/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { DataTableOld } from './DataTableOld';
export { DataTableOld };
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { SidePanel } from '../';
import { SidePanel } from './SidePanel';

export const HelpPanel = (props) => {
const { isExpanded, toggle } = props;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/MainMenu/Chevron.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Icon } from '../icon';
import { Icon } from '../Icon';

//------------------------------------------------------------
export default function Chevron({ active }) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/MainMenu/MainMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ const mapStateToProps = ({ router, reducer_MainMenu }, ownProps) => ({
toggle: ownProps.toggle
});

export default connect(mapStateToProps)(MainMenu);
export const ConnectedMainMenu = connect(mapStateToProps)(MainMenu);
2 changes: 1 addition & 1 deletion frontend/src/components/MainMenu/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import MainMenu from './MainMenu';
import { ConnectedMainMenu as MainMenu } from './MainMenu';
export { MainMenu };
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Fragment } from 'react';
//import PropTypes from 'prop-types';
import { Loading } from './loading';
import { Loading } from './Loading';

//----------------------------------------------------------------
export class NotReady extends React.Component {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { SidePanel } from '../SidePanel';
import StatusInner from './status-inner';
import './status.css';
import StatusInner from './StatusPanelInner';
import './StatusPanel.css';

export const StatusPanel = (props) => {
const { isExpanded, toggle } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { Fragment } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';

import { polling } from '../polling';
import { Polling } from '../Polling';
import { fmtDouble, fmtInteger } from '../../utils';

import green_light from '../../img/status-green-light.png';
import yellow_light from '../../img/status-yellow-light.png';
import red_light from '../../img/status-red-light.png';
import { dispatcher_Status } from './status-actions';
import './status.css';
import { dispatcher_Status } from './reducers';
import './StatusPanel.css';

//---------------------------------------------------------------------
const StatusInner = (props) => {
Expand Down Expand Up @@ -216,4 +216,4 @@ const mapDispatchToProps = (dispatch) =>
);

//---------------------------------------------------------------------
export default polling(dispatcher_Status, 10000)(connect(mapStateToProps, mapDispatchToProps)(StatusInner));
export default Polling(dispatcher_Status, 10000)(connect(mapStateToProps, mapDispatchToProps)(StatusInner));
2 changes: 2 additions & 0 deletions frontend/src/components/StatusPanel/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { StatusPanel } from './StatusPanel';
export { StatusPanel };
1 change: 0 additions & 1 deletion frontend/src/components/data-tables/data-table/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/src/components/data-tables/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/src/components/data-tables/table-controls/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/components/icon.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './icon.css';
import './Icon.css';

//----------------------------------------------------------------------
export class Icon extends Component {
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Page, PageHeader, PageFooter } from './Page';
import { DataTable } from './data-tables';
import { OldDataTable } from './data-tables/old-data-table';
import { ObjectTable } from './data-tables/object-data-table';
import { Icon } from './icon';
import { Loading } from './loading';
import { isReady, isError, NotReady, isEmpty, EmptyQuery } from './not-ready';
import { DataTable } from './DataTable';
import { DataTableOld } from './DataTableOld';
import { DataTableObject } from './DataTableObject';
import { Icon } from './Icon';
import { Loading } from './Loading';
import { isReady, isError, NotReady, isEmpty, EmptyQuery } from './NotReady';
import { BreadCrumb } from './BreadCrumb';
import { DashMenu } from './DashMenu';
import { TopScrollObserver } from './TopScrollObserver';
import { MainMenu } from './MainMenu';
import { SidePanel } from './SidePanel';
import StatusPanel from './panels/status';
import HelpPanel from './panels/help';
import { StatusPanel } from './StatusPanel';
import HelpPanel from './HelpPanel';
import PageHelp from './PageHelp';
import ExpandShrinkIcon from './ExpandShrinkIcon';

Expand All @@ -20,8 +20,8 @@ export {
PageHeader,
PageFooter,
DataTable,
OldDataTable,
ObjectTable,
DataTableOld,
DataTableObject,
Icon,
Loading,
isReady,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/loading.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Icon } from './icon';
import './loading.css';
import { Icon } from './Icon';
import './Loading.css';

//----------------------------------------------------------------------
export class Loading extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/polling.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { connect } from 'react-redux';

export const polling = (pollingAction, duration = 5000) => (Component) => {
export const Polling = (pollingAction, duration = 5000) => (Component) => {
const Wrapper = () =>
class extends React.Component {
componentDidMount = () => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/addresses/inner.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import './addresses.css';

// EXISTING_CODE
import { dispatcher_RemoveMonitor, dispatcher_AddMonitor } from './dispatchers';
import { OldDataTable } from '../../components';
import { DataTableOld } from '../../components';
const headings = ['', 'Name', 'First', 'Last', 'Range', 'Count', 'Interval', 'Bytes', 'Balance', ''];
// EXISTING_CODE

Expand Down Expand Up @@ -61,7 +61,7 @@ class AddressesInner extends React.Component {
<Fragment>
<AddNewAddress {...this.props} />
<div className="old-data-table">
<OldDataTable headings={headings} rows={this.props.data} innerEar={this.innerEar} />
<DataTableOld headings={headings} rows={this.props.data} innerEar={this.innerEar} />
</div>
;
</Fragment>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/explore/inner.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { dispatcher_Explore } from './dispatchers';
import { BreadCrumb } from '../../components';
import { isError, NotReady, isEmpty, EmptyQuery } from '../../components';
import { isReady } from '../../components';
import { ObjectTable } from '../../components';
import { DataTableObject } from '../../components';
import * as utils from '../../utils';
import './explore.css';

Expand Down Expand Up @@ -39,7 +39,7 @@ class ExploreInner extends React.Component {
else if (isEmpty(this.props.data)) return <EmptyQuery query={this.state.subpage} />;
// EXISTING_CODE
// EXISTING_CODE
return <ObjectTable subpage="explore" data={this.props.data} />;
return <DataTableObject subpage="explore" data={this.props.data} />;
};

render = () => {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/templates/blank-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import Routes from './routes';
import './Content.css';

const mainMenu = [
[{NAVLINKS}]];
[{NAVLINKS}]
];

const toggleStatus = () => ({ type: STATUS_TOGGLE });
const toggleHelp = () => ({ type: HELP_TOGGLE });
Expand Down
Loading

0 comments on commit 7ba68a1

Please sign in to comment.