Skip to content

Commit

Permalink
Changing options in .prettierrc.js
Browse files Browse the repository at this point in the history
  • Loading branch information
tjayrush committed Jan 27, 2020
1 parent 5f40445 commit 0089e02
Show file tree
Hide file tree
Showing 55 changed files with 1,064 additions and 1,005 deletions.
1 change: 1 addition & 0 deletions frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/pages/templates
8 changes: 8 additions & 0 deletions frontend/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
endOfLine: 'lf',
arrowParens: 'always',
semi: true,
singleQuote: true,
printWidth: 120,
tabWidth: 2
};
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"backup": "tar --exclude \"./.git\" --exclude \"./build\" --exclude \"./node_modules\" -cvf ../../trueblocks-backups/frontend.tar . ; gzip ../../trueblocks-backups/*.tar && open ../../trueblocks-backups"
},
"devDependencies": {
"prettier": "1.18.2",
"prettier": "^1.19.1",
"react-scripts": "2.1.8",
"redux-devtools": "^3.5.0"
},
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class App extends React.Component {
return currentLocation.pathname === '/';
}

onTopScroll = scrolledDown => {
onTopScroll = (scrolledDown) => {
this.setState({
smallHeader: scrolledDown
});
Expand Down Expand Up @@ -75,7 +75,4 @@ const mapDispatchToProps = (dispatch) =>
dispatch
);

export default connect(
mapStateToProps,
mapDispatchToProps
)(App);
export default connect(mapStateToProps, mapDispatchToProps)(App);
5 changes: 1 addition & 4 deletions frontend/src/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,4 @@ const mapDispatchToProps = (dispatch) =>
dispatch
);

export default connect(
mapStateToProps,
mapDispatchToProps
)(Content);
export default connect(mapStateToProps, mapDispatchToProps)(Content);
4 changes: 1 addition & 3 deletions frontend/src/components/ExpandShrinkIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ const getIconsNames = (shrinkTo) => chevronDirectionByShrinkTo.get(shrinkTo);
export default function ExpandShrinkIcon({ shrinkTo, isExpanded, toggleIcon, onClick }) {
const iconName = toggleIcon || getIconsNames(shrinkTo)[isExpanded ? 'shrink' : 'expand'];

return (
<Icon icon={iconName} onClick={onClick} />
);
return <Icon icon={iconName} onClick={onClick} />;
}
116 changes: 56 additions & 60 deletions frontend/src/components/PageHelp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,85 +5,85 @@ import Routes from '../routes';
const helpToPage = new Map([
[
'root',
() => (
<span>
Learn about the TrueBlocks project, our organization, our philosopy towards decentralization, and our team.
</span>
)
() => (
<span>
Learn about the TrueBlocks project, our organization, our philosopy towards decentralization, and our team.
</span>
)
],
[
'addresses',
() => (
<span>
Monitors are per-address index caches that enable fast reteival of transaction histories for any account. Note
that the transactions/logs/receipts/traces are not downloaded until you explore an address.
</span>
),
() => (
<span>
Monitors are per-address index caches that enable fast reteival of transaction histories for any account. Note
that the transactions/logs/receipts/traces are not downloaded until you explore an address.
</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>
),
() => (
<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',
() => (
<span>
The Explore module allows one to view the details of every transactions for each previously monitored address.
Because TrueBlocks runs on a local machine not a server, this means that you are restricted to exploring only
addresses that youve previously monitored.
</span>
),
() => (
<span>
The Explore module allows one to view the details of every transactions for each previously monitored address.
Because TrueBlocks runs on a local machine not a server, this means that you are restricted to exploring only
addresses that youve previously monitored.
</span>
)
],
[
'indicies',
() => (
<span>
TrueBlocks index of appearances 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>
),
() => (
<span>
TrueBlocks index of appearances 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>
)
],
[
'other',
() => (
<span>
The Other panel allows you to configure various other items related to TrueBlocks. This panel allows for many
things including some other stuff.
</span>
),
() => (
<span>
The Other panel allows you to configure various other items related to TrueBlocks. This panel allows for many
things including some other stuff.
</span>
)
],
[
'settings',
() => (
<span>
Monitors are per-address index caches that enable fast retreival of appearance histories for any account.
</span>
),
() => (
<span>
Monitors are per-address index caches that enable fast retreival of appearance histories for any account.
</span>
)
],
[
'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>
),
() => (
<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>
)
],
[
'support',
() => (
<span>
We provide various support options ranging from online email/forum discussions to full enterprise-level support
plans to suit your needs. Weve got you covered.
</span>
),
],
() => (
<span>
We provide various support options ranging from online email/forum discussions to full enterprise-level support
plans to suit your needs. Weve got you covered.
</span>
)
]
]);

