mirror of
https://github.com/zhigang1992/wallet.git
synced 2026-01-12 22:53:27 +08:00
fix: refactor JSX namespace to React.JSX
This commit is contained in:
@@ -3,7 +3,7 @@ import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { useRouteHeaderState } from '@app/store/ui/ui.hooks';
|
||||
|
||||
export function useRouteHeader(header: JSX.Element, isParentRoute?: boolean) {
|
||||
export function useRouteHeader(header: React.JSX.Element, isParentRoute?: boolean) {
|
||||
const location = useLocation();
|
||||
const [_, setRouteHeader] = useRouteHeaderState();
|
||||
useEffect(() => {
|
||||
|
||||
@@ -44,7 +44,7 @@ function setUserSelectedTheme(theme: UserSelectedTheme) {
|
||||
}
|
||||
|
||||
interface ThemeSwitcherProviderProps {
|
||||
children: JSX.Element | JSX.Element[];
|
||||
children: React.JSX.Element | React.JSX.Element[];
|
||||
}
|
||||
export function ThemeSwitcherProvider({ children }: ThemeSwitcherProviderProps) {
|
||||
const userSelectedTheme = useUserSelectedTheme();
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
} from '@app/query/bitcoin/ordinals/brc20/brc20-tokens.query';
|
||||
|
||||
interface Brc20TokensLoaderProps {
|
||||
children(brc20Tokens: Brc20Token[]): JSX.Element;
|
||||
children(brc20Tokens: Brc20Token[]): React.JSX.Element;
|
||||
}
|
||||
export function Brc20TokensLoader({ children }: Brc20TokensLoaderProps) {
|
||||
const { data: allBrc20TokensResponse } = useBrc20TokensQuery();
|
||||
|
||||
@@ -17,8 +17,8 @@ import { Caption, Text } from '@app/components/typography';
|
||||
interface CryptoCurrencyAssetItemLayoutProps extends StackProps {
|
||||
balance: Money;
|
||||
caption: string;
|
||||
icon: JSX.Element;
|
||||
copyIcon?: JSX.Element;
|
||||
icon: React.JSX.Element;
|
||||
copyIcon?: React.JSX.Element;
|
||||
isPressable?: boolean;
|
||||
title: string;
|
||||
usdBalance?: string;
|
||||
@@ -26,8 +26,8 @@ interface CryptoCurrencyAssetItemLayoutProps extends StackProps {
|
||||
canCopy?: boolean;
|
||||
isHovered?: boolean;
|
||||
currency?: CryptoCurrencies;
|
||||
additionalBalanceInfo?: JSX.Element;
|
||||
additionalUsdBalanceInfo?: JSX.Element;
|
||||
additionalBalanceInfo?: React.JSX.Element;
|
||||
additionalUsdBalanceInfo?: React.JSX.Element;
|
||||
}
|
||||
export const CryptoCurrencyAssetItemLayout = forwardRefWithAs(
|
||||
(props: CryptoCurrencyAssetItemLayoutProps, ref) => {
|
||||
|
||||
@@ -13,13 +13,13 @@ import { CryptoCurrencyAssetItemLayout } from './crypto-currency-asset-item.layo
|
||||
|
||||
interface CryptoCurrencyAssetItemProps extends StackProps {
|
||||
assetBalance: AllCryptoCurrencyAssetBalances;
|
||||
icon: JSX.Element;
|
||||
icon: React.JSX.Element;
|
||||
usdBalance?: string;
|
||||
address?: string;
|
||||
isPressable?: boolean;
|
||||
canCopy?: boolean;
|
||||
additionalBalanceInfo?: JSX.Element;
|
||||
additionalUsdBalanceInfo?: JSX.Element;
|
||||
additionalBalanceInfo?: React.JSX.Element;
|
||||
additionalUsdBalanceInfo?: React.JSX.Element;
|
||||
}
|
||||
export const CryptoCurrencyAssetItem = forwardRefWithAs(
|
||||
(props: CryptoCurrencyAssetItemProps, ref) => {
|
||||
|
||||
@@ -32,7 +32,7 @@ function useDrawer(isShowing: boolean, onClose: () => void, pause?: boolean) {
|
||||
interface BaseDrawerProps extends Omit<FlexProps, 'title'> {
|
||||
children?: ReactNode;
|
||||
enableGoBack?: boolean;
|
||||
icon?: JSX.Element;
|
||||
icon?: React.JSX.Element;
|
||||
isShowing: boolean;
|
||||
isWaitingOnPerformedAction?: boolean;
|
||||
onClose?(): void;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { HeaderActionButton } from './header-action-button';
|
||||
|
||||
interface DrawerHeaderProps {
|
||||
enableGoBack?: boolean;
|
||||
icon?: JSX.Element;
|
||||
icon?: React.JSX.Element;
|
||||
isWaitingOnPerformedAction?: boolean;
|
||||
onClose?(): void;
|
||||
onGoBack(): void;
|
||||
|
||||
@@ -10,7 +10,7 @@ interface IconBaseProps extends SVGAttributes<SVGElement> {
|
||||
color?: string;
|
||||
title?: string;
|
||||
}
|
||||
type IconType = (props: IconBaseProps) => JSX.Element;
|
||||
type IconType = (props: IconBaseProps) => React.JSX.Element;
|
||||
|
||||
interface HeaderActionButtonProps {
|
||||
icon?: IconType;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { BaseDrawer } from './base-drawer';
|
||||
interface ControlledDrawerProps {
|
||||
children?: ReactNode;
|
||||
enableGoBack?: boolean;
|
||||
icon?: JSX.Element;
|
||||
icon?: React.JSX.Element;
|
||||
isShowing: boolean;
|
||||
onClose(): void;
|
||||
pauseOnClickOutside?: boolean;
|
||||
|
||||
@@ -18,7 +18,7 @@ interface EventCardProps {
|
||||
ticker: string;
|
||||
title: string;
|
||||
}
|
||||
export function EventCard(props: EventCardProps): JSX.Element {
|
||||
export function EventCard(props: EventCardProps): React.JSX.Element {
|
||||
const { actions, amount, icon, isLast, left, message, right, ticker, title } = props;
|
||||
|
||||
return (
|
||||
|
||||
@@ -7,10 +7,10 @@ import { Caption } from '@app/components/typography';
|
||||
import { WarningLabel } from '@app/components/warning-label';
|
||||
|
||||
interface FeesRowLayoutProps extends StackProps {
|
||||
feeField: JSX.Element;
|
||||
feeField: React.JSX.Element;
|
||||
fieldWarning?: string;
|
||||
isSponsored: boolean;
|
||||
selectInput: JSX.Element;
|
||||
selectInput: React.JSX.Element;
|
||||
}
|
||||
export function FeesRowLayout(props: FeesRowLayoutProps) {
|
||||
const { feeField, fieldWarning, isSponsored, selectInput, ...rest } = props;
|
||||
|
||||
@@ -23,7 +23,7 @@ interface FeeRowProps extends StackProps {
|
||||
allowCustom?: boolean;
|
||||
isSponsored: boolean;
|
||||
}
|
||||
export function FeesRow(props: FeeRowProps): JSX.Element {
|
||||
export function FeesRow(props: FeeRowProps): React.JSX.Element {
|
||||
const { fees, isSponsored, allowCustom = true, ...rest } = props;
|
||||
const [feeField, _, feeHelper] = useField('fee');
|
||||
const [feeCurrencyField] = useField('feeCurrency');
|
||||
|
||||
@@ -16,7 +16,7 @@ import { NetworkModeBadge } from '@app/components/network-mode-badge';
|
||||
import { Title } from '@app/components/typography';
|
||||
|
||||
interface HeaderProps extends FlexProps {
|
||||
actionButton?: JSX.Element;
|
||||
actionButton?: React.JSX.Element;
|
||||
hideActions?: boolean;
|
||||
onClose?(): void;
|
||||
title?: string;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Text } from '@app/components/typography';
|
||||
interface InscriptionMetadataProps {
|
||||
action?(): void;
|
||||
actionLabel?: string;
|
||||
icon?: JSX.Element;
|
||||
icon?: React.JSX.Element;
|
||||
subtitle: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ interface InscriptionPreviewCardProps {
|
||||
action?(): void;
|
||||
actionLabel?: string;
|
||||
hideBorder?: boolean;
|
||||
icon?: JSX.Element;
|
||||
image: JSX.Element;
|
||||
icon?: React.JSX.Element;
|
||||
image: React.JSX.Element;
|
||||
subtitle: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ function ItemHover({
|
||||
|
||||
export function usePressable(
|
||||
isPressable?: boolean
|
||||
): [JSX.Element | null, any, { isHovered: boolean; isFocused: boolean }] {
|
||||
): [React.JSX.Element | null, any, { isHovered: boolean; isFocused: boolean }] {
|
||||
const [isHovered, bind] = useHover();
|
||||
const [isFocused, focusBind] = useFocus();
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ interface FlagProps extends FlexProps {
|
||||
spacing?: Spacing;
|
||||
align?: 'top' | 'middle' | 'bottom';
|
||||
children: React.ReactNode;
|
||||
img: JSX.Element;
|
||||
img: React.JSX.Element;
|
||||
}
|
||||
/**
|
||||
* Implementation of flag object
|
||||
|
||||
@@ -10,7 +10,7 @@ export const buildEnterKeyEvent = (onClick: () => void) => {
|
||||
};
|
||||
};
|
||||
|
||||
export function Link(props: BoxProps): JSX.Element {
|
||||
export function Link(props: BoxProps): React.JSX.Element {
|
||||
const { _hover = {}, children, fontSize = '12px', onClick, ...rest } = props;
|
||||
return (
|
||||
<Text
|
||||
|
||||
@@ -9,7 +9,7 @@ import { NetworkModeBadge } from '@app/components/network-mode-badge';
|
||||
import { Title } from '@app/components/typography';
|
||||
|
||||
interface ModalHeaderProps extends FlexProps {
|
||||
actionButton?: JSX.Element;
|
||||
actionButton?: React.JSX.Element;
|
||||
closeIcon?: boolean;
|
||||
hideActions?: boolean;
|
||||
onClose?(): void;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Caption } from '../typography';
|
||||
|
||||
interface ReceiveCollectibleItemProps extends ButtonProps {
|
||||
address: string;
|
||||
icon: JSX.Element;
|
||||
icon: React.JSX.Element;
|
||||
onCopyAddress(): void;
|
||||
title: string;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { FiAlertCircle } from 'react-icons/fi';
|
||||
|
||||
import { Box, Stack, Text, color } from '@stacks/ui';
|
||||
|
||||
export function SponsoredLabel(): JSX.Element {
|
||||
export function SponsoredLabel(): React.JSX.Element {
|
||||
return (
|
||||
<Stack width="100%">
|
||||
<Stack
|
||||
|
||||
@@ -21,7 +21,7 @@ interface TextInputFieldProps extends FlexProps {
|
||||
onClickLabelAction?(): void;
|
||||
placeholder?: string;
|
||||
inputRef?: Ref<HTMLInputElement>;
|
||||
topInputOverlay?: JSX.Element;
|
||||
topInputOverlay?: React.JSX.Element;
|
||||
hasError?: boolean;
|
||||
}
|
||||
export function TextInputField({
|
||||
|
||||
@@ -11,7 +11,7 @@ interface AssetItemProps extends StackProps {
|
||||
ticker: string;
|
||||
}
|
||||
|
||||
export function TxAssetItem(props: AssetItemProps): JSX.Element {
|
||||
export function TxAssetItem(props: AssetItemProps): React.JSX.Element {
|
||||
const { iconString, amount, ticker, ...rest } = props;
|
||||
const imageCanonicalUri = isValidUrl(iconString) ? iconString : undefined;
|
||||
|
||||
|
||||
@@ -5,11 +5,11 @@ import { SpaceBetween } from '@app/components/layout/space-between';
|
||||
|
||||
interface BitcoinTransactionItemLayoutProps {
|
||||
openTxLink(): void;
|
||||
txCaption: JSX.Element;
|
||||
txIcon: JSX.Element;
|
||||
txStatus: JSX.Element;
|
||||
txTitle: JSX.Element;
|
||||
txValue: JSX.Element;
|
||||
txCaption: React.JSX.Element;
|
||||
txIcon: React.JSX.Element;
|
||||
txStatus: React.JSX.Element;
|
||||
txTitle: React.JSX.Element;
|
||||
txValue: React.JSX.Element;
|
||||
}
|
||||
export function BitcoinTransactionItemLayout({
|
||||
openTxLink,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Flex } from '@stacks/ui';
|
||||
import { LoadingSpinner } from '@app/components/loading-spinner';
|
||||
|
||||
interface BitcoinChooseFeeLayoutProps {
|
||||
children: JSX.Element;
|
||||
children: React.JSX.Element;
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ImageUnavailable } from '../image-unavailable';
|
||||
|
||||
interface CollectibleImageProps extends Omit<CollectibleItemLayoutProps, 'children'> {
|
||||
alt?: string;
|
||||
icon: JSX.Element;
|
||||
icon: React.JSX.Element;
|
||||
src: string;
|
||||
}
|
||||
export function CollectibleImage(props: CollectibleImageProps) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Box } from '@stacks/ui';
|
||||
import { CollectibleItemLayout, CollectibleItemLayoutProps } from '../collectible-item.layout';
|
||||
|
||||
interface CollectibleOtherProps extends Omit<CollectibleItemLayoutProps, 'children'> {
|
||||
children: JSX.Element;
|
||||
children: React.JSX.Element;
|
||||
}
|
||||
export function CollectibleOther({ children, ...props }: CollectibleOtherProps) {
|
||||
return (
|
||||
|
||||
@@ -2,7 +2,7 @@ import { CollectibleItemLayout, CollectibleItemLayoutProps } from '../collectibl
|
||||
import { CollectibleTextLayout } from './collectible-text.layout';
|
||||
|
||||
interface CollectibleTextProps extends Omit<CollectibleItemLayoutProps, 'children'> {
|
||||
icon: JSX.Element;
|
||||
icon: React.JSX.Element;
|
||||
content: string;
|
||||
}
|
||||
export function CollectibleText(props: CollectibleTextProps) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { figmaTheme } from '@app/common/utils/figma-theme';
|
||||
import { ArrowIcon } from '@app/components/icons/arrow-icon';
|
||||
|
||||
interface CollectibleHoverProps {
|
||||
collectibleTypeIcon?: JSX.Element;
|
||||
collectibleTypeIcon?: React.JSX.Element;
|
||||
isHovered: boolean;
|
||||
onClickCallToAction?(): void;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export interface CollectibleItemLayoutProps {
|
||||
onClickCallToAction?(): void;
|
||||
onClickLayout?(): void;
|
||||
onClickSend?(): void;
|
||||
collectibleTypeIcon?: JSX.Element;
|
||||
collectibleTypeIcon?: React.JSX.Element;
|
||||
subtitle: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Flex, color } from '@stacks/ui';
|
||||
|
||||
interface ContainerLayoutProps {
|
||||
children: JSX.Element | JSX.Element[];
|
||||
header: JSX.Element | null;
|
||||
children: React.JSX.Element | React.JSX.Element[];
|
||||
header: React.JSX.Element | null;
|
||||
}
|
||||
export function ContainerLayout(props: ContainerLayoutProps) {
|
||||
const { children, header } = props;
|
||||
|
||||
@@ -7,7 +7,7 @@ interface EditNonceFormProps {
|
||||
onClose(): void;
|
||||
onSubmit(): void;
|
||||
}
|
||||
export function EditNonceForm(props: EditNonceFormProps): JSX.Element {
|
||||
export function EditNonceForm(props: EditNonceFormProps): React.JSX.Element {
|
||||
const { onBlur, onClose, onSubmit } = props;
|
||||
|
||||
return (
|
||||
|
||||
@@ -4,7 +4,7 @@ interface FeeMultiplierButtonProps extends ButtonProps {
|
||||
multiplier: number;
|
||||
}
|
||||
|
||||
export function FeeMultiplierButton(props: FeeMultiplierButtonProps): JSX.Element {
|
||||
export function FeeMultiplierButton(props: FeeMultiplierButtonProps): React.JSX.Element {
|
||||
const { multiplier, ...rest } = props;
|
||||
|
||||
return (
|
||||
|
||||
@@ -9,7 +9,7 @@ interface FeeMultiplierProps extends StackProps {
|
||||
showReset?: boolean;
|
||||
}
|
||||
|
||||
export function FeeMultiplier(props: FeeMultiplierProps): JSX.Element {
|
||||
export function FeeMultiplier(props: FeeMultiplierProps): React.JSX.Element {
|
||||
const { onSelectMultiplier, showReset, ...rest } = props;
|
||||
|
||||
return (
|
||||
|
||||
@@ -11,7 +11,7 @@ import { FeeMultiplier } from './fee-multiplier';
|
||||
interface IncreaseFeeFieldProps {
|
||||
currentFee: number;
|
||||
}
|
||||
export function IncreaseFeeField(props: IncreaseFeeFieldProps): JSX.Element {
|
||||
export function IncreaseFeeField(props: IncreaseFeeFieldProps): React.JSX.Element {
|
||||
const { currentFee } = props;
|
||||
const [field, meta, helpers] = useField('fee');
|
||||
const [modified, setModified] = useState(false);
|
||||
|
||||
@@ -39,7 +39,7 @@ interface LedgerSignMsgData {
|
||||
unsignedMessage: UnsignedMessage;
|
||||
}
|
||||
interface LedgerSignMsgDataProps {
|
||||
children({ account, unsignedMessage }: LedgerSignMsgData): JSX.Element;
|
||||
children({ account, unsignedMessage }: LedgerSignMsgData): React.JSX.Element;
|
||||
}
|
||||
function LedgerSignMsgData({ children }: LedgerSignMsgDataProps) {
|
||||
const account = useCurrentStacksAccount();
|
||||
|
||||
@@ -4,11 +4,11 @@ import { FundPageSelectors } from '@tests-legacy/page-objects/fund.selectors';
|
||||
import { Caption, Title } from '@app/components/typography';
|
||||
|
||||
interface FundAccountTileProps {
|
||||
attributes?: JSX.Element;
|
||||
attributes?: React.JSX.Element;
|
||||
description: string;
|
||||
icon: string;
|
||||
onClickTile(): void;
|
||||
receiveStxIcon?: JSX.Element;
|
||||
receiveStxIcon?: React.JSX.Element;
|
||||
testId: string;
|
||||
title?: string;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Box, ButtonProps, Text } from '@stacks/ui';
|
||||
interface HomeActionButtonProps extends ButtonProps {
|
||||
icon: any;
|
||||
label: string;
|
||||
buttonComponent(props: ButtonProps): JSX.Element;
|
||||
buttonComponent(props: ButtonProps): React.JSX.Element;
|
||||
}
|
||||
export const HomeActionButton = memo((props: HomeActionButtonProps) => {
|
||||
const { icon, label, buttonComponent: Button, ...rest } = props;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useCurrentStacksAccount } from '@app/store/accounts/blockchain/stacks/s
|
||||
import { StacksAccount } from '@app/store/accounts/blockchain/stacks/stacks-account.models';
|
||||
|
||||
interface HomeLoaderProps {
|
||||
children(data: StacksAccount): JSX.Element;
|
||||
children(data: StacksAccount): React.JSX.Element;
|
||||
}
|
||||
export function HomeLoader({ children }: HomeLoaderProps) {
|
||||
const currentAccount = useCurrentStacksAccount();
|
||||
|
||||
@@ -13,10 +13,10 @@ import { Text } from '@app/components/typography';
|
||||
import { BackUpSecretKeyActions } from './components/back-up-secret-key-actions';
|
||||
|
||||
interface BackUpSecretKeyLayoutProps {
|
||||
secretKeyDisplay: JSX.Element;
|
||||
secretKeyDisplay: React.JSX.Element;
|
||||
onBackedUpSecretKey(): void;
|
||||
}
|
||||
export function BackUpSecretKeyLayout(props: BackUpSecretKeyLayoutProps): JSX.Element {
|
||||
export function BackUpSecretKeyLayout(props: BackUpSecretKeyLayoutProps): React.JSX.Element {
|
||||
const { secretKeyDisplay, onBackedUpSecretKey } = props;
|
||||
|
||||
const [desktopViewport] = useMediaQuery(`(min-width: ${DESKTOP_VIEWPORT_MIN_WIDTH})`);
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Caption } from '@app/components/typography';
|
||||
interface BackUpSecretKeyLayoutProps {
|
||||
onBackedUpSecretKey(): void;
|
||||
}
|
||||
export function BackUpSecretKeyActions(props: BackUpSecretKeyLayoutProps): JSX.Element {
|
||||
export function BackUpSecretKeyActions(props: BackUpSecretKeyLayoutProps): React.JSX.Element {
|
||||
const { onBackedUpSecretKey } = props;
|
||||
|
||||
return (
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ValidatedPassword } from '@app/common/validation/validate-password';
|
||||
import { defaultColor } from './password-field.utils';
|
||||
|
||||
function fillArray(amount: number) {
|
||||
return (item: (i: number) => JSX.Element) =>
|
||||
return (item: (i: number) => React.JSX.Element) =>
|
||||
createNullArrayOfLength(amount).map((_, i) => item(i));
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ interface WelcomeLayoutProps {
|
||||
onStartOnboarding(): void;
|
||||
onRestoreWallet(): void;
|
||||
}
|
||||
export function WelcomeLayout(props: WelcomeLayoutProps): JSX.Element {
|
||||
export function WelcomeLayout(props: WelcomeLayoutProps): React.JSX.Element {
|
||||
const { isGeneratingWallet, onStartOnboarding, onSelectConnectLedger, onRestoreWallet } = props;
|
||||
|
||||
return (
|
||||
|
||||
@@ -17,7 +17,7 @@ interface ReceiveTokensLayoutProps {
|
||||
accountName?: string;
|
||||
onCopyAddressToClipboard(address: string): void;
|
||||
title: string;
|
||||
warning?: JSX.Element;
|
||||
warning?: React.JSX.Element;
|
||||
hasSubtitle?: boolean;
|
||||
}
|
||||
export function ReceiveTokensLayout(props: ReceiveTokensLayoutProps) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { SpaceBetween } from '@app/components/layout/space-between';
|
||||
import { Text } from '@app/components/typography';
|
||||
|
||||
interface CollectibleAssetProps {
|
||||
icon: JSX.Element;
|
||||
icon: React.JSX.Element;
|
||||
name: string;
|
||||
symbol?: string;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { createUtxoFromInscription } from './create-utxo-from-inscription';
|
||||
import { SendInscriptionContextState } from './send-inscription-container';
|
||||
|
||||
interface SendInscriptionLoaderProps {
|
||||
children(data: Partial<SendInscriptionContextState>): JSX.Element;
|
||||
children(data: Partial<SendInscriptionContextState>): React.JSX.Element;
|
||||
}
|
||||
export function SendInscriptionLoader({ children }: SendInscriptionLoaderProps) {
|
||||
const { inscription } = useSendInscriptionRouteState();
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Stack } from '@stacks/ui';
|
||||
import { LoadingSpinner } from '@app/components/loading-spinner';
|
||||
|
||||
interface SendInscriptionFormLoaderProps {
|
||||
children: JSX.Element;
|
||||
children: React.JSX.Element;
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { JSX, useEffect } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { SendCryptoAssetSelectors } from '@tests/selectors/send.selectors';
|
||||
import { useField, useFormikContext } from 'formik';
|
||||
@@ -15,7 +15,7 @@ interface RecipientFieldProps {
|
||||
onBlur?(): void;
|
||||
onClickLabelAction?(): void;
|
||||
placeholder: string;
|
||||
topInputOverlay?: JSX.Element;
|
||||
topInputOverlay?: React.JSX.Element;
|
||||
}
|
||||
export function RecipientField({
|
||||
isDisabled,
|
||||
|
||||
@@ -4,7 +4,7 @@ interface RecipientFieldAddressProps {
|
||||
isSelectVisible: boolean;
|
||||
onClickLabelAction(): void;
|
||||
selectedRecipientField: number;
|
||||
topInputOverlay: JSX.Element;
|
||||
topInputOverlay: React.JSX.Element;
|
||||
}
|
||||
export function RecipientFieldAddress({
|
||||
isSelectVisible,
|
||||
|
||||
@@ -15,7 +15,7 @@ interface RecipientFieldBnsNameProps {
|
||||
isSelectVisible: boolean;
|
||||
onClickLabelAction(): void;
|
||||
selectedRecipientField: number;
|
||||
topInputOverlay: JSX.Element;
|
||||
topInputOverlay: React.JSX.Element;
|
||||
}
|
||||
export function RecipientFieldBnsName({
|
||||
fetchFn,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useOnMount } from '@app/common/hooks/use-on-mount';
|
||||
import { SpaceBetween } from '@app/components/layout/space-between';
|
||||
|
||||
interface SelectedAssetFieldProps {
|
||||
icon: JSX.Element;
|
||||
icon: React.JSX.Element;
|
||||
name: string;
|
||||
symbol: string;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export function Sip10TokenSendForm() {
|
||||
}
|
||||
|
||||
interface Sip10TokenSendFormLoaderProps {
|
||||
children: (data: { symbol: string; contractId: string }) => JSX.Element;
|
||||
children: (data: { symbol: string; contractId: string }) => React.JSX.Element;
|
||||
}
|
||||
|
||||
function Sip10TokenSendFormLoader({ children }: Sip10TokenSendFormLoaderProps) {
|
||||
|
||||
@@ -29,8 +29,8 @@ interface StacksCommonSendFormProps {
|
||||
): Promise<void>;
|
||||
initialValues: StacksSendFormValues;
|
||||
validationSchema: ObjectSchema<any>;
|
||||
amountField: JSX.Element;
|
||||
selectedAssetField: JSX.Element;
|
||||
amountField: React.JSX.Element;
|
||||
selectedAssetField: React.JSX.Element;
|
||||
availableTokenBalance: Money;
|
||||
fees?: Fees;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
TupleNodeValueDisplayer,
|
||||
} from './nested-tuple-displayer';
|
||||
|
||||
function wrapText(text: string): JSX.Element {
|
||||
function wrapText(text: string): React.JSX.Element {
|
||||
return <>{text}</>;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useTransactionRequestState } from '@app/store/transactions/requests.hoo
|
||||
|
||||
import { Row } from './row';
|
||||
|
||||
export function AttachmentRow(): JSX.Element | null {
|
||||
export function AttachmentRow(): React.JSX.Element | null {
|
||||
const pendingTransaction = useTransactionRequestState();
|
||||
return pendingTransaction?.attachment ? (
|
||||
<Row name="Attachment" value={hexToHumanReadable(pendingTransaction.attachment)} />
|
||||
|
||||
@@ -8,7 +8,7 @@ interface FunctionArgumentProps {
|
||||
index: number;
|
||||
}
|
||||
|
||||
export function FunctionArgumentItem(props: FunctionArgumentProps): JSX.Element {
|
||||
export function FunctionArgumentItem(props: FunctionArgumentProps): React.JSX.Element {
|
||||
const { arg, index, ...rest } = props;
|
||||
const contractFunction = useContractFunction();
|
||||
const argCV = deserializeCV(Buffer.from(arg, 'hex'));
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useTransactionRequestState } from '@app/store/transactions/requests.hoo
|
||||
|
||||
import { FunctionArgumentItem } from './function-argument-item';
|
||||
|
||||
function FunctionArgumentsListBase(props: StackProps): JSX.Element | null {
|
||||
function FunctionArgumentsListBase(props: StackProps): React.JSX.Element | null {
|
||||
const transactionRequest = useTransactionRequestState();
|
||||
|
||||
if (!transactionRequest || transactionRequest.txType !== 'contract_call') {
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
} from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';
|
||||
import { useTransactionRequestState } from '@app/store/transactions/requests.hooks';
|
||||
|
||||
function ContractCodeSection(): JSX.Element | null {
|
||||
function ContractCodeSection(): React.JSX.Element | null {
|
||||
const transactionRequest = useTransactionRequestState();
|
||||
|
||||
const currentAccount = useCurrentStacksAccount();
|
||||
@@ -47,7 +47,7 @@ interface TabButtonProps extends BoxProps {
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
function TabButton(props: TabButtonProps): JSX.Element {
|
||||
function TabButton(props: TabButtonProps): React.JSX.Element {
|
||||
const { isActive, ...rest } = props;
|
||||
|
||||
return (
|
||||
@@ -64,7 +64,7 @@ function TabButton(props: TabButtonProps): JSX.Element {
|
||||
);
|
||||
}
|
||||
|
||||
export function ContractDeployDetails(): JSX.Element | null {
|
||||
export function ContractDeployDetails(): React.JSX.Element | null {
|
||||
const transactionRequest = useTransactionRequestState();
|
||||
const currentAccount = useCurrentStacksAccount();
|
||||
const currentAccountStxAddress = useCurrentAccountStxAddressState();
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Box, Flex, Text, color } from '@stacks/ui';
|
||||
|
||||
import { usePostConditionModeState } from '@app/store/transactions/post-conditions.hooks';
|
||||
|
||||
export function PostConditionModeWarning(): JSX.Element | null {
|
||||
export function PostConditionModeWarning(): React.JSX.Element | null {
|
||||
const mode = usePostConditionModeState();
|
||||
|
||||
if (mode !== PostConditionMode.Allow) return null;
|
||||
|
||||
@@ -27,7 +27,7 @@ interface FungiblePostConditionItemProps {
|
||||
|
||||
function FungiblePostConditionItemSuspense(
|
||||
props: FungiblePostConditionItemProps
|
||||
): JSX.Element | null {
|
||||
): React.JSX.Element | null {
|
||||
const { isLast, pc } = props;
|
||||
const currentAccount = useCurrentStacksAccount();
|
||||
const pendingTransaction = useTransactionRequestState();
|
||||
@@ -84,7 +84,9 @@ function FungiblePostConditionItemSuspense(
|
||||
);
|
||||
}
|
||||
|
||||
export function FungiblePostConditionItem(props: FungiblePostConditionItemProps): JSX.Element {
|
||||
export function FungiblePostConditionItem(
|
||||
props: FungiblePostConditionItemProps
|
||||
): React.JSX.Element {
|
||||
return (
|
||||
<Suspense fallback={<LoadingSpinner height="190px" />}>
|
||||
<FungiblePostConditionItemSuspense {...props} />
|
||||
|
||||
@@ -5,7 +5,7 @@ import { color } from '@stacks/ui-utils';
|
||||
|
||||
import { Body } from '@app/components/typography';
|
||||
|
||||
export function NoPostConditions(): JSX.Element {
|
||||
export function NoPostConditions(): React.JSX.Element {
|
||||
return (
|
||||
<Stack alignItems="center" spacing="base" p="base-loose" isInline>
|
||||
<Circle bg={color('bg-4')} flexShrink={0}>
|
||||
|
||||
@@ -22,7 +22,7 @@ interface PostConditionItemProps {
|
||||
pc: STXPostCondition | NonFungiblePostCondition;
|
||||
}
|
||||
|
||||
function PostConditionItemSuspense(props: PostConditionItemProps): JSX.Element | null {
|
||||
function PostConditionItemSuspense(props: PostConditionItemProps): React.JSX.Element | null {
|
||||
const { pc, isLast } = props;
|
||||
const currentAccount = useCurrentStacksAccount();
|
||||
const pendingTransaction = useTransactionRequestState();
|
||||
@@ -70,7 +70,7 @@ function PostConditionItemSuspense(props: PostConditionItemProps): JSX.Element |
|
||||
);
|
||||
}
|
||||
|
||||
export function PostConditionItem(props: PostConditionItemProps): JSX.Element {
|
||||
export function PostConditionItem(props: PostConditionItemProps): React.JSX.Element {
|
||||
return (
|
||||
<Suspense fallback={<LoadingSpinner height="190px" />}>
|
||||
<PostConditionItemSuspense {...props} />
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useTransactionPostConditions } from '@app/store/transactions/transactio
|
||||
import { FungiblePostConditionItem } from './fungible-post-condition-item';
|
||||
import { PostConditionItem } from './post-condition-item';
|
||||
|
||||
export function PostConditionsList(): JSX.Element {
|
||||
export function PostConditionsList(): React.JSX.Element {
|
||||
const postConditions = useTransactionPostConditions();
|
||||
|
||||
return (
|
||||
|
||||
@@ -14,7 +14,7 @@ import { NoPostConditions } from './no-post-conditions';
|
||||
import { PostConditionsList } from './post-conditions-list';
|
||||
import { StxPostCondition } from './stx-post-condition';
|
||||
|
||||
function PostConditionsSuspense(): JSX.Element | null {
|
||||
function PostConditionsSuspense(): React.JSX.Element | null {
|
||||
const postConditions = useTransactionPostConditions();
|
||||
const mode = usePostConditionModeState();
|
||||
const pendingTransaction = useTransactionRequestState();
|
||||
@@ -48,7 +48,7 @@ function PostConditionsSuspense(): JSX.Element | null {
|
||||
);
|
||||
}
|
||||
|
||||
export function PostConditions(): JSX.Element {
|
||||
export function PostConditions(): React.JSX.Element {
|
||||
return (
|
||||
<Suspense fallback={<></>}>
|
||||
<PostConditionsSuspense />
|
||||
|
||||
@@ -5,7 +5,7 @@ import { stacksValue } from '@app/common/stacks-utils';
|
||||
import { EventCard } from '@app/components/event-card';
|
||||
import { useTransactionRequestState } from '@app/store/transactions/requests.hooks';
|
||||
|
||||
export function StxPostCondition(): JSX.Element | null {
|
||||
export function StxPostCondition(): React.JSX.Element | null {
|
||||
const pendingTransaction = useTransactionRequestState();
|
||||
|
||||
if (!pendingTransaction || pendingTransaction.txType !== TransactionTypes.STXTransfer)
|
||||
|
||||
@@ -6,12 +6,12 @@ import { Caption } from '@app/components/typography';
|
||||
import { PrincipalValue } from './principal-value';
|
||||
|
||||
interface RowProps extends StackProps {
|
||||
name?: string | JSX.Element | null;
|
||||
name?: string | React.JSX.Element | null;
|
||||
type?: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export function Row(props: RowProps): JSX.Element {
|
||||
export function Row(props: RowProps): React.JSX.Element {
|
||||
const { name, type, value, ...rest } = props;
|
||||
|
||||
return (
|
||||
|
||||
@@ -6,7 +6,7 @@ import { AttachmentRow } from '@app/pages/transaction-request/components/attachm
|
||||
import { Row } from '@app/pages/transaction-request/components/row';
|
||||
import { useTransactionRequestState } from '@app/store/transactions/requests.hooks';
|
||||
|
||||
export function StxTransferDetails(): JSX.Element | null {
|
||||
export function StxTransferDetails(): React.JSX.Element | null {
|
||||
const pendingTransaction = useTransactionRequestState();
|
||||
|
||||
if (!pendingTransaction || pendingTransaction.txType !== 'token_transfer') {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { useDrawers } from '@app/common/hooks/use-drawers';
|
||||
import { LoadingKeys, useLoading } from '@app/common/hooks/use-loading';
|
||||
import { useTransactionError } from '@app/pages/transaction-request/hooks/use-transaction-error';
|
||||
|
||||
function BaseConfirmButton(props: ButtonProps): JSX.Element {
|
||||
function BaseConfirmButton(props: ButtonProps): React.JSX.Element {
|
||||
return (
|
||||
<Button borderRadius="10px" mt="base" py="base" type="submit" width="100%" {...props}>
|
||||
Confirm
|
||||
|
||||
@@ -7,8 +7,8 @@ import { Caption, Text } from '@app/components/typography';
|
||||
|
||||
interface ErrorMessageProps extends StackProps {
|
||||
title: string;
|
||||
body: string | JSX.Element;
|
||||
actions?: JSX.Element;
|
||||
body: string | React.JSX.Element;
|
||||
actions?: React.JSX.Element;
|
||||
}
|
||||
export const ErrorMessage = memo(({ title, body, actions, ...rest }: ErrorMessageProps) => {
|
||||
return (
|
||||
|
||||
@@ -44,7 +44,7 @@ function Properties({ p }: { p: any }) {
|
||||
);
|
||||
}
|
||||
|
||||
export function ProfileBox({ profile }: { profile: Profile }): JSX.Element | null {
|
||||
export function ProfileBox({ profile }: { profile: Profile }): React.JSX.Element | null {
|
||||
return (
|
||||
<Box minHeight={'260px'}>
|
||||
<Stack
|
||||
|
||||
@@ -57,7 +57,7 @@ export function UpdateAction({
|
||||
profileUpdaterPayload,
|
||||
}: {
|
||||
profileUpdaterPayload: ProfileUpdatePayload;
|
||||
}): JSX.Element | null {
|
||||
}): React.JSX.Element | null {
|
||||
const { profile: publicProfile } = profileUpdaterPayload;
|
||||
|
||||
const { tabId, requestToken } = useProfileUpdateRequestSearchParams();
|
||||
|
||||
@@ -18,7 +18,7 @@ export interface FtTransfer {
|
||||
|
||||
export interface TxTransferDetails {
|
||||
caption: string;
|
||||
icon: JSX.Element;
|
||||
icon: React.JSX.Element;
|
||||
link: string;
|
||||
title: string;
|
||||
value: number | string | null;
|
||||
|
||||
Reference in New Issue
Block a user