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

Commit

Permalink
fix: review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-calavera authored and sunnygleason committed Sep 10, 2019
1 parent 2da70be commit b91bada
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 40 deletions.
8 changes: 8 additions & 0 deletions src/v2/@types/table.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@flow

export type TableHeadProps = {
name: string,
text: string,
term: string,
width?: number,
};
12 changes: 3 additions & 9 deletions src/v2/components/Applications/Table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,11 @@ import {Link} from 'react-router-dom';
import {map} from 'lodash/fp';
import HelpLink from 'v2/components/HelpLink';
import TypeLabel from 'v2/components/UI/TypeLabel';
import type {TableHeadProps} from 'v2/@types/table';

import useStyles from './styles';

type THead = {
name: string,
text: string,
term: string,
width?: number,
};

const tHeads: THead[] = [
const tHeads: TableHeadProps[] = [
{
name: 'Application Id',
text: '',
Expand Down Expand Up @@ -65,7 +59,7 @@ const ApplicationsTable = ({separate}: {separate: boolean}) => {
</TableRow>
);
};
const renderTH = ({name, width, ...rest}: THead) => (
const renderTH = ({name, width, ...rest}: TableHeadProps) => (
<TableCell key={name} width={width}>
{name}
<HelpLink {...rest} />
Expand Down
12 changes: 3 additions & 9 deletions src/v2/components/Blocks/Table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@ import {observer} from 'mobx-react-lite';
import {Link} from 'react-router-dom';
import {map} from 'lodash/fp';
import Avatar from 'v2/components/UI/Avatar';
import type {TableHeadProps} from 'v2/@types/table';

import HelpLink from '../../HelpLink';
import useStyles from './styles';

type THead = {
name: string,
text: string,
term: string,
width?: number,
};

const tHeads: THead[] = [
const tHeads: TableHeadProps[] = [
{
name: 'blocks',
text: '',
Expand Down Expand Up @@ -79,7 +73,7 @@ const BlocksTable = ({separate}: {separate: boolean}) => {
</TableRow>
);
};
const renderTH = ({name, width, ...rest}: THead) => (
const renderTH = ({name, width, ...rest}: TableHeadProps) => (
<TableCell key={name} width={width}>
{name}
<HelpLink {...rest} />
Expand Down
12 changes: 3 additions & 9 deletions src/v2/components/Favorites/Accounts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@ import {observer} from 'mobx-react-lite';
import {Link} from 'react-router-dom';
import {map} from 'lodash/fp';
import HelpLink from 'v2/components/HelpLink';
import type {TableHeadProps} from 'v2/@types/table';

import useStyles from './styles';

type THead = {
name: string,
text: string,
term: string,
width?: number,
};

const tHeads: THead[] = [
const tHeads: TableHeadProps[] = [
{
name: 'Account Id',
text: '',
Expand Down Expand Up @@ -68,7 +62,7 @@ const AccountsTable = ({separate}: {separate: boolean}) => {
</TableRow>
);
};
const renderTH = ({name, width, ...rest}: THead) => (
const renderTH = ({name, width, ...rest}: TableHeadProps) => (
<TableCell key={name} width={width}>
{name}
<HelpLink {...rest} />
Expand Down
12 changes: 7 additions & 5 deletions src/v2/components/Favorites/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ import useStyles from './styles';

const TransactionsPage = () => {
const classes = useStyles();
const [tab, setTab] = useState(0);
const [tab, setTab] = useState('applications');
const theme = useTheme();
const verticalTabs = useMediaQuery(theme.breakpoints.down('xs'));
const handleTabChange = (event, tab) => setTab(tab);
const tabNav = ['Applications', 'Accounts'];
const renderTabNav = label => <TabNav key={label} label={label} />;
const tabNav = ['applications', 'accounts'];
const renderTabNav = label => (
<TabNav key={label} label={label} value={label} />
);

return (
<Container>
Expand All @@ -38,8 +40,8 @@ const TransactionsPage = () => {
>
{map(renderTabNav)(tabNav)}
</Tabs>
{eq(0, tab) && <ApplicationsTable />}
{eq(1, tab) && <AccountsTable />}
{eq('applications', tab) && <ApplicationsTable />}
{eq('accounts', tab) && <AccountsTable />}
</Container>
);
};
Expand Down
11 changes: 3 additions & 8 deletions src/v2/components/Transactions/Table/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ import {Link} from 'react-router-dom';
import {map} from 'lodash/fp';
import HelpLink from 'v2/components/HelpLink';
import TypeLabel from 'v2/components/UI/TypeLabel';
import type {TableHeadProps} from 'v2/@types/table';

import useStyles from './styles';

type THead = {
name: string,
text: string,
term: string,
};

const tHeads: THead[] = [
const tHeads: TableHeadProps[] = [
{
name: 'hash',
text: '',
Expand Down Expand Up @@ -97,7 +92,7 @@ const TransactionsTable = ({
</TableRow>
);
};
const renderTH = ({name, ...rest}: THead) => (
const renderTH = ({name, ...rest}: TableHeadProps) => (
<TableCell key={name}>
{name}
<HelpLink {...rest} />
Expand Down

0 comments on commit b91bada

Please sign in to comment.