Skip to content

Commit

Permalink
fix: stop loss ui
Browse files Browse the repository at this point in the history
  • Loading branch information
unbreakablery committed Aug 11, 2022
1 parent 6806495 commit 3dda0ca
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/features/stop-loss/LimitPriceInputPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ const LimitPriceInputPanel: FC<LimitPriceInputPanel> = ({ trade, limitPrice }) =
<div className="flex flex-col gap-1">
<Typography variant="sm" className="px-2 flex items-center">
{i18n._(t`Minimum Rate`)}
<QuestionHelper text={i18n._(t`Minimum output amount`)} />
<QuestionHelper
text={i18n._(
t`Minimum output amount. The difference between the output token at the stop and minimum rates is used to pay the execution (gas) fee, therefore it needs to be sufficiently large to be $1 assuming the worst case.`
)}
/>
</Typography>
<div className="flex justify-between items-baseline bg-dark-900 rounded px-4 py-1.5 border border-dark-700 hover:border-dark-600">
<Typography weight={700} variant="lg" className="relative flex items-baseline flex-grow gap-3 overflow-hidden">
Expand Down
4 changes: 2 additions & 2 deletions src/features/stop-loss/StopLimitOrderButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ const StopLimitOrderButton: FC<StopLimitOrderButton> = ({ trade, parsedAmounts }
{error
? error
: tooNarrowMarginOfRates
? 'Too narrow margin of rates'
? 'Rate diff not enough for fee'
: fromBentoBalance
? i18n._(t`Review Stop Limit Order`)
? i18n._(t`Create Stop Limit Order`)
: i18n._(t`Confirm Deposit`)}
</Button>
)
Expand Down
6 changes: 5 additions & 1 deletion src/features/stop-loss/StopPriceInputPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ const StopPriceInputPanel: FC<StopPriceInputPanel> = ({ trade, stopPrice }) => {
<div className="flex flex-col gap-1">
<Typography variant="sm" className="px-2 flex items-center">
{i18n._(t`Stop Rate`)}
<QuestionHelper text={i18n._(t`Rate required to trigger limit rate`)} />
<QuestionHelper
text={i18n._(
t`Rate required to trigger limit rate. The difference between the output token at the stop and minimum rates is used to pay the execution (gas) fee, therefore it needs to be sufficiently large to be $1 assuming the worst case.`
)}
/>
</Typography>
<div className="flex justify-between items-baseline bg-dark-900 rounded px-4 py-1.5 border border-dark-700 hover:border-dark-600">
<Typography weight={700} variant="lg" className="relative flex items-baseline flex-grow gap-3 overflow-hidden">
Expand Down
8 changes: 8 additions & 0 deletions src/pages/stop-loss/[[...tokens]].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ const StopLoss = () => {
</div>

{isExpertMode && <RecipientField recipient={recipient} action={setRecipient} />}

<div className="text-xs py-2 flex justify-center">
<span className="text-secondary">Powered by</span>&nbsp;
<a href="https://www.autonomynetwork.io/" target="_blank" rel="noreferrer">
Autonomy Network
</a>
</div>

<StopLimitOrderButton trade={trade} parsedAmounts={parsedAmounts} />
<StopLossReviewModal
parsedAmounts={parsedAmounts}
Expand Down

0 comments on commit 3dda0ca

Please sign in to comment.