diff --git a/.changelog/2293.trivial.md b/.changelog/2293.trivial.md new file mode 100644 index 0000000000..e061db8575 --- /dev/null +++ b/.changelog/2293.trivial.md @@ -0,0 +1 @@ +Update remaining MUI links and styled links to oasis library Link component. diff --git a/src/app/components/Account/ConsensusAccountDetailsView.tsx b/src/app/components/Account/ConsensusAccountDetailsView.tsx index c3971a73bd..9dbd944fa1 100644 --- a/src/app/components/Account/ConsensusAccountDetailsView.tsx +++ b/src/app/components/Account/ConsensusAccountDetailsView.tsx @@ -12,7 +12,7 @@ import { AccountSizeBadge } from '../AccountSizeBadge' import { ConsensusAccountLink } from './ConsensusAccountLink' import { CopyToClipboard } from '../CopyToClipboard' import { Link as RouterLink } from 'react-router-dom' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { RouteUtils } from '../../utils/route-utils' import { transactionsContainerId } from '../../utils/tabAnchors' import { RoundedBalance } from '../RoundedBalance' @@ -105,8 +105,8 @@ export const ConsensusAccountDetailsView: FC =
{t('common.transactions')}
{account.stats.num_txns ? ( - - {transactionsLabel} + + {transactionsLabel} ) : ( transactionsLabel diff --git a/src/app/components/Account/RuntimeAccountDetailsView.tsx b/src/app/components/Account/RuntimeAccountDetailsView.tsx index 2a23094ea5..9d1fa92d80 100644 --- a/src/app/components/Account/RuntimeAccountDetailsView.tsx +++ b/src/app/components/Account/RuntimeAccountDetailsView.tsx @@ -8,7 +8,7 @@ import { EvmToken, type RuntimeAccount } from '../../../oasis-nexus/api' import { TokenPills } from './TokenPills' import { AccountLink } from './AccountLink' import { RouteUtils } from '../../utils/route-utils' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { DashboardLink } from '../../pages/ParatimeDashboardPage/DashboardLink' import { AllTokenPrices } from '../../../coin-gecko/api' import { ContractCreatorInfo } from './ContractCreatorInfo' @@ -150,8 +150,8 @@ export const RuntimeAccountDetailsView: FC = ({
{t('common.transactions')}
{account.stats.num_txns ? ( - - {transactionsLabel} + + {transactionsLabel} ) : ( transactionsLabel diff --git a/src/app/components/AnalyticsConsent/AnalyticsIsBlocked.tsx b/src/app/components/AnalyticsConsent/AnalyticsIsBlocked.tsx index c8266bb6b1..8f77428c85 100644 --- a/src/app/components/AnalyticsConsent/AnalyticsIsBlocked.tsx +++ b/src/app/components/AnalyticsConsent/AnalyticsIsBlocked.tsx @@ -1,6 +1,6 @@ import { styled } from '@mui/material/styles' import Button from '@mui/material/Button' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { Trans, useTranslation } from 'react-i18next' import { AnalyticsDialogLayout } from './AnalyticsDialogLayout' @@ -20,11 +20,7 @@ export const AnalyticsIsBlocked = (props: { isOpen: boolean; onReload: () => voi t={t} components={{ PrivacyPolicyLink: ( - + ), }} /> diff --git a/src/app/components/CoinGeckoReferral/index.tsx b/src/app/components/CoinGeckoReferral/index.tsx index 05ee6e51c4..436f75ec10 100644 --- a/src/app/components/CoinGeckoReferral/index.tsx +++ b/src/app/components/CoinGeckoReferral/index.tsx @@ -1,15 +1,12 @@ import { FC } from 'react' import { Trans, useTranslation } from 'react-i18next' -import Typography from '@mui/material/Typography' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { referrals } from '../../utils/externalLinks' -import { COLORS } from '../../../styles/theme/colors' - export const CoinGeckoReferral: FC = () => { const { t } = useTranslation() return ( - + { href={referrals.coinGecko} rel="noopener noreferrer" target="_blank" - sx={{ fontWeight: 400, color: 'inherit', textDecoration: 'underline' }} + className="underline text-inherit" /> ), }} /> - + ) } diff --git a/src/app/components/ContractVerificationIcon/AbiPlaygroundLink.tsx b/src/app/components/ContractVerificationIcon/AbiPlaygroundLink.tsx index 5092f83f1e..3f675e6db7 100644 --- a/src/app/components/ContractVerificationIcon/AbiPlaygroundLink.tsx +++ b/src/app/components/ContractVerificationIcon/AbiPlaygroundLink.tsx @@ -1,6 +1,6 @@ import { FC } from 'react' import { Trans, useTranslation } from 'react-i18next' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { Layer } from '../../../oasis-nexus/api' import { SearchScope } from '../../../types/searchScope' import { Network } from '../../../types/network' @@ -42,7 +42,7 @@ export const AbiPlaygroundLink: FC<{ t={t} i18nKey={'contract.verification.openInAbiPlayground'} components={{ - AbiPlaygroundLink: , + AbiPlaygroundLink: , }} /> diff --git a/src/app/components/ContractVerificationIcon/index.tsx b/src/app/components/ContractVerificationIcon/index.tsx index 838d4f0ee6..96e4db3b7c 100644 --- a/src/app/components/ContractVerificationIcon/index.tsx +++ b/src/app/components/ContractVerificationIcon/index.tsx @@ -1,8 +1,6 @@ import { FC, useState } from 'react' import { Trans, useTranslation } from 'react-i18next' -import { COLORS } from '../../../styles/theme/colors' -import Link from '@mui/material/Link' -import Typography from '@mui/material/Typography' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { SearchScope } from '../../../types/searchScope' import * as externalLinks from '../../utils/externalLinks' import { isLocalnet } from '../../utils/route-utils' @@ -45,29 +43,29 @@ export const VerificationIcon: FC<{ {!hideLink && (verificationLevel ? ( - +     , + SourcifyLink: , }} /> - + ) : ( - +     , + SourcifyLink: , }} />{' '} {explainDelay && t('contract.verification.explainVerificationDelay')} - + ))} ) diff --git a/src/app/components/LoadMoreButton/index.tsx b/src/app/components/LoadMoreButton/index.tsx index a4f4093888..e41dd887e9 100644 --- a/src/app/components/LoadMoreButton/index.tsx +++ b/src/app/components/LoadMoreButton/index.tsx @@ -1,5 +1,5 @@ import { Link as RouterLink } from 'react-router-dom' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { styled } from '@mui/material/styles' import Button from '@mui/material/Button' import { COLORS } from '../../../styles/theme/colors' @@ -20,14 +20,12 @@ export const LoadMoreButton: FC = ({ isLoading, pagination const { t } = useTranslation() return ( - - - {t('common.loadMore')} - + + + + {t('common.loadMore')} + + ) } diff --git a/src/app/components/Proposals/ProposalLink.tsx b/src/app/components/Proposals/ProposalLink.tsx index dfab0826c2..f29f7b04b1 100644 --- a/src/app/components/Proposals/ProposalLink.tsx +++ b/src/app/components/Proposals/ProposalLink.tsx @@ -1,6 +1,6 @@ import { FC } from 'react' import { Link as RouterLink } from 'react-router-dom' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { RouteUtils } from '../../utils/route-utils' import { Network } from '../../../types/network' @@ -11,8 +11,8 @@ export const ProposalLink: FC<{ }> = ({ network, proposalId, label = proposalId }) => { const to = RouteUtils.getProposalRoute(network, proposalId) return ( - - {label} + + {label} ) } diff --git a/src/app/components/Table/GoToFirstPageLink.tsx b/src/app/components/Table/GoToFirstPageLink.tsx index 32c53c67df..cd8d74f26b 100644 --- a/src/app/components/Table/GoToFirstPageLink.tsx +++ b/src/app/components/Table/GoToFirstPageLink.tsx @@ -1,7 +1,7 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' import { useSearchParams, useHref } from 'react-router-dom' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' /** * Link to attempt to jump to the first page (in pagination) @@ -37,7 +37,7 @@ export const GoToFirstPageLink: FC = () => { // Apparently the solution is to umount and rerender the component outside the error boundary. // But that's hard to do selectively, so it's easier to just do a full refresh. return wantedParamName ? ( - + {label} ) : ( diff --git a/src/app/components/Tokens/TokenLink.tsx b/src/app/components/Tokens/TokenLink.tsx index 903dd5cf7f..c7a29128ee 100644 --- a/src/app/components/Tokens/TokenLink.tsx +++ b/src/app/components/Tokens/TokenLink.tsx @@ -1,6 +1,6 @@ import { FC } from 'react' import { Link as RouterLink } from 'react-router-dom' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { RouteUtils } from '../../utils/route-utils' import { SearchScope } from '../../../types/searchScope' @@ -12,8 +12,10 @@ export const TokenLink: FC<{ name: string | undefined }> = ({ scope, address, name }) => { return ( - - {name ? : address} + + + {name ? : address} + ) } diff --git a/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx b/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx index 299078b58d..17a662e6cb 100644 --- a/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx +++ b/src/app/pages/ConsensusAccountDetailsPage/Staking.tsx @@ -1,7 +1,7 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' import { Card, CardContent } from '@oasisprotocol/ui-library/src/components/cards' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { Skeleton } from '@oasisprotocol/ui-library/src/components/ui/skeleton' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@oasisprotocol/ui-library/src/components/tabs' import { @@ -74,7 +74,7 @@ const ActiveDelegations: FC = ({ address }) => { if (isFetched && !delegationsQuery.data?.data.delegations.length) { return ( - + {t('account.startStaking')} diff --git a/src/app/pages/NFTInstanceDashboardPage/InstanceImageCard.tsx b/src/app/pages/NFTInstanceDashboardPage/InstanceImageCard.tsx index 8ccffa0392..5e8f37823e 100644 --- a/src/app/pages/NFTInstanceDashboardPage/InstanceImageCard.tsx +++ b/src/app/pages/NFTInstanceDashboardPage/InstanceImageCard.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { Button } from '@mui/base/Button' import { Card, CardContent } from '@oasisprotocol/ui-library/src/components/cards' import ContrastIcon from '@mui/icons-material/Contrast' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { Skeleton } from '@oasisprotocol/ui-library/src/components/ui/skeleton' import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip' import OpenInFullIcon from '@mui/icons-material/OpenInFull' diff --git a/src/app/pages/RoflAppDetailsPage/MetaDataCard.tsx b/src/app/pages/RoflAppDetailsPage/MetaDataCard.tsx index 0a87c4540c..8262b74d27 100644 --- a/src/app/pages/RoflAppDetailsPage/MetaDataCard.tsx +++ b/src/app/pages/RoflAppDetailsPage/MetaDataCard.tsx @@ -1,8 +1,7 @@ import { FC } from 'react' import { Trans, useTranslation } from 'react-i18next' -import { styled } from '@mui/material/styles' import { Card, CardContent, CardHeader, CardTitle } from '@oasisprotocol/ui-library/src/components/cards' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import OpenInNewIcon from '@mui/icons-material/OpenInNew' import { RoflAppMetadata } from '../../../oasis-nexus/api' import { EmptyStateCard } from './EmptyStateCard' @@ -13,13 +12,6 @@ import { XProfileWidget } from '../../components/XProfileWidget' import { DiscordProfileWidget } from '../../components/DiscordProfileWidget' import { Typography } from '@oasisprotocol/ui-library/src/components/typography' -export const StyledLink = styled(Link)(() => ({ - display: 'inline-flex', - alignItems: 'center', - wordBreak: 'break-all', - gap: 5, -})) - type MetaDataCardProps = { isFetched: boolean metadata: RoflAppMetadata | undefined @@ -64,9 +56,14 @@ export const MetaDataCard: FC = ({ isFetched, metadata }) => {!homepage ? undefined : ( <> {isUrlSafe(homepage) && ( - + {homepage} - + )} {isTwitterHandle(homepage) && } {isDiscordHandle(homepage) && } @@ -87,13 +84,14 @@ export const MetaDataCard: FC = ({ isFetched, metadata }) => } > {isUrlSafe(metadata['net.oasis.rofl.repository']) ? ( - {metadata['net.oasis.rofl.repository']} - + ) : undefined} diff --git a/src/app/pages/RuntimeAccountDetailsPage/AccountNFTCollectionCard.tsx b/src/app/pages/RuntimeAccountDetailsPage/AccountNFTCollectionCard.tsx index 54133ae845..203d9f5bef 100644 --- a/src/app/pages/RuntimeAccountDetailsPage/AccountNFTCollectionCard.tsx +++ b/src/app/pages/RuntimeAccountDetailsPage/AccountNFTCollectionCard.tsx @@ -2,7 +2,7 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' import { useLoaderData, Link as RouterLink, To } from 'react-router-dom' import { Card, CardContent } from '@oasisprotocol/ui-library/src/components/cards' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { Typography } from '@oasisprotocol/ui-library/src/components/typography' import { Skeleton } from '@oasisprotocol/ui-library/src/components/ui/skeleton' import { ErrorBoundary } from '../../components/ErrorBoundary' @@ -45,13 +45,13 @@ export const AccountNFTCollectionCard: FC = ({ sco - - {t('nft.accountCollection')} + + + {t('nft.accountCollection')} + diff --git a/src/app/pages/RuntimeAccountDetailsPage/AccountTokensCard.tsx b/src/app/pages/RuntimeAccountDetailsPage/AccountTokensCard.tsx index fb0b95dc0c..b0df95fe4e 100644 --- a/src/app/pages/RuntimeAccountDetailsPage/AccountTokensCard.tsx +++ b/src/app/pages/RuntimeAccountDetailsPage/AccountTokensCard.tsx @@ -1,7 +1,7 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' import { useLocation, Link as RouterLink } from 'react-router-dom' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { CardEmptyState } from '../../components/CardEmptyState' import { Table, TableCellAlign, TableColProps } from '../../components/Table' import { CopyToClipboard } from '../../components/CopyToClipboard' @@ -98,8 +98,10 @@ export const AccountTokensCard: FC = ({ scope, account, align: TableCellAlign.Right, key: 'link', content: ( - - {t('common.viewAll')} + + + {t('common.viewAll')} + ), }, diff --git a/src/app/pages/RuntimeBlockDetailPage/index.tsx b/src/app/pages/RuntimeBlockDetailPage/index.tsx index 9f60936fbd..2d8ed5cd46 100644 --- a/src/app/pages/RuntimeBlockDetailPage/index.tsx +++ b/src/app/pages/RuntimeBlockDetailPage/index.tsx @@ -1,7 +1,7 @@ import { FC } from 'react' import { useTranslation } from 'react-i18next' import { useHref, useOutletContext, useParams } from 'react-router-dom' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { RuntimeBlock, useGetRuntimeBlockByHeight } from '../../../oasis-nexus/api' import { RouterTabs } from '../../components/RouterTabs' import { StyledDescriptionList } from '../../components/StyledDescriptionList' @@ -155,7 +155,9 @@ export const RuntimeBlockDetailView: FC<{
{t('common.transactions')}
{block.num_transactions ? ( - {transactionLabel} + + {transactionLabel} + ) : ( transactionLabel )} diff --git a/src/app/pages/RuntimeTransactionDetailPage/index.tsx b/src/app/pages/RuntimeTransactionDetailPage/index.tsx index 0848a0df20..d78283ec61 100644 --- a/src/app/pages/RuntimeTransactionDetailPage/index.tsx +++ b/src/app/pages/RuntimeTransactionDetailPage/index.tsx @@ -38,7 +38,7 @@ import { TokenTypeTag } from 'app/components/Tokens/TokenList' import { LinkableDiv } from 'app/components/PageLayout/LinkableDiv' import { EventBalance } from 'app/components/Tokens/TokenTransfers' import { transactionEventsContainerId } from '../../utils/tabAnchors' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { Link as RouterLink } from 'react-router-dom' import { RouteUtils } from '../../utils/route-utils' import { Tooltip } from '@oasisprotocol/ui-library/src/components/tooltip' @@ -282,12 +282,12 @@ export const RuntimeTransactionDetailView: FC<{ ) })} {(totalTransfers ?? 0) > transfers.length && ( - - {t('common.seeMore')} + + + {t('common.seeMore')} + )} @@ -343,14 +343,16 @@ export const RuntimeTransactionDetailView: FC<{ {transaction.fee_proxy_module === 'rofl' ? ( - - {oasis.address.toBech32('rofl', Buffer.from(transaction.fee_proxy_id, 'base64'))} + + + {oasis.address.toBech32('rofl', Buffer.from(transaction.fee_proxy_id, 'base64'))} + diff --git a/src/app/pages/TokenDashboardPage/ImageListItemImage.tsx b/src/app/pages/TokenDashboardPage/ImageListItemImage.tsx index d20adf91be..af152e94aa 100644 --- a/src/app/pages/TokenDashboardPage/ImageListItemImage.tsx +++ b/src/app/pages/TokenDashboardPage/ImageListItemImage.tsx @@ -1,7 +1,7 @@ import { FC, useState } from 'react' import { useTranslation } from 'react-i18next' import { Link as RouterLink } from 'react-router-dom' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import OpenInBrowserIcon from '@mui/icons-material/OpenInBrowser' import { styled } from '@mui/material/styles' import { processNftImageUrl } from 'app/utils/nft-images' @@ -40,22 +40,24 @@ export const ImageListItemImage: FC = ({ instance, to } const [imageLoadError, setImageLoadError] = useState(false) return ( - - {isUrlSafe(instance.image) && !imageLoadError ? ( - setImageLoadError(true)} - src={processNftImageUrl(instance.image)} - alt={getNftInstanceLabel(instance)} - loading="lazy" - isMobile={isMobile} - /> - ) : ( - - )} -
- - {t('common.view')} -
+ + + {isUrlSafe(instance.image) && !imageLoadError ? ( + setImageLoadError(true)} + src={processNftImageUrl(instance.image)} + alt={getNftInstanceLabel(instance)} + loading="lazy" + isMobile={isMobile} + /> + ) : ( + + )} +
+ + {t('common.view')} +
+
) } diff --git a/src/app/pages/TokenDashboardPage/TokenDetailsCard.tsx b/src/app/pages/TokenDashboardPage/TokenDetailsCard.tsx index c3e4cd347f..c12371d92b 100644 --- a/src/app/pages/TokenDashboardPage/TokenDetailsCard.tsx +++ b/src/app/pages/TokenDashboardPage/TokenDetailsCard.tsx @@ -1,7 +1,7 @@ import { FC } from 'react' import { Link as RouterLink } from 'react-router-dom' import { Card, CardContent } from '@oasisprotocol/ui-library/src/components/cards' -import Link from '@mui/material/Link' +import { Link } from '@oasisprotocol/ui-library/src/components/link' import { useTokenInfo } from './hook' import { useAccount } from '../RuntimeAccountDetailsPage/hook' import { TextSkeleton } from '../../components/Skeleton' @@ -122,14 +122,15 @@ export const TokenDetailsCard: FC<{ <>
{t('tokens.holders')}
- - {t('tokens.holdersValue', { value: token.num_holders })} + + + {t('tokens.holdersValue', { value: token.num_holders })} +
@@ -139,14 +140,15 @@ export const TokenDetailsCard: FC<{ <>
{t('common.transfers')}
- - {token.num_transfers.toLocaleString()} + + + {token.num_transfers.toLocaleString()} +