From c8af209012dc4e63b3949f0c7154f349ffd96994 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 24 Nov 2020 14:49:20 -0800 Subject: [PATCH] hide compare column for now --- src/app/ItemTradesPage.js | 95 ++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 40 deletions(-) diff --git a/src/app/ItemTradesPage.js b/src/app/ItemTradesPage.js index a076080..07eae83 100644 --- a/src/app/ItemTradesPage.js +++ b/src/app/ItemTradesPage.js @@ -132,6 +132,17 @@ function ItemTradesTable({ return {error.message}; } + // 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 ( - - List - - + List + {userHeading} - + {/* A small wording tweak to fit better on the xsmall screens! */} Last active Active at - - Compare - + {shouldShowCompareColumn && ( + + Compare + + )} @@ -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,41 +257,43 @@ function ItemTradesTableRow({ year: "numeric", }).format(new Date(lastTradeActivity))} - - - {compareListHeading}: - - - Adorable Freckles - - - Constellation Dress + {shouldShowCompareColumn && ( + + + {compareListHeading}: + + + Adorable Freckles + + + Constellation Dress + + (WIP: This is placeholder data!) - (WIP: This is placeholder data!) - - } - > - - 2 match - 2 matches - - - + + 2 match + 2 matches + + + + )} ); }