- {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,
};