Skip to content

Commit

Permalink
Re-enabling auto code generation, starting to rename component files …
Browse files Browse the repository at this point in the history
…to PascalCase
  • Loading branch information
tjayrush committed Jan 27, 2020
1 parent 5cfee28 commit 5885eef
Show file tree
Hide file tree
Showing 25 changed files with 167 additions and 116 deletions.
6 changes: 1 addition & 5 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import { connect } from 'react-redux';
import { history } from './store';
import { SET as SET_LAST_LOCATION } from './last-location-actions';
import Content from './Content';
import {
PageHeader,
PageFooter,
TopScrollObserver
} from './components';
import { PageHeader, PageFooter, TopScrollObserver } from './components';
import './App.css';

//------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/Content.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: grid;
align-content: flex-start;

grid-template-columns: 1fr 1fr 81fr 1fr;
grid-template-columns: 2fr 2fr 78fr 2fr;
}

.left-body-container {
Expand Down Expand Up @@ -56,32 +56,32 @@ main {

/* 1. Help expanded */
.app-content.help-expanded {
grid-template-columns: 1fr 1fr 70fr 12fr;
grid-template-columns: 2fr 2fr 68fr 12fr;
}

/* 2. Status expanded */
.app-content.status-expanded {
grid-template-columns: 1fr 12fr 70fr 1fr;
grid-template-columns: 2fr 12fr 68fr 2fr;
}

/* 3. Status and help expanded */
.app-content.status-expanded.help-expanded {
grid-template-columns: 1fr 12fr 59fr 12fr;
grid-template-columns: 2fr 12fr 58fr 12fr;
}

/* 4. Only menu expanded */
.app-content.menu-expanded {
grid-template-columns: 6fr 1fr 76fr 1fr;
grid-template-columns: 6fr 2fr 74fr 2fr;
}

/* 5. Menu and help expanded */
.app-content.menu-expanded.help-expanded {
grid-template-columns: 6fr 1fr 65fr 12fr;
grid-template-columns: 6fr 2fr 64fr 12fr;
}

/* 6. Menu and status expanded */
.app-content.menu-expanded.status-expanded {
grid-template-columns: 6fr 12fr 65fr 1fr;
grid-template-columns: 6fr 12fr 64fr 2fr;
}

/* 7. Everything expanded expanded */
Expand Down
29 changes: 5 additions & 24 deletions frontend/src/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@ import { other_menu } from './pages/other';
import { settings_menu } from './pages/settings';
import { support_menu } from './pages/support';

import {
STATUS_TOGGLE,
HELP_TOGGLE
} from './components/panels/side-panel-actions';
import { STATUS_TOGGLE, HELP_TOGGLE } from './components/panels/side-panel-actions';
import { MAIN_MENU_TOGGLE } from './components/menus/main-menu/reducer';
import {
MainMenu,
StatusPanel,
HelpPanel,
PageHelp
} from './components';
import { MainMenu, StatusPanel, HelpPanel, PageHelp } from './components';
import Routes from './routes';
import './Content.css';

Expand All @@ -44,20 +36,13 @@ const toggleHelp = () => ({ type: HELP_TOGGLE });
const toggleMainMenu = () => ({ type: MAIN_MENU_TOGGLE });

export function Content(props) {
const {
isStatusExpanded,
isHelpExpanded,
isMainMenuExpanded,
toggleStatus,
toggleHelp,
toggleMainMenu
} = props;
const { isStatusExpanded, isHelpExpanded, isMainMenuExpanded, toggleStatus, toggleHelp, toggleMainMenu } = props;

const classNames = [
'app-content',
isMainMenuExpanded ? 'menu-expanded' : '',
isStatusExpanded ? 'status-expanded' : '',
isHelpExpanded ? 'help-expanded': ''
isHelpExpanded ? 'help-expanded' : ''
].join(' ');

return (
Expand All @@ -66,11 +51,7 @@ export function Content(props) {
<StatusPanel isExpanded={isStatusExpanded} toggle={toggleStatus} />
<main>
{Routes.map((route, index) => (
<Route
key={index}
render={route.component}
exact={route.exact}
path={route.path} />
<Route key={index} render={route.component} exact={route.exact} path={route.path} />
))}
</main>
<HelpPanel isExpanded={isHelpExpanded} toggle={toggleHelp}>
Expand Down
37 changes: 17 additions & 20 deletions frontend/src/components/PageHelp.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ const helpToPage = new Map([
</span>
),
],
[
'caches',
() => (
<span>
TrueBlocks Caches greatly speed up access to the Ethereum data; however, they take up a lot of space on your
hard drive, so you have to keep any eye on them. Clean them out periodically so they dont get too big.
</span>
),
],
[
'explore',
() => (
Expand All @@ -41,36 +50,28 @@ const helpToPage = new Map([
),
],
[
'signatures',
() => (
<span>
TrueBlocks Signatures greatly speed up access to the Ethereum data; however, they take up a lot of space on your
hard drive, so you have to keep any eye on them. Clean them out periodically so they dont get too big.
</span>
),
],
[
'caches',
'other',
() => (
<span>
TrueBlocks Caches greatly speed up access to the Ethereum data; however, they take up a lot of space on your
hard drive, so you have to keep any eye on them. Clean them out periodically so they dont get too big.
The Other panel allows you to configure various other items related to TrueBlocks. This panel allows for many
things including some other stuff.
</span>
),
],
[
'other',
'settings',
() => (
<span>
The Other panel allows you to configure various other items related to TrueBlocks. This panel allows for many things including some other stuff.
Monitors are per-address index caches that enable fast retreival of appearance histories for any account.
</span>
),
],
[
'settings',
'signatures',
() => (
<span>
Monitors are per-address index caches that enable fast retreival of appearance histories for any account.
TrueBlocks Signatures greatly speed up access to the Ethereum data; however, they take up a lot of space on your
hard drive, so you have to keep any eye on them. Clean them out periodically so they dont get too big.
</span>
),
],
Expand All @@ -83,10 +84,6 @@ const helpToPage = new Map([
</span>
),
],
[
'dashboard',
() => (<span></span>),
],
]);

// Dashboard and root share the same help
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/data-tables/object-data-table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export class ObjectTable extends React.Component {

return (
<Fragment>
<h4>{'Table: '}</h4>
<div className={'object_table ' + this.props.subpage}>
<div className="object_table_header">
<div className="object_table_header_item">{this.props.type}</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Fragment } from 'react';
import { NavLink } from 'react-router-dom';
import SubMenuItem from './submenu-item';
import SubmenuItem from './SubmenuItem';
import Chevron from './chevron';

export default function MenuItem({ id, active: mainMenuActive, page, items, onClick }) {
Expand All @@ -12,7 +12,7 @@ export default function MenuItem({ id, active: mainMenuActive, page, items, onCl
if (!hasSubMenu || !mainMenuActive) return null;
return items.map((item, index) => {
if (item.subpage.includes('-') || item.subpage === 'dashboard') return null;
return <SubMenuItem key={index} page={page} item={item} />;
return <SubmenuItem key={index} page={page} item={item} />;
});
})();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { NavLink } from 'react-router-dom';

function SubMenuItem({ item, page, onClick }) {
function SubmenuItem({ item, page, onClick }) {
const to = `/${page}/${item.subpage.replace(' ', '_')}/${item.route}+${item.query}`;
return (
<NavLink className="submenu-item" activeClassName="is-active" to={to}>
Expand All @@ -10,4 +10,4 @@ function SubMenuItem({ item, page, onClick }) {
);
}

export default SubMenuItem;
export default SubmenuItem;
2 changes: 1 addition & 1 deletion frontend/src/components/menus/main-menu/main-menu.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { connect } from 'react-redux';
import { ExpandShrinkIcon } from '../../';
import MenuItem from './menu-item';
import MenuItem from './MenuItem';
import './main-menu.css';

/**
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/addresses/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class Addresses extends React.Component {
};
}
export default Addresses;
export { dispatcher_Addresses, addresses_menu };
export { dispatcher_Addresses, addresses_menu };
2 changes: 1 addition & 1 deletion frontend/src/pages/caches/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class Caches extends React.Component {
};
}
export default Caches;
export { dispatcher_Caches, caches_menu };
export { dispatcher_Caches, caches_menu };
2 changes: 1 addition & 1 deletion frontend/src/pages/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class Dashboard extends React.Component {
};
}
export default Dashboard;
export { dispatcher_Dashboard, dashboard_menu };
export { dispatcher_Dashboard, dashboard_menu };
2 changes: 1 addition & 1 deletion frontend/src/pages/explore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class Explore extends React.Component {
};
}
export default Explore;
export { dispatcher_Explore, explore_menu };
export { dispatcher_Explore, explore_menu };
2 changes: 1 addition & 1 deletion frontend/src/pages/indicies/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class Indicies extends React.Component {
};
}
export default Indicies;
export { dispatcher_Indicies, indicies_menu };
export { dispatcher_Indicies, indicies_menu };
2 changes: 1 addition & 1 deletion frontend/src/pages/other/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class Other extends React.Component {
};
}
export default Other;
export { dispatcher_Other, other_menu };
export { dispatcher_Other, other_menu };
2 changes: 1 addition & 1 deletion frontend/src/pages/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class Settings extends React.Component {
};
}
export default Settings;
export { dispatcher_Settings, settings_menu };
export { dispatcher_Settings, settings_menu };
2 changes: 1 addition & 1 deletion frontend/src/pages/signatures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class Signatures extends React.Component {
};
}
export default Signatures;
export { dispatcher_Signatures, signatures_menu };
export { dispatcher_Signatures, signatures_menu };
2 changes: 1 addition & 1 deletion frontend/src/pages/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ class Support extends React.Component {
};
}
export default Support;
export { dispatcher_Support, support_menu };
export { dispatcher_Support, support_menu };
25 changes: 4 additions & 21 deletions frontend/src/pages/templates/blank-app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import React, { Fragment } from 'react';
import { Route, Redirect } from 'react-router-dom';
import { Redirect } from 'react-router-dom';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { history } from './store';
import { SET as SET_LAST_LOCATION } from './last-location-actions';
import { MainMenu, PageHeader, PageFooter, TopScrollObserver } from './components';
import Content from './Content';
import { PageHeader, PageFooter, TopScrollObserver } from './components';
import './App.css';

//------------------------------------------------------------
[{IMPORTS}]
//------------------------------------------------------------
const setLastLocation = (lastLocation) => ({ type: SET_LAST_LOCATION, lastLocation });

Expand Down Expand Up @@ -54,7 +53,7 @@ class App extends React.Component {
<TopScrollObserver onTopScroll={this.onTopScroll} />
<div className="page-container">
<PageHeader small={this.state.smallHeader} />
<Body />
<Content />
<PageFooter />
</div>
</Fragment>
Expand All @@ -63,22 +62,6 @@ class App extends React.Component {
}

//------------------------------------------------------------
class Body extends React.Component {
render = () => {
return (
<div className="body-item">
<MainMenu mainMenu={mainMenu} />
<div className="right-body-container">
[{ROUTES}] <Route component={Dashboard} path="/dashboard/:subpage/:query?" />
</div>
</div>
);
};
}

//------------------------------------------------------------
var mainMenu = [];
[{NAVLINKS}]
const mapStateToProps = ({ reducer_LastLocation, router }) => ({
lastLocation: reducer_LastLocation.lastLocation,
currentLocation: router.location
Expand Down
Loading

0 comments on commit 5885eef

Please sign in to comment.