From b655eac56290aae267e1414491723a46cb062c65 Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Fri, 29 Apr 2022 15:26:22 +0200 Subject: [PATCH] Fix: link back to Transactions from the tx details page (#3839) --- .../components/Transactions/TxList/index.tsx | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/src/routes/safe/components/Transactions/TxList/index.tsx b/src/routes/safe/components/Transactions/TxList/index.tsx index 1ed04c27f8..42314b7621 100644 --- a/src/routes/safe/components/Transactions/TxList/index.tsx +++ b/src/routes/safe/components/Transactions/TxList/index.tsx @@ -1,7 +1,8 @@ import { Menu, Breadcrumb, BreadcrumbElement, Tab } from '@gnosis.pm/safe-react-components' import { Item } from '@gnosis.pm/safe-react-components/dist/navigation/Tab' import { ReactElement } from 'react' -import { Redirect, Route, Switch, useHistory, useRouteMatch } from 'react-router-dom' +import { Redirect, Route, Switch, useHistory, useRouteMatch, Link } from 'react-router-dom' +import styled from 'styled-components' import Col from 'src/components/layout/Col' import { extractPrefixedSafeAddress, generateSafeRoute, SAFE_ROUTES } from 'src/routes/routes' @@ -16,9 +17,24 @@ const TRANSACTION_TABS: Item[] = [ { label: 'History', id: SAFE_ROUTES.TRANSACTIONS_HISTORY }, ] +const StyledLink = styled(Link)` + text-decoration: none; + & * { + cursor: pointer !important; + } +` + const GatewayTransactions = (): ReactElement => { const history = useHistory() const { path } = useRouteMatch() + const isTxDetails = isDeeplinkedTx() + + let breadcrumbText = 'History' + if (isTxDetails) { + breadcrumbText = 'Details' + } else if (path === SAFE_ROUTES.TRANSACTIONS_QUEUE) { + breadcrumbText = 'Queue' + } const onTabChange = (path: string) => history.replace(generateSafeRoute(path, extractPrefixedSafeAddress())) @@ -27,12 +43,22 @@ const GatewayTransactions = (): ReactElement => {
- {!isDeeplinkedTx() &&