diff --git a/src/components/BankAccounts/index.js b/src/components/BankAccounts/index.js
index 52233c84b..edd882a1a 100644
--- a/src/components/BankAccounts/index.js
+++ b/src/components/BankAccounts/index.js
@@ -2,6 +2,8 @@ import React from 'react';
import styled from 'styled-components';
import { Classes } from '@blueprintjs/core';
import clsx from 'classnames';
+import useContextMenu from 'react-use-context-menu';
+import ContextMenu from '../ContextMenu';
import Icon from '../Icon';
const BankAccountWrap = styled.div`
@@ -20,21 +22,6 @@ const BankAccountWrap = styled.div`
}
`;
-const BankAccountAnchor = styled.a`
- text-decoration: none;
- display: flex;
- flex-direction: column;
- flex: 1;
- color: inherit;
-
- &:hover,
- &:focus,
- &:active {
- color: inherit;
- text-decoration: none;
- }
-`;
-
const BankAccountHeader = styled.div`
padding: 10px 12px;
padding-top: 16px;
@@ -179,43 +166,65 @@ function BankAccountTypeIcon({ type }) {
);
}
-
-
export function BankAccount({
title,
code,
type,
balance,
loading = false,
- to
+ updatedBeforeText,
+ to,
+ contextMenuContent,
}) {
+ const [
+ bindMenu,
+ bindMenuItem,
+ useContextTrigger,
+ { coords, setVisible, isVisible },
+ ] = useContextMenu();
+
+ const [bindTrigger] = useContextTrigger({
+ collect: () => 'Title',
+ });
+
+ const handleClose = React.useCallback(() => {
+ setVisible(false);
+ }, [setVisible]);
+
return (
-
-
-
-
- {title}
-
-
- {code}
-
- {!loading && }
-
+
+
+
+ {title}
+
+
+ {code}
+
+ {!loading && }
+
-
-
-
-
+
+
+
+
-
-
+
+
+
+
+
);
}
diff --git a/src/components/IntersectionObserver/index.js b/src/components/IntersectionObserver/index.js
new file mode 100644
index 000000000..df91bc9a6
--- /dev/null
+++ b/src/components/IntersectionObserver/index.js
@@ -0,0 +1,23 @@
+import React from 'react';
+import { useIntersectionObserver } from 'hooks/utils';
+
+/**
+ * Intersection observer.
+ */
+export function IntersectionObserver({ onIntersect }) {
+ const loadMoreButtonRef = React.useRef();
+
+ useIntersectionObserver({
+ // enabled: !isItemsLoading && !isResourceLoading,
+ target: loadMoreButtonRef,
+ onIntersect: () => {
+ onIntersect && onIntersect();
+ },
+ });
+
+ return (
+
+ Load Newer
+
+ );
+}
diff --git a/src/components/index.js b/src/components/index.js
index 54cdead52..6d78330e3 100644
--- a/src/components/index.js
+++ b/src/components/index.js
@@ -82,6 +82,7 @@ export * from './MultiSelectTaggable';
export * from './Utils/FormatNumber';
export * from './Utils/FormatDate';
export * from './BankAccounts';
+export * from './IntersectionObserver'
const Hint = FieldHint;
diff --git a/src/containers/CashFlow/AccountTransactions/AccountTransactionsDataTable.js b/src/containers/CashFlow/AccountTransactions/AccountTransactionsDataTable.js
index e7e5944ed..5b0f8e9aa 100644
--- a/src/containers/CashFlow/AccountTransactions/AccountTransactionsDataTable.js
+++ b/src/containers/CashFlow/AccountTransactions/AccountTransactionsDataTable.js
@@ -52,14 +52,13 @@ function AccountTransactionsDataTable({
TableRowsRenderer={TableVirtualizedListRows}
TableHeaderSkeletonRenderer={TableSkeletonHeader}
// #TableVirtualizedListRows props.
- vListrowHeight={cashflowTansactionsTableSize == 'small' ? 40 : 42}
+ vListrowHeight={cashflowTansactionsTableSize == 'small' ? 32 : 40}
vListOverscanRowCount={0}
TableHeaderSkeletonRenderer={TableSkeletonHeader}
initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing}
size={cashflowTansactionsTableSize}
noResults={'There is deposit/withdrawal transactions on the current account.'}
-
className="table-constrant"
/>
);
diff --git a/src/containers/CashFlow/AccountTransactions/AccountTransactionsDetailsBar.js b/src/containers/CashFlow/AccountTransactions/AccountTransactionsDetailsBar.js
index f35454566..e72994af2 100644
--- a/src/containers/CashFlow/AccountTransactions/AccountTransactionsDetailsBar.js
+++ b/src/containers/CashFlow/AccountTransactions/AccountTransactionsDetailsBar.js
@@ -29,7 +29,7 @@ function AccountSwitchButton() {
function AccountSwitchItem() {
const { push } = useHistory();
- const { cashflowAccounts } = useAccountTransactionsContext();
+ const { cashflowAccounts, accountId } = useAccountTransactionsContext();
// Handle item click.
const handleItemClick = curry((account, event) => {
@@ -39,7 +39,9 @@ function AccountSwitchItem() {
const items = cashflowAccounts.map((account) => (
));
@@ -111,7 +113,7 @@ function AccountSwitchMenuItem({
}) {
return (