Skip to content

Commit

Permalink
show warning icon in place order CTA only when validation error is un…
Browse files Browse the repository at this point in the history
…related to missing fields
  • Loading branch information
aforaleka committed Aug 13, 2024
1 parent 5ecd0f7 commit dc7f8a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/forms/TradeForm/PlaceOrderButtonAndReceipt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const PlaceOrderButtonAndReceipt = ({

const { fee, price: expectedPrice, reward } = summary ?? {};

// check if required fields are filled and summary has been calculated
// approximation for whether inputs are filled by whether summary has been calculated
const areInputsFilled = fee != null || reward != null;

const renderMarginValue = () => {
Expand Down Expand Up @@ -289,7 +289,7 @@ export const PlaceOrderButtonAndReceipt = ({
type={ButtonType.Submit}
action={buttonAction}
slotLeft={
showValidatorErrors ? (
showValidatorErrors && areInputsFilled ? (
<Icon iconName={IconName.Warning} tw="text-color-warning" />
) : undefined
}
Expand Down

0 comments on commit dc7f8a6

Please sign in to comment.