Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add table pagination #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/Bui.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const {
radioFormCode,
fileUploadCode,
tableCode,
paginatedTableCode,
tabMenuCode,
dropdownCode
} = codeSnippets;
Expand Down Expand Up @@ -263,6 +264,11 @@ class Bui extends PureComponent {
<Table {...tableProps} />
<xmp style={styles.xmp}>{tableCode}</xmp>
</div>
<Header type="h2">Paginating Table</Header>
<div style={styles.componentContainer}>
<Table pageSize={2} {...tableProps} />
<xmp style={styles.xmp}>{paginatedTableCode}</xmp>
</div>
</div>
<div style={styles.componentFamilyContainer}>
<Header type="h2">TabMenu</Header>
Expand Down
5 changes: 5 additions & 0 deletions lib/constants/codeSnippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ export const tableCode = `import { Table } from '@bpanel/bpanel-ui';
<Table {...tableProps} />
`;

export const paginatedTableCode = `import { Table } from '@bpanel/bpanel-ui';

<Table pageSize={2} {...tableProps} />
`;

export const tabMenuCode = `import { TabMenu } from '@bpanel/bpanel-ui';

<TabMenu />
Expand Down
44 changes: 22 additions & 22 deletions lib/constants/tableProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,59 @@ const exampleTableData = [
Age: '2m',
'# of Tx': '2464',
'BTC Sent': '18',
'Size (kB)': '1,018',
Weight: '1898',
'Avg Fee': '$1.58',
'Size (kB)': '1,311',
bucko13 marked this conversation as resolved.
Show resolved Hide resolved
Weight: '1311',
'Avg Fee': '$1.52',
Miner: 'bcoin'
},
{
Height: '488236',
Age: '14m',
'# of Tx': '2464',
'BTC Sent': '18',
'Size (kB)': '1,018',
Weight: '1898',
'Avg Fee': '$1.58',
'Size (kB)': '1,912',
Weight: '1912',
'Avg Fee': '$1.35',
Miner: 'bcoin'
},
{
Height: '488236',
Age: '2m',
'# of Tx': '2464',
'BTC Sent': '18',
'BTC Sent': '42',
'Size (kB)': '1,018',
Weight: '1898',
'Avg Fee': '$1.58',
Weight: '1018',
'Avg Fee': '$7.48',
Miner: 'bcoin'
},
{
Height: '488236',
Age: '14m',
'# of Tx': '2464',
'BTC Sent': '18',
'Size (kB)': '1,018',
Weight: '1898',
'Avg Fee': '$1.58',
'BTC Sent': '41',
'Size (kB)': '1,710',
Weight: '1710',
'Avg Fee': '$1.57',
Miner: 'bcoin'
},
{
Height: '488236',
Age: '2m',
'# of Tx': '2464',
'BTC Sent': '18',
'# of Tx': '2011',
'BTC Sent': '118',
'Size (kB)': '1,018',
Weight: '1898',
'Avg Fee': '$1.58',
Weight: '1018',
'Avg Fee': '$1.28',
Miner: 'bcoin'
},
{
Height: '488236',
Age: '14m',
'# of Tx': '2464',
'BTC Sent': '18',
'Size (kB)': '1,018',
Weight: '1898',
'Avg Fee': '$1.58',
'# of Tx': '1269',
'BTC Sent': '388',
'Size (kB)': '1,928',
Weight: '1928',
'Avg Fee': '$4.58',
Miner: 'bcoin'
}
];
Expand Down