Skip to content

Commit

Permalink
Fix: Columns are misaligned on Payments->Deposits (#1838)
Browse files Browse the repository at this point in the history
* Fix: #1719 Misaligned columns on Payments->Deposits
- override alignment for deposits list page.
- slight adjustment in transaction table header margin.
- changelog update.
- updated failing snapshots.
- Review changes.
- Aligned data with currency conversion marker.
  • Loading branch information
naman03malhotra authored and ismaeldcom committed May 27, 2021
1 parent 0b369c3 commit f9828fc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion client/deposits/list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import ClickableCell from 'components/clickable-cell';
import Page from '../../components/page';
import DepositsFilters from '../filters';

import './style.scss';

const getColumns = ( sortByDate ) => [
{
key: 'details',
Expand Down Expand Up @@ -159,7 +161,7 @@ export const DepositsList = () => {
<Page>
<DepositsFilters storeCurrencies={ storeCurrencies } />
<TableCard
className="deposits-list woocommerce-report-table"
className="wcpay-deposits-list woocommerce-report-table"
title={ __( 'Deposit history', 'woocommerce-payments' ) }
isLoading={ isLoading }
rowsPerPage={ getQuery().per_page || 25 }
Expand Down
14 changes: 14 additions & 0 deletions client/deposits/list/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$space-header-item: 25px;

.wcpay-deposits-list {
// alignment override for header items
.woocommerce-table__header:not( .is-left-aligned ),
.woocommerce-table__item:not( .is-left-aligned ) {
text-align: center;
}

// slight adjustment to align header items with sorting button to account for icon width
.woocommerce-table__header.is-numeric .components-button {
margin-right: $space-header-item;
}
}
4 changes: 2 additions & 2 deletions client/deposits/list/test/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exports[`Deposits list renders correctly with multiple currencies 1`] = `
</div>
</div>
<div
class="woocommerce-card woocommerce-table woocommerce-analytics__card deposits-list woocommerce-report-table has-menu"
class="woocommerce-card woocommerce-table woocommerce-analytics__card wcpay-deposits-list woocommerce-report-table has-menu"
>
<div
class="woocommerce-card__header"
Expand Down Expand Up @@ -478,7 +478,7 @@ exports[`Deposits list renders correctly with single currency 1`] = `
/>
</div>
<div
class="woocommerce-card woocommerce-table woocommerce-analytics__card deposits-list woocommerce-report-table has-menu"
class="woocommerce-card woocommerce-table woocommerce-analytics__card wcpay-deposits-list woocommerce-report-table has-menu"
>
<div
class="woocommerce-card__header"
Expand Down
4 changes: 2 additions & 2 deletions client/transactions/list/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import 'node_modules/@wordpress/components/src/tooltip/style.scss';

$space-header-item: 15px;
$space-header-item: 25px;

.transactions-list {
.date-time {
Expand All @@ -9,7 +9,7 @@ $space-header-item: 15px;

.converted-amount {
display: flex; // Necessary for conversion tooltip to show.
justify-content: flex-end;
justify-content: center;

.conversion-indicator {
margin-right: 6px;
Expand Down

0 comments on commit f9828fc

Please sign in to comment.