diff --git a/.changeset/friendly-dolphins-invite.md b/.changeset/friendly-dolphins-invite.md new file mode 100644 index 0000000000..372b178c5d --- /dev/null +++ b/.changeset/friendly-dolphins-invite.md @@ -0,0 +1,5 @@ +--- +'minifront': patch +--- + +Use Sub-Account terminology diff --git a/apps/minifront/src/components/dashboard/assets-table/index.tsx b/apps/minifront/src/components/dashboard/assets-table/index.tsx index 76066f82da..df368e55ab 100644 --- a/apps/minifront/src/components/dashboard/assets-table/index.tsx +++ b/apps/minifront/src/components/dashboard/assets-table/index.tsx @@ -87,7 +87,7 @@ export default function AssetsTable() {

- Account #{account.account} + {account.account === 0 ? 'Main Account' : `Sub-Account ${account.account}`}

diff --git a/apps/minifront/src/components/shared/selectors/balance-item.tsx b/apps/minifront/src/components/shared/selectors/balance-item.tsx index f8a4e5f95a..6833152d05 100644 --- a/apps/minifront/src/components/shared/selectors/balance-item.tsx +++ b/apps/minifront/src/components/shared/selectors/balance-item.tsx @@ -43,7 +43,9 @@ export const BalanceItem = ({ asset, value, onSelect }: BalanceItemProps) => { isSelected && 'bg-light-brown', )} > - {account} + + {account !== undefined && (account === 0 ? 'Main' : account)} +
diff --git a/apps/minifront/src/components/shared/selectors/balance-selector.tsx b/apps/minifront/src/components/shared/selectors/balance-selector.tsx index 845d1618f6..abae16555d 100644 --- a/apps/minifront/src/components/shared/selectors/balance-selector.tsx +++ b/apps/minifront/src/components/shared/selectors/balance-selector.tsx @@ -117,7 +117,7 @@ export default function BalanceSelector({ - Account + Sub-Account Asset Balance diff --git a/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx b/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx index 4afbd4add5..9893c5cc89 100644 --- a/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx +++ b/apps/minifront/src/components/swap/swap-form/token-swap-input.tsx @@ -66,6 +66,7 @@ export const TokenSwapInput = () => { const maxAmount = getAmount.optional(assetIn); const maxAmountAsString = maxAmount ? joinLoHiAmount(maxAmount).toString() : undefined; + const assetInAccount = assetIn && getAddressIndex(assetIn.accountAddress).account; const setInputToBalanceMax = () => { if (assetIn?.balanceView) { @@ -93,7 +94,7 @@ export const TokenSwapInput = () => { {assetIn && (
- Account #{getAddressIndex(assetIn.accountAddress).account} + {assetInAccount === 0 ? 'Main Account' : `Sub-Account #${assetInAccount}`}
)} diff --git a/packages/ui-deprecated/components/ui/account-switcher/account-switcher.test.tsx b/packages/ui-deprecated/components/ui/account-switcher/account-switcher.test.tsx index b57c7323c2..5cd95eb46e 100644 --- a/packages/ui-deprecated/components/ui/account-switcher/account-switcher.test.tsx +++ b/packages/ui-deprecated/components/ui/account-switcher/account-switcher.test.tsx @@ -6,7 +6,7 @@ describe('', () => { it('renders the current account', () => { const { getByLabelText } = render(); - expect(getByLabelText('Account #123')).toHaveValue(123); + expect(getByLabelText('Sub-Account #123')).toHaveValue(123); }); describe('changing the account via the input field', () => { @@ -15,14 +15,14 @@ describe('', () => { const { getByLabelText } = render(); expect(onChange).not.toHaveBeenCalled(); - fireEvent.change(getByLabelText('Account #123'), { target: { value: 456 } }); + fireEvent.change(getByLabelText('Sub-Account #123'), { target: { value: 456 } }); expect(onChange).toHaveBeenCalledWith(456); }); it('has aria-disabled=false', () => { const { getByLabelText } = render(); - expect(getByLabelText('Account #123')).toHaveAttribute('aria-disabled', 'false'); + expect(getByLabelText('Sub-Account #123')).toHaveAttribute('aria-disabled', 'false'); }); describe('when a filter has been passed', () => { @@ -32,7 +32,7 @@ describe('', () => { , ); - fireEvent.change(getByLabelText('Account #123'), { target: { value: 456 } }); + fireEvent.change(getByLabelText('Sub-Account #123'), { target: { value: 456 } }); expect(onChange).not.toHaveBeenCalled(); }); @@ -41,7 +41,7 @@ describe('', () => { , ); - expect(getByLabelText('Account #123')).toHaveAttribute('aria-disabled', 'true'); + expect(getByLabelText('Sub-Account #123')).toHaveAttribute('aria-disabled', 'true'); }); }); }); @@ -52,14 +52,14 @@ describe('', () => { const { getByLabelText } = render(); expect(onChange).not.toHaveBeenCalled(); - fireEvent.click(getByLabelText('Previous account')); + fireEvent.click(getByLabelText('Previous sub-account')); expect(onChange).toHaveBeenCalledWith(122); }); it("is disabled when we're at account 0", () => { const { queryByLabelText } = render(); - expect(queryByLabelText('Previous account')?.parentElement).toBeDisabled(); + expect(queryByLabelText('Previous sub-account')?.parentElement).toBeDisabled(); }); describe('when a filter has been passed', () => { @@ -70,7 +70,7 @@ describe('', () => { ); expect(onChange).not.toHaveBeenCalled(); - fireEvent.click(getByLabelText('Previous account')); + fireEvent.click(getByLabelText('Previous sub-account')); expect(onChange).toHaveBeenCalledWith(100); }); @@ -79,7 +79,7 @@ describe('', () => { , ); - expect(queryByLabelText('Previous account')?.parentElement).toBeDisabled(); + expect(queryByLabelText('Previous sub-account')?.parentElement).toBeDisabled(); }); }); }); @@ -90,14 +90,14 @@ describe('', () => { const { getByLabelText } = render(); expect(onChange).not.toHaveBeenCalled(); - fireEvent.click(getByLabelText('Next account')); + fireEvent.click(getByLabelText('Next sub-account')); expect(onChange).toHaveBeenCalledWith(124); }); it("is disabled when we're at the maximum account index", () => { const { queryByLabelText } = render(); - expect(queryByLabelText('Next account')?.parentElement).toBeDisabled(); + expect(queryByLabelText('Next sub-account')?.parentElement).toBeDisabled(); }); describe('when a filter has been passed', () => { @@ -108,7 +108,7 @@ describe('', () => { ); expect(onChange).not.toHaveBeenCalled(); - fireEvent.click(getByLabelText('Next account')); + fireEvent.click(getByLabelText('Next sub-account')); expect(onChange).toHaveBeenCalledWith(123); }); @@ -117,7 +117,7 @@ describe('', () => { , ); - expect(queryByLabelText('Next account')?.parentElement).toBeDisabled(); + expect(queryByLabelText('Next sub-account')?.parentElement).toBeDisabled(); }); }); }); diff --git a/packages/ui-deprecated/components/ui/account-switcher/index.tsx b/packages/ui-deprecated/components/ui/account-switcher/index.tsx index 8bdc164eee..5d9b89c109 100644 --- a/packages/ui-deprecated/components/ui/account-switcher/index.tsx +++ b/packages/ui-deprecated/components/ui/account-switcher/index.tsx @@ -73,7 +73,7 @@ export const AccountSwitcher = ({ disabled={!previousButtonEnabled} >