Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/limit UI upgrade 11 #5299

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ export function useOrdersTableList(
setIsOrderUnfillable({ chainId, id: order.id, isUnfillable })
}

// Only add to unfillable if the order is both pending and unfillable
if (isPending && isUnfillable) {
acc.unfillable.push(item)
}

// Add to signing if in presignature pending state
if (isSigning) {
acc.signing.push(item)
}

// Add to unfillable only if pending, unfillable, and not in signing state
if (isPending && isUnfillable && !isSigning) {
acc.unfillable.push(item)
}

// Add to pending or history based on status
if (isPending && !isSigning) {
acc.pending.push(item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ export function getOrderStatusTitleAndColor(order: ParsedOrder): { title: string
}
}

// Handle unfillable orders
if (order.isUnfillable) {
return {
title: 'Unfillable',
color: `var(${UI.COLOR_DANGER_TEXT})`,
background: `var(${UI.COLOR_DANGER_BG})`,
}
}

// Handle signing state
if (order.status === OrderStatus.PRESIGNATURE_PENDING) {
return {
Expand All @@ -71,6 +62,15 @@ export function getOrderStatusTitleAndColor(order: ParsedOrder): { title: string
}
}

// Handle unfillable orders
if (order.isUnfillable) {
return {
title: 'Unfillable',
color: `var(${UI.COLOR_DANGER_TEXT})`,
background: `var(${UI.COLOR_DANGER_BG})`,
}
}

// Finally, map order status to their display version
return {
title: orderStatusTitleMap[order.status],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ export function OrderRow({
const withAllowanceWarning = hasEnoughAllowance === false
const withWarning =
(hasEnoughBalance === false || withAllowanceWarning) &&
// show the warning only for pending and scheduled orders
// show the warning only for pending and scheduled orders, but not for presignature pending
status !== OrderStatus.PRESIGNATURE_PENDING &&
(status === OrderStatus.PENDING || status === OrderStatus.SCHEDULED)
const isOrderScheduled = order.status === OrderStatus.SCHEDULED

Expand Down Expand Up @@ -536,6 +537,9 @@ export function OrderRow({
{/* Add empty cell for child TWAP orders */}
{isTwapTable && isChild && <styledEl.CellElement />}

{/* Add empty cell for signing orders - only for TWAP */}
{isTwapTable && order.status === OrderStatus.PRESIGNATURE_PENDING && <styledEl.CellElement />}

{/* Action content menu */}
<styledEl.CellElement>
<OrderContextMenu
Expand Down
Loading