From 1469a325968242218249a33053801cfe14ba02a9 Mon Sep 17 00:00:00 2001 From: David Tuk Date: Fri, 29 Nov 2024 22:11:44 +0100 Subject: [PATCH] weird bug on deploy to prod, see if renaming fixes it --- src/components/Dashboard/Dashboard.jsx | 6 +++--- .../PngOverview.jsx => Wrapped/Wrapped.jsx} | 8 ++++---- .../WrappedGenerator.jsx} | 8 ++++---- src/utils/{formatPNGDates.js => formatWrappedDates.js} | 2 +- src/utils/index.js | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) rename src/components/{PngOverviewGenerator/PngOverview.jsx => Wrapped/Wrapped.jsx} (94%) rename src/components/{PngOverviewGenerator/PngOverviewGenerator.jsx => Wrapped/WrappedGenerator.jsx} (90%) rename src/utils/{formatPNGDates.js => formatWrappedDates.js} (95%) diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx index 8d1a87e..693c33b 100644 --- a/src/components/Dashboard/Dashboard.jsx +++ b/src/components/Dashboard/Dashboard.jsx @@ -15,7 +15,7 @@ import DateSelector from './DateSelector.jsx'; import YearFilterButtons from './YearFilterButtons.jsx'; import DashboardHeader from './DashboardHeader.jsx'; import BeerTypeChart from '../Charts/BeerTypeChart/BeerTypeChart.jsx'; -// import PngOverviewGenerator from '../PngOverviewGenerator/PngOverviewGenerator.jsx'; +import WrappedGenerator from '../Wrapped/WrappedGenerator.jsx'; import { filterBeerData, getDefaultStartDate, getDefaultEndDate } from '../../utils/'; @@ -80,12 +80,12 @@ const Dashboard = () => { return (
- {/* */} + /> {filteredData && filteredData.length > 0 ? (

Untappd stats for {userName}

- {formatPngDates(filterDateRange.start, filterDateRange.end)} + {formatWrappedDates(filterDateRange.start, filterDateRange.end)}

Top 5 beers (by rating)

@@ -94,4 +94,4 @@ const PngOverview = ({ ); }; -export default PngOverview; +export default Wrapped; diff --git a/src/components/PngOverviewGenerator/PngOverviewGenerator.jsx b/src/components/Wrapped/WrappedGenerator.jsx similarity index 90% rename from src/components/PngOverviewGenerator/PngOverviewGenerator.jsx rename to src/components/Wrapped/WrappedGenerator.jsx index 31286a5..47843c8 100644 --- a/src/components/PngOverviewGenerator/PngOverviewGenerator.jsx +++ b/src/components/Wrapped/WrappedGenerator.jsx @@ -2,7 +2,7 @@ import { useRef } from 'react'; import html2canvas from 'html2canvas'; import { getOverviewStats } from '../../utils'; import { processTopBeers } from '../../utils/listProcessing'; -import PngOverview from './PngOverview.jsx'; +import Wrapped from './Wrapped.jsx'; /* - top 5 beers (highest rating) @@ -11,7 +11,7 @@ import PngOverview from './PngOverview.jsx'; - top 5 venues (exl. home) */ -const PngOverviewGenerator = ({ userName, beerData, fullBeerData, filterDateRange }) => { +const WrappedGenerator = ({ userName, beerData, fullBeerData, filterDateRange }) => { const elementRef = useRef(); const captureScreenshot = async () => { @@ -56,7 +56,7 @@ const PngOverviewGenerator = ({ userName, beerData, fullBeerData, filterDateRang const low5Beers = processTopBeers(beerData, 'rating_score', 5, 'desc'); return ( - { +export const formatWrappedDates = (start, end) => { const startDate = new Date(start); const endDate = new Date(end); diff --git a/src/utils/index.js b/src/utils/index.js index bba7418..baefa98 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -19,7 +19,7 @@ import { statsCountUnique } from './statsCountUnique'; import { statsCountUniqueFriends } from './statsCountUniqueFriends'; import { checkFullDateRange } from './checkFullDateRange'; import { getBarChartHourData } from './getBarChartHourData'; -import { formatPngDates } from './formatPngDates'; +import { formatWrappedDates } from './formatWrappedDates'; import { getOverviewStats } from './getOverviewStats'; export { @@ -44,6 +44,6 @@ export { statsCountUnique, statsCountUniqueFriends, checkFullDateRange, - formatPngDates, + formatWrappedDates, getOverviewStats, };