Skip to content

Commit

Permalink
wallet-ext: remove useMiddleEllipsis usages
Browse files Browse the repository at this point in the history
  • Loading branch information
pchrysochoidis committed Feb 24, 2023
1 parent c14d9c4 commit 9b86bc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 2 additions & 3 deletions apps/wallet/src/ui/app/components/WalletListSelectItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0

import { CheckFill16 } from '@mysten/icons';
import { formatAddress } from '@mysten/sui.js';
import { cx } from 'class-variance-authority';

import { useMiddleEllipsis } from '../hooks';
import { Text } from '../shared/text';

export type WalletListSelectItemProps = {
Expand All @@ -16,7 +16,6 @@ export function WalletListSelectItem({
address,
selected,
}: WalletListSelectItemProps) {
const addressShort = useMiddleEllipsis(address);
return (
<div
className={cx(
Expand All @@ -32,7 +31,7 @@ export function WalletListSelectItem({
)}
/>
<Text mono variant="body" weight="semibold">
{addressShort}
{formatAddress(address)}
</Text>
</div>
);
Expand Down
9 changes: 5 additions & 4 deletions apps/wallet/src/ui/app/pages/site-connect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { useFeature } from '@growthbook/growthbook-react';
import { CheckFill12 } from '@mysten/icons';
import { type SuiAddress } from '@mysten/sui.js';
import { formatAddress, type SuiAddress } from '@mysten/sui.js';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { useParams } from 'react-router-dom';

Expand All @@ -12,7 +12,7 @@ import { WalletListSelect } from '../../components/WalletListSelect';
import { Text } from '../../shared/text';
import Loading from '_components/loading';
import UserApproveContainer from '_components/user-approve-container';
import { useAppDispatch, useAppSelector, useMiddleEllipsis } from '_hooks';
import { useAppDispatch, useAppSelector } from '_hooks';
import {
permissionsSelectors,
respondToPermissionRequest,
Expand Down Expand Up @@ -45,7 +45,6 @@ function SiteConnectPage() {
const dispatch = useAppDispatch();
const permissionRequest = useAppSelector(permissionSelector);
const activeAccount = useAppSelector(({ account }) => account.address);
const activeAccountShort = useMiddleEllipsis(activeAccount);
const isMultiAccountEnabled = useFeature(FEATURES.WALLET_MULTI_ACCOUNTS).on;
const [accountsToConnect, setAccountsToConnect] = useState<SuiAddress[]>(
() => (activeAccount ? [activeAccount] : [])
Expand Down Expand Up @@ -176,7 +175,9 @@ function SiteConnectPage() {
variant="body"
weight="semibold"
>
{activeAccountShort}
{activeAccount
? formatAddress(activeAccount)
: null}
</Text>
}
/>
Expand Down

0 comments on commit 9b86bc8

Please sign in to comment.