From 47a27bf3febd238c6acd89e1817826076b85dee6 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Mon, 18 Jul 2022 15:55:17 -0700 Subject: [PATCH] Label "Since June" for users who had an account prior to 2022-06-20 (#659) --- web/components/portfolio/portfolio-value-section.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/components/portfolio/portfolio-value-section.tsx b/web/components/portfolio/portfolio-value-section.tsx index 22f1478f..1fabbd06 100644 --- a/web/components/portfolio/portfolio-value-section.tsx +++ b/web/components/portfolio/portfolio-value-section.tsx @@ -15,6 +15,13 @@ export const PortfolioValueSection = memo( const lastPortfolioMetrics = last(portfolioHistory) const [portfolioPeriod, setPortfolioPeriod] = useState('allTime') + // PATCH: If portfolio history started on June 1st, then we label it as "Since June" + // instead of "All time" + const allTimeLabel = + portfolioHistory[0].timestamp < Date.parse('2022-06-20T00:00:00.000Z') + ? 'Since June' + : 'All time' + if (portfolioHistory.length === 0 || !lastPortfolioMetrics) { return <> } @@ -39,7 +46,7 @@ export const PortfolioValueSection = memo( setPortfolioPeriod(e.target.value as Period) }} > - +