props.theme.spacing(12)}px;
- margin-bottom: ${(props) => props.theme.spacing(8)}px;
+ margin-top: ${(props) => props.theme.space.l};
+ margin-bottom: ${(props) => props.theme.space.m};
`;
const Buttons = styled.div`
- margin: ${(props) => props.theme.spacing(12)}px 0;
+ margin: ${(props) => props.theme.space.l} 0;
`;
type Props = {
@@ -71,7 +71,7 @@ function AmountSelector({
const { data: recommendedFees } = useBtcFeeRate();
const satsToFiat = (sats: string) =>
- getBtcFiatEquivalent(new BigNumber(sats), BigNumber(btcFiatRate)).toNumber().toFixed(2);
+ getBtcFiatEquivalent(new BigNumber(sats), BigNumber(btcFiatRate)).toString();
if (btcBalanceLoading || btcBalance === undefined) {
return null;
@@ -83,6 +83,7 @@ function AmountSelector({
{header}
{hasBtc && (
-
+
props.theme.spacing(12)}px 0;
+ margin: ${(props) => props.theme.space.l} 0;
`;
type Props = {
recipientAddress: string;
setRecipientAddress: (address: string) => void;
onNext: () => void;
- isLoading: boolean;
header?: React.ReactNode;
};
// TODO: this could be extracted into a component for reuse
-function RecipientSelector({
- recipientAddress,
- setRecipientAddress,
- onNext,
- isLoading,
- header,
-}: Props) {
+function RecipientSelector({ recipientAddress, setRecipientAddress, onNext, header }: Props) {
const { t } = useTranslation('translation', { keyPrefix: 'SEND' });
const { network } = useWalletSelector();
const [addressIsValid, setAddressIsValid] = useState(true);
@@ -51,17 +45,20 @@ function RecipientSelector({
setAddressIsValid(true);
};
- const inputFeedback = useMemo(() => {
+ const inputFeedback: {
+ message: string;
+ variant?: FeedbackVariant;
+ }[] = useMemo(() => {
if (addressIsValid) {
return [];
}
return [
{
- variant: 'danger' as const,
message: t('ERRORS.ADDRESS_INVALID'),
+ variant: 'danger',
},
];
- }, [addressIsValid]);
+ }, [addressIsValid, t]);
return (
@@ -74,6 +71,7 @@ function RecipientSelector({
onChange={handleAddressChange}
variant={addressIsValid ? 'default' : 'danger'}
feedback={inputFeedback}
+ autoFocus
/>
@@ -81,7 +79,6 @@ function RecipientSelector({
title={t('NEXT')}
onClick={handleNext}
disabled={!recipientAddress || !addressIsValid}
- loading={isLoading}
/>