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 9 #5296

Merged
merged 2 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 @@ -533,6 +533,9 @@ export function OrderRow({
{/* Children (e.g. ToggleExpandButton for parent orders) */}
{children}

{/* Add empty cell for child TWAP orders */}
{isTwapTable && isChild && <styledEl.CellElement />}

{/* Action content menu */}
<styledEl.CellElement>
<OrderContextMenu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ const Pagination = styled(OrdersTablePagination)`
padding: 10px 0;
`

const TwapStatusAndToggleWrapper = styled.div`
display: flex;
align-items: center;
gap: 8px;
width: 100%;
`

function TwapStatusAndToggle({
parent,
childrenLength,
Expand Down Expand Up @@ -69,7 +62,7 @@ function TwapStatusAndToggle({
: null

return (
<TwapStatusAndToggleWrapper>
<>
<OrderStatusBox
order={parent}
onClick={onClick}
Expand Down Expand Up @@ -98,7 +91,7 @@ function TwapStatusAndToggle({
)}
<button />
</styledEl.ToggleExpandButton>
</TwapStatusAndToggleWrapper>
</>
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ export const TableHeader = styled.div<{ isHistoryTab: boolean; isRowSelectable:
display: grid;
gap: 14px;
grid-template-columns: ${({ isHistoryTab, isRowSelectable, isTwapTable }) => {
const checkboxColumn = isRowSelectable ? 'var(--checkboxSize)' : ''

// TWAP table layout - applies to both history and non-history tabs
if (isTwapTable) {
if (isHistoryTab) {
return `minmax(200px, 2.5fr)
repeat(4, minmax(110px, 1fr))
minmax(80px, 0.8fr)
minmax(120px, 1fr)
minmax(100px, 0.8fr)
24px`
}
return `${checkboxColumn} minmax(160px,2fr) minmax(120px,1fr) minmax(140px,1fr) minmax(120px,1fr) minmax(120px,1fr) minmax(100px,110px) minmax(120px,1fr) minmax(100px,0.8fr) 24px`
}

// Default layout for history tab
if (isHistoryTab) {
return `minmax(200px, 2.5fr)
repeat(4, minmax(110px, 1fr))
Expand All @@ -69,13 +85,6 @@ export const TableHeader = styled.div<{ isHistoryTab: boolean; isRowSelectable:
24px`
}

const checkboxColumn = isRowSelectable ? 'var(--checkboxSize)' : ''

// TWAP table layout
if (isTwapTable) {
return `${checkboxColumn} minmax(160px,2fr) minmax(120px,1fr) minmax(140px,1fr) minmax(120px,1fr) minmax(120px,1fr) minmax(100px,110px) minmax(190px,1.6fr) 24px`
}

// Default/Limit orders layout
return `${checkboxColumn} minmax(160px,2fr) minmax(120px,1fr) minmax(140px,1fr) minmax(120px,1fr) minmax(120px,1fr) minmax(100px,110px) minmax(80px,0.8fr) 24px`
}};
Expand Down Expand Up @@ -106,12 +115,17 @@ export const TableRow = styled(TableHeader)<{
}>`
grid-template-rows: minmax(var(--row-height), 1fr);
background: ${({ isChildOrder, isExpanded }) =>
isExpanded || isChildOrder ? `var(${UI.COLOR_PAPER_DARKER})` : 'transparent'};
isExpanded && !isChildOrder
? `var(${UI.COLOR_INFO_BG})`
: isChildOrder
? `var(${UI.COLOR_PAPER_DARKER})`
: 'transparent'};
transition: background var(${UI.ANIMATION_DURATION}) ease-in-out;
display: grid;

&:hover {
background: var(${UI.COLOR_PAPER_DARKER});
background: ${({ isExpanded, isChildOrder }) =>
isExpanded && !isChildOrder ? `var(${UI.COLOR_INFO_BG})` : `var(${UI.COLOR_PAPER_DARKER})`};
}

> div:first-child {
Expand Down
Loading