Skip to content

Commit

Permalink
chore: I crave consistent behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
CremaFR committed Sep 9, 2024
1 parent 00f368b commit dc3e134
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import TranslatedError from "~/renderer/components/TranslatedError";
import AccountFooter from "../AccountFooter";
import SendAmountFields from "../SendAmountFields";
import { StepProps } from "../types";
import LowGasAlertBuyMore from "~/renderer/families/evm/SendAmountFields/LowGasAlertBuyMore";
import { closeAllModal } from "~/renderer/actions/modals";
const StepAmount = ({
account,
parentAccount,
Expand All @@ -23,15 +25,19 @@ const StepAmount = ({
}: StepProps) => {
if (!status) return null;
const mainAccount = account ? getMainAccount(account, parentAccount) : null;
const { gasPrice: gasPriceError } = status.errors;

return (
<Box flow={4}>
<TrackPage category="Sign Transaction Flow" name="Step Amount" />
{mainAccount ? <CurrencyDownStatusAlert currencies={[mainAccount.currency]} /> : null}
{error || warning ? (
<Alert type={error ? "error" : "warning"}>
<TranslatedError error={error || warning} />
</Alert>
) : null}
{error || warning
? !gasPriceError && (
<Alert type={error ? "error" : "warning"}>
<TranslatedError error={error || warning} />
</Alert>
)
: null}
{account && transaction && mainAccount && (
<Fragment key={account.id}>
<SendAmountFields
Expand All @@ -45,6 +51,14 @@ const StepAmount = ({
/>
</Fragment>
)}
{mainAccount && gasPriceError && (
<LowGasAlertBuyMore
account={mainAccount}
handleRequestClose={closeAllModal}
gasPriceError={gasPriceError}
trackingSource={"sign flow"}
/>
)}
</Box>
);
};
Expand Down

0 comments on commit dc3e134

Please sign in to comment.