// Dashboard and root share the same help
Expand All @@ -93,11 +93,7 @@ export default function PageHelp() {
return (
<Switch>
{Routes.map((route, index) => (
<Route
key={index}
render={helpToPage.get(route.name)}
exact={route.exact}
path={route.path} />
<Route key={index} render={helpToPage.get(route.name)} exact={route.exact} path={route.path} />
))}
</Switch>
);
Expand Down
7 changes: 1 addition & 6 deletions frontend/src/components/panels/status-inner.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +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));
5 changes: 1 addition & 4 deletions frontend/src/components/polling.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,5 @@ export const polling = (pollingAction, duration = 5000) => (Component) => {
const mapStateToProps = () => ({});

const mapDispatchToProps = { pollingAction };
return connect(
mapStateToProps,
mapDispatchToProps
)(Wrapper());
return connect(mapStateToProps, mapDispatchToProps)(Wrapper());
};
4 changes: 2 additions & 2 deletions frontend/src/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"apiProvider": "http://localhost:8080"
}
"apiProvider": "http://localhost:8080"
}
2 changes: 1 addition & 1 deletion frontend/src/pages/addresses/dispatchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ export const dispatcher_AddMonitor = (address) => {
});
};
};
// EXISTING_CODE
// EXISTING_CODE
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 };
20 changes: 8 additions & 12 deletions frontend/src/pages/addresses/inner.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { dispatcher_Addresses } from './dispatchers';

import { BreadCrumb } from '../../components'
import { BreadCrumb } from '../../components';
import { isError, NotReady, isEmpty, EmptyQuery } from '../../components';
import { isReady } from '../../components';
import { DataTable } from '../../components';
Expand Down Expand Up @@ -51,8 +51,7 @@ class AddressesInner extends React.Component {
// EXISTING_CODE

getInnerPage = () => {
if (this.state.cur_submenu.subpage === 'dashboard')
return <div>The dashboard for Addresses</div>
if (this.state.cur_submenu.subpage === 'dashboard') return <div>The dashboard for Addresses</div>;
if (isError(this.props)) return <NotReady {...this.props} />;
else if (!isReady(this.props, this.props.data)) return <NotReady {...this.props} />;
else if (isEmpty(this.props.data)) return <EmptyQuery query={this.state.subpage} />;
Expand All @@ -74,11 +73,11 @@ class AddressesInner extends React.Component {

render = () => {
return (
<div className="inner-panel">
<BreadCrumb page='Addresses' menu={this.state.cur_submenu} />
{this.getInnerPage()}
{JSON.stringify(this.state)}
</div>
<div className="inner-panel">
<BreadCrumb page="Addresses" menu={this.state.cur_submenu} />
{this.getInnerPage()}
{JSON.stringify(this.state)}
</div>
);
};
}
Expand Down Expand Up @@ -130,7 +129,4 @@ const mapDispatchToProps = (dispatch) =>
);

//----------------------------------------------------------------------
export default connect(
mapStateToProps,
mapDispatchToProps
)(AddressesInner);
export default connect(mapStateToProps, mapDispatchToProps)(AddressesInner);
2 changes: 1 addition & 1 deletion frontend/src/pages/addresses/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ export default function reducer_Addresses(state = initialState, action) {
default:
return state;
}
}
}
2 changes: 1 addition & 1 deletion frontend/src/pages/caches/dispatchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ export const caches_menu = {
};

// EXISTING_CODE
// EXISTING_CODE
// EXISTING_CODE
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 };
20 changes: 8 additions & 12 deletions frontend/src/pages/caches/inner.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { dispatcher_Caches } from './dispatchers';

import { BreadCrumb } from '../../components'
import { BreadCrumb } from '../../components';
import { isError, NotReady, isEmpty, EmptyQuery } from '../../components';
import { isReady } from '../../components';
import { DataTable } from '../../components';
Expand Down Expand Up @@ -33,8 +33,7 @@ class CachesInner extends React.Component {
// EXISTING_CODE

getInnerPage = () => {
if (this.state.cur_submenu.subpage === 'dashboard')
return <div>The dashboard for Caches</div>
if (this.state.cur_submenu.subpage === 'dashboard') return <div>The dashboard for Caches</div>;
if (isError(this.props)) return <NotReady {...this.props} />;
else if (!isReady(this.props, this.props.data)) return <NotReady {...this.props} />;
else if (isEmpty(this.props.data)) return <EmptyQuery query={this.state.subpage} />;
Expand All @@ -45,11 +44,11 @@ class CachesInner extends React.Component {

render = () => {
return (
<div className="inner-panel">
<BreadCrumb page='Caches' menu={this.state.cur_submenu} />
{this.getInnerPage()}
{JSON.stringify(this.state)}
</div>
<div className="inner-panel">
<BreadCrumb page="Caches" menu={this.state.cur_submenu} />
{this.getInnerPage()}
{JSON.stringify(this.state)}
</div>
);
};
}
Expand Down Expand Up @@ -81,7 +80,4 @@ const mapDispatchToProps = (dispatch) =>
);

//----------------------------------------------------------------------
export default connect(
mapStateToProps,
mapDispatchToProps
)(CachesInner);
export default connect(mapStateToProps, mapDispatchToProps)(CachesInner);
2 changes: 1 addition & 1 deletion frontend/src/pages/caches/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ export default function reducer_Caches(state = initialState, action) {
default:
return state;
}
}
}
4 changes: 2 additions & 2 deletions frontend/src/pages/dashboard/dispatchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ export const dispatcher_Dashboard = (str) => {
//----------------------------------------------------------------------
export const dashboard_menu = {
page: 'dashboard',
items: [ ],
items: [],
expanded: false,
color: 'white'
};

// EXISTING_CODE
// EXISTING_CODE
// EXISTING_CODE
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 };
Loading

0 comments on commit 0089e02

Please sign in to comment.