diff --git a/.changelog/1329.bugfix.md b/.changelog/1329.bugfix.md new file mode 100644 index 000000000..e9e75b7fd --- /dev/null +++ b/.changelog/1329.bugfix.md @@ -0,0 +1 @@ +Fix oasis address links even when toggled to ETH addresses diff --git a/src/app/components/Account/AccountLink.tsx b/src/app/components/Account/AccountLink.tsx index b204aa377..5ae1e50ea 100644 --- a/src/app/components/Account/AccountLink.tsx +++ b/src/app/components/Account/AccountLink.tsx @@ -5,31 +5,19 @@ import Link from '@mui/material/Link' import { TrimLinkLabel } from '../TrimLinkLabel' import { RouteUtils } from '../../utils/route-utils' import Typography from '@mui/material/Typography' -import { COLORS } from '../../../styles/theme/colors' import { SearchScope } from '../../../types/searchScope' export const AccountLink: FC<{ scope: SearchScope address: string alwaysTrim?: boolean - plain?: boolean -}> = ({ scope, address, alwaysTrim, plain }) => { +}> = ({ scope, address, alwaysTrim }) => { const { isTablet } = useScreenSize() const to = RouteUtils.getAccountRoute(scope, address) return ( - + {alwaysTrim || isTablet ? ( - ) : plain ? ( - address ) : ( {address} diff --git a/src/app/components/RuntimeEvents/RuntimeEventDetails.tsx b/src/app/components/RuntimeEvents/RuntimeEventDetails.tsx index 20fab3991..d86e1b967 100644 --- a/src/app/components/RuntimeEvents/RuntimeEventDetails.tsx +++ b/src/app/components/RuntimeEvents/RuntimeEventDetails.tsx @@ -218,11 +218,7 @@ export const RuntimeEventDetails: FC<{
{t('runtimeEvent.fields.owner')}
- + {addressSwitchOption === AddressSwitchOption.Oasis && ( )} @@ -247,22 +243,14 @@ export const RuntimeEventDetails: FC<{
{t('common.from')}
- + {addressSwitchOption === AddressSwitchOption.Oasis && ( )}
{t('common.to')}
- + {addressSwitchOption === AddressSwitchOption.Oasis && }
{t('runtimeEvent.fields.amount')}
@@ -283,22 +271,14 @@ export const RuntimeEventDetails: FC<{
{t('common.from')}
- + {addressSwitchOption === AddressSwitchOption.Oasis && ( )}
{t('common.to')}
- + {addressSwitchOption === AddressSwitchOption.Oasis && }
{t('runtimeEvent.fields.amount')}
@@ -319,22 +299,14 @@ export const RuntimeEventDetails: FC<{
{t('common.from')}
- + {addressSwitchOption === AddressSwitchOption.Oasis && ( )}
{t('common.to')}
- + {addressSwitchOption === AddressSwitchOption.Oasis && }
{t('runtimeEvent.fields.activeShares')}
@@ -354,22 +326,14 @@ export const RuntimeEventDetails: FC<{
{t('common.from')}
- + {addressSwitchOption === AddressSwitchOption.Oasis && ( )}
{t('common.to')}
- + {addressSwitchOption === AddressSwitchOption.Oasis && }
{t('runtimeEvent.fields.amount')}
diff --git a/src/app/components/Transactions/TransactionLink.tsx b/src/app/components/Transactions/TransactionLink.tsx index afcd30e8f..1afcc359e 100644 --- a/src/app/components/Transactions/TransactionLink.tsx +++ b/src/app/components/Transactions/TransactionLink.tsx @@ -6,23 +6,19 @@ import { useScreenSize } from '../../hooks/useScreensize' import { TrimLinkLabel } from '../TrimLinkLabel' import { RouteUtils } from '../../utils/route-utils' import { SearchScope } from '../../../types/searchScope' -import { COLORS } from '../../../styles/theme/colors' export const TransactionLink: FC<{ alwaysTrim?: boolean scope: SearchScope hash: string - plain?: boolean -}> = ({ alwaysTrim, hash, scope, plain }) => { +}> = ({ alwaysTrim, hash, scope }) => { const { isMobile } = useScreenSize() const to = RouteUtils.getTransactionRoute(scope, hash) return ( - + {alwaysTrim || isMobile ? ( - - ) : plain ? ( - hash + ) : ( {hash} diff --git a/src/app/components/TrimLinkLabel/index.tsx b/src/app/components/TrimLinkLabel/index.tsx index 8aefd713b..9a73f2742 100644 --- a/src/app/components/TrimLinkLabel/index.tsx +++ b/src/app/components/TrimLinkLabel/index.tsx @@ -8,43 +8,38 @@ import { tooltipDelay } from '../../../styles/theme' type TrimLinkLabelProps = { label: string to: string - plain?: boolean } -export const TrimLinkLabel: FC = ({ label, to, plain }) => { +export const TrimLinkLabel: FC = ({ label, to }) => { const trimmedLabel = trimLongString(label) if (!trimmedLabel) { return null } - return + return } type TrimEndLinkLabelProps = TrimLinkLabelProps & { trimStart: number } -export const TrimEndLinkLabel: FC = ({ label, to, plain, trimStart }) => { +export const TrimEndLinkLabel: FC = ({ label, to, trimStart }) => { const trimmedLabel = trimLongString(label, trimStart, 0) if (!trimmedLabel) { return null } - return + return } type TrimLinkProps = TrimLinkLabelProps & { trimmedLabel: string } -const TrimLink: FC = ({ label, to, trimmedLabel, plain }) => { +const TrimLink: FC = ({ label, to, trimmedLabel }) => { return ( - {plain ? ( - <>{trimmedLabel} - ) : ( - - {trimmedLabel} - - )} + + {trimmedLabel} + ) } diff --git a/src/app/pages/RuntimeTransactionDetailPage/index.tsx b/src/app/pages/RuntimeTransactionDetailPage/index.tsx index 7a7956ba6..7d49cddd9 100644 --- a/src/app/pages/RuntimeTransactionDetailPage/index.tsx +++ b/src/app/pages/RuntimeTransactionDetailPage/index.tsx @@ -228,7 +228,6 @@ export const RuntimeTransactionDetailView: FC<{ hash={ hash || ((isOasisAddressFormat ? transaction?.eth_hash : transaction?.hash) as string) } - plain={!hash} /> {hash && } @@ -286,7 +285,6 @@ export const RuntimeTransactionDetailView: FC<{ from || ((isOasisAddressFormat ? transaction?.sender_0_eth : transaction?.sender_0) as string) } - plain={!from} /> {from && } @@ -310,7 +308,6 @@ export const RuntimeTransactionDetailView: FC<{ {to && }