Skip to content

Commit

Permalink
feat: MET-2397 Navigate transaction overview epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
sotatek-huytran committed Nov 4, 2024
1 parent 6c70ad6 commit 71c6646
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/components/EpochDetail/EpochBlockList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ const EpochBlockList: React.FC<IEpochBlockList> = ({ epochId }) => {

const { error } = fetchData;

const onClickRow = (e: React.MouseEvent<Element, globalThis.MouseEvent>, r: Transactions) => {
if (e.target instanceof HTMLAnchorElement || (e.target instanceof Element && e.target.closest("a"))) {
e.preventDefault();
e.stopPropagation();
return;
}
history.push(details.block(r.blockNo || r.hash));
};

const columns: Column<BlockDetail>[] = [
{
title: <div data-testid="epochList.blockTitle">{t("glossary.block")}</div>,
Expand Down Expand Up @@ -138,7 +147,7 @@ const EpochBlockList: React.FC<IEpochBlockList> = ({ epochId }) => {
total: fetchData.total,
onChange: (page, size) => history.replace({ search: stringify({ page, size }) })
}}
onClickRow={(_, r) => history.push(details.block(r.blockNo || r.hash))}
onClickRow={onClickRow}
/>
</Card>
</StyledContainer>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TransactionLists/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const TransactionList: React.FC<TransactionListProps> = ({ underline = false, ur
const fetchData = useFetchList<Transactions>(url, { ...pageInfo }, false, blockKey);
const mainRef = useRef(document.querySelector("#main"));
const onClickRow = (e: MouseEvent<Element, globalThis.MouseEvent>, r: Transactions) => {
if (e.target instanceof HTMLAnchorElement) {
if (e.target instanceof HTMLAnchorElement || (e.target instanceof Element && e.target.closest("a"))) {
e.preventDefault();
e.stopPropagation();
return;
Expand Down

0 comments on commit 71c6646

Please sign in to comment.