Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
feat: linting the js
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnygleason committed Oct 21, 2019
1 parent 1e92d21 commit 2754654
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 45 deletions.
12 changes: 2 additions & 10 deletions api/network-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,7 @@ export function addNetworkExplorerRoutes(redisX, app) {
const count = q.count ? parseInt(q.count) : DEFAULT_PAGE_SIZE;
const direction = q.direction || '-';
const {__errors__, rawData} = await new FriendlyGet()
.with(
'rawData',
loadProgramIndex(redisX, start, count, direction),
{},
)
.with('rawData', loadProgramIndex(redisX, start, count, direction), {})
.get();

res.send(
Expand All @@ -169,11 +165,7 @@ export function addNetworkExplorerRoutes(redisX, app) {

const version = q.v || 'ProgramDetailView@latest';
const {__errors__, rawData} = await new FriendlyGet()
.with(
'rawData',
loadProgramDetail(redisX, req.params.id, version),
{},
)
.with('rawData', loadProgramDetail(redisX, req.params.id, version), {})
.get();

res.send(
Expand Down
10 changes: 2 additions & 8 deletions src/AppV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ const TransactionDetail = lazy(() =>
import('v2/components/Transactions/Detail'),
);
const Programs = lazy(() => import('v2/components/Programs'));
const ProgramDetail = lazy(() =>
import('v2/components/Programs/Detail'),
);
const ProgramDetail = lazy(() => import('v2/components/Programs/Detail'));
const Accounts = lazy(() => import('v2/components/Accounts'));
const AccountDetail = lazy(() => import('v2/components/Accounts/Detail'));
const Favorites = lazy(() => import('v2/components/Favorites'));
Expand Down Expand Up @@ -140,11 +138,7 @@ const App = () => {
path="/programs/timeline/:start"
component={Programs}
/>
<Route
exact
path="/programs/:id"
component={ProgramDetail}
/>
<Route exact path="/programs/:id" component={ProgramDetail} />
<Route exact path="/accounts" component={Accounts} />
<Route
exact
Expand Down
7 changes: 1 addition & 6 deletions src/v2/Bx2NavDrawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ class Bx2NavDrawer extends React.Component {
</ListItemIcon>
<ListItemText primary="Tour De Sol" />
</ListItem>
<ListItem
button
key="Programs"
component={Link}
to="/v2/programs"
>
<ListItem button key="Programs" component={Link} to="/v2/programs">
<ListItemIcon>
<DashboardIcon />
</ListItemIcon>
Expand Down
2 changes: 1 addition & 1 deletion src/v2/api/programs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const PROGRAM_DETAIL_VERSION = '[email protected]';
export function apiGetProgramDetail({programId, version}) {
return api(
`/explorer/programs/${encodeURIComponent(programId)}?v=${version ||
PROGRAM_DETAIL_VERSION}`,
PROGRAM_DETAIL_VERSION}`,
);
}

Expand Down
5 changes: 1 addition & 4 deletions src/v2/components/Programs/Detail/ApplicationsTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import Program from './Program';
const ProgramsTab = ({programs}) => {
return (
<div>
<Program
id="0xAA15A3E6b97d09653b8b8d9c9e1D80daf5ba81e8"
accounts={[]}
/>
<Program id="0xAA15A3E6b97d09653b8b8d9c9e1D80daf5ba81e8" accounts={[]} />
</div>
);
};
Expand Down
8 changes: 2 additions & 6 deletions src/v2/components/Programs/Table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ const ProgramsTable = ({
return (
<TableRow hover key={program.programId}>
<TableCell>
<Link to={`/programs/${program.programId}`}>
{program.programId}
</Link>
<Link to={`/programs/${program.programId}`}>{program.programId}</Link>
</TableCell>
<TableCell>
<div>
Expand Down Expand Up @@ -87,9 +85,7 @@ const ProgramsTable = ({
</li>
<li>
<div className={classes.cardTitle}>Time</div>
<div title={program.timestamp}>
{asTime(program.timestamp)}
</div>
<div title={program.timestamp}>{asTime(program.timestamp)}</div>
</li>
</ul>
</div>
Expand Down
8 changes: 1 addition & 7 deletions src/v2/components/Programs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ import {Link, Match} from 'react-router-dom';

const ProgramsPage = ({match}: {match: Match}) => {
const classes = useStyles();
const {
programs,
programCount,
start,
next,
prev,
} = ProgramsTimelineStore;
const {programs, programCount, start, next, prev} = ProgramsTimelineStore;

if (start !== match.params.start) {
ProgramsTimelineStore.init({start: match.params.start});
Expand Down
4 changes: 1 addition & 3 deletions src/v2/components/Transactions/Detail/ProgramsTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import Program from './Program';

const ProgramsTab = ({transaction}: {transaction: Object}) => {
const renderProgram = instruction => {
return (
<Program id={instruction.programId} accounts={instruction.keys} />
);
return <Program id={instruction.programId} accounts={instruction.keys} />;
};
return <div>{map(renderProgram)(transaction.instructions)}</div>;
};
Expand Down

0 comments on commit 2754654

Please sign in to comment.