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

Feat: #238 Update total count section styling in Developer Traffic Table #279

Merged
merged 16 commits into from
Feb 14, 2020
Merged
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
5 changes: 4 additions & 1 deletion packages/elements/src/components/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ export const Table = ({
prepareRow(row) || (
<tr {...row.getRowProps()}>
{row.cells.map((cell, index) => {
const {
column: { columnProps },
} = cell
return (
<td key={index} {...cell.getCellProps()}>
<td key={index} {...cell.getCellProps()} {...columnProps}>
{cell.render('Cell')}
</td>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ exports[`DeveloperTrafficTable should match a snapshot 1`] = `
Object {
"Header": "Total API Calls",
"accessor": "requests",
"columnProps": Object {
"width": 300,
},
},
]
}
Expand All @@ -45,11 +48,15 @@ exports[`DeveloperTrafficTable should match a snapshot 1`] = `
loading={false}
scrollable={true}
/>
<Component
<div
className="undefined is-pulled-right"
>
Total API Calls:
5
</Component>
<Component
className="undefined is-pulled-left"
>
Total API Calls:
5
</Component>
</div>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export const generateUsageStatsColumns = () => () => {
{
Header: 'Total API Calls',
accessor: 'requests',
columnProps: {
width: 300,
},
},
]
}
Expand All @@ -61,9 +64,11 @@ const DeveloperTrafficTable: React.FC<DeveloperAppTrafficProps> = ({ stats, apps

const renderTotalRequest = () => {
return (
<H4 className={`${styles.totalCount} is-pulled-right`}>
Total API Calls: {calculateTotalRequest(usageStatsData)}
</H4>
<div className={`${styles.totalApiCountWrapper} is-pulled-right`}>
<H4 className={`${styles.totalCount} is-pulled-left`}>
Total API Calls: {calculateTotalRequest(usageStatsData)}
</H4>
</div>
)
}

Expand Down
5 changes: 5 additions & 0 deletions packages/marketplace/src/styles/pages/analytics.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@
font-size: 1rem;
margin: 1rem 0;
}
.totalApiCountWrapper {
@media (min-width: 480px) {
width: 300px;
}
}