hide compare column for now
This commit is contained in:
parent
c23243fcb7
commit
c8af209012
1 changed files with 55 additions and 40 deletions
|
@ -132,6 +132,17 @@ function ItemTradesTable({
|
|||
return <Box color="red.400">{error.message}</Box>;
|
||||
}
|
||||
|
||||
// HACK: I'm pretty much hiding this for now, because it's not ready. But
|
||||
/// it's visible at #show-compare-column!
|
||||
const shouldShowCompareColumn = window.location.href.includes(
|
||||
"show-compare-column"
|
||||
);
|
||||
|
||||
const minorColumnWidth = {
|
||||
base: shouldShowCompareColumn ? "23%" : "30%",
|
||||
md: "18ex",
|
||||
};
|
||||
|
||||
return (
|
||||
<Box
|
||||
as="table"
|
||||
|
@ -146,20 +157,20 @@ function ItemTradesTable({
|
|||
>
|
||||
<Box as="thead" fontSize={{ base: "xs", sm: "sm" }}>
|
||||
<Box as="tr">
|
||||
<ItemTradesTableCell as="th" width={{ base: "30%", md: "auto" }}>
|
||||
List
|
||||
</ItemTradesTableCell>
|
||||
<ItemTradesTableCell as="th" width={{ base: "23%", md: "18ex" }}>
|
||||
<ItemTradesTableCell as="th">List</ItemTradesTableCell>
|
||||
<ItemTradesTableCell as="th" width={minorColumnWidth}>
|
||||
{userHeading}
|
||||
</ItemTradesTableCell>
|
||||
<ItemTradesTableCell as="th" width={{ base: "23%", md: "18ex" }}>
|
||||
<ItemTradesTableCell as="th" width={minorColumnWidth}>
|
||||
{/* A small wording tweak to fit better on the xsmall screens! */}
|
||||
<Box display={{ base: "none", sm: "block" }}>Last active</Box>
|
||||
<Box display={{ base: "block", sm: "none" }}>Active at</Box>
|
||||
</ItemTradesTableCell>
|
||||
<ItemTradesTableCell as="th" width={{ base: "23%", md: "18ex" }}>
|
||||
{shouldShowCompareColumn && (
|
||||
<ItemTradesTableCell as="th" width={minorColumnWidth}>
|
||||
Compare
|
||||
</ItemTradesTableCell>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
<Box as="tbody">
|
||||
|
@ -182,6 +193,7 @@ function ItemTradesTable({
|
|||
username={trade.user.username}
|
||||
listName={trade.closetList.name}
|
||||
lastTradeActivity={trade.user.lastTradeActivity}
|
||||
shouldShowCompareColumn={shouldShowCompareColumn}
|
||||
/>
|
||||
))}
|
||||
{!loading && data.item.trades.length === 0 && (
|
||||
|
@ -206,6 +218,7 @@ function ItemTradesTableRow({
|
|||
username,
|
||||
listName,
|
||||
lastTradeActivity,
|
||||
shouldShowCompareColumn,
|
||||
}) {
|
||||
const history = useHistory();
|
||||
const onClick = React.useCallback(() => history.push(href), [history, href]);
|
||||
|
@ -244,6 +257,7 @@ function ItemTradesTableRow({
|
|||
year: "numeric",
|
||||
}).format(new Date(lastTradeActivity))}
|
||||
</ItemTradesTableCell>
|
||||
{shouldShowCompareColumn && (
|
||||
<ItemTradesTableCell fontSize="xs">
|
||||
<Tooltip
|
||||
placement="bottom"
|
||||
|
@ -279,6 +293,7 @@ function ItemTradesTableRow({
|
|||
</Box>
|
||||
</Tooltip>
|
||||
</ItemTradesTableCell>
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue