feat: change arrow icon in send flow

This commit is contained in:
alter-eggo
2023-06-22 15:35:59 +04:00
committed by kyranjamie
parent be3204d7e7
commit 2b4a2a9b94
5 changed files with 11 additions and 49 deletions

View File

@@ -39,6 +39,8 @@ export function ModalHeader({
navigate(-1);
}
const hasCloseIcon = onClose || defaultClose;
return (
<Flex
alignItems={hideActions ? 'center' : 'flex-start'}
@@ -69,8 +71,8 @@ export function ModalHeader({
</Flex>
<Flex alignItems="center" flexBasis="20%" justifyContent="flex-end" position="relative">
<NetworkModeBadge position="absolute" right="35px" />
{(onClose || defaultClose) && (
<NetworkModeBadge position="absolute" right={hasCloseIcon ? '35px' : '15px'} />
{hasCloseIcon && (
<IconButton
onClick={onClose || defaultCloseAction}
alignSelf="center"

View File

@@ -45,10 +45,10 @@ function SendButtonSuspense() {
whenWallet({
ledger: () =>
whenPageMode({
full: () => navigate(RouteUrls.SendCryptoAsset),
full: () => navigate(RouteUrls.SendCryptoAsset, { state: { hasHeaderTitle: true } }),
popup: () => openIndexPageInNewTab(RouteUrls.SendCryptoAsset),
})(),
software: () => navigate(RouteUrls.SendCryptoAsset),
software: () => navigate(RouteUrls.SendCryptoAsset, { state: { hasHeaderTitle: true } }),
})()
}
isDisabled={isDisabled}

View File

@@ -1,24 +1,19 @@
import { useNavigate } from 'react-router-dom';
import { RouteUrls } from '@shared/route-urls';
import { useRouteHeader } from '@app/common/hooks/use-route-header';
import { useAllTransferableCryptoAssetBalances } from '@app/common/hooks/use-transferable-asset-balances.hooks';
import { useWalletType } from '@app/common/use-wallet-type';
import { Brc20TokensLoader } from '@app/components/brc20-tokens-loader';
import { Header } from '@app/components/header';
import { ModalHeader } from '@app/components/modal-header';
import { Brc20TokenAssetList } from '../../../components/crypto-assets/bitcoin/brc20-token-asset-list/brc20-token-asset-list';
import { ChooseCryptoAssetLayout } from './components/choose-crypto-asset.layout';
import { CryptoAssetList } from './components/crypto-asset-list';
export function ChooseCryptoAsset() {
const navigate = useNavigate();
const allTransferableCryptoAssetBalances = useAllTransferableCryptoAssetBalances();
const { whenWallet } = useWalletType();
useRouteHeader(<Header hideActions onClose={() => navigate(RouteUrls.Home)} title=" " />);
useRouteHeader(<ModalHeader hideActions defaultGoBack title=" " />);
return (
<ChooseCryptoAssetLayout>

View File

@@ -1,19 +1,14 @@
import { Outlet, useNavigate } from 'react-router-dom';
import { Outlet } from 'react-router-dom';
import { Flex } from '@stacks/ui';
import { useRouteHeader } from '@app/common/hooks/use-route-header';
import { whenPageMode } from '@app/common/utils';
import { CENTERED_FULL_PAGE_MAX_WIDTH } from '@app/components/global-styles/full-page-styles';
import { Header } from '@app/components/header';
import { ModalHeader } from '@app/components/modal-header';
export function SendContainer() {
const navigate = useNavigate();
useRouteHeader(
<Header hideActions onClose={() => navigate('..', { relative: 'path' })} title="Send" />,
true
);
useRouteHeader(<ModalHeader hideActions defaultGoBack title="Send" />, true);
return whenPageMode({
full: (

View File

@@ -1,30 +0,0 @@
import { Page } from '@playwright/test';
import { ProfileUpdatingSelectors } from '@tests-legacy/integration/profile/profile-updating.selector';
import { createTestSelector } from '../integration/utils';
const selectors = {
$updateProfileBtn: createTestSelector(ProfileUpdatingSelectors.BtnUpdateProfile),
};
export class ProfileUpdatingPage {
selectors = selectors;
page: Page;
constructor(page: Page) {
this.page = page;
}
async select(selector: keyof typeof selectors) {
return this.page.$(selectors[selector]);
}
async clickUpdateProfileButton() {
return this.page.click(selectors.$updateProfileBtn);
}
async waitForError(msg: string) {
return this.page.waitForSelector(`text=${msg}`);
}
}