Skip to content

Commit

Permalink
Feat: #238 Update total count section styling in Developer Traffic Ta…
Browse files Browse the repository at this point in the history
…ble (#279)

* fix: Fix developer traffic chart loading issues

* fix: Remove redundant codes

* fix: Update testing snapshots

* fix: Revert admin stats test snapshot

* feat: #238 - Fix ui issues in analytics page

* feat: #238 - Add total traffic count label

* feat: #238 - Update test - Fix general UI issues

* feat: #238 - Update analytics page test

* feat: #238 - Add test for anonymous funcs - Update hooks lint rules

* feat: #238 - Temporarily disabled rules of hooks lint

* feat: #238 - Update api traffic table styling
  • Loading branch information
nphivu414 authored Feb 14, 2020
1 parent 6294f77 commit 8490a99
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
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;
}
}

0 comments on commit 8490a99

Please sign in to comment.