Skip to content

Commit

Permalink
weird bug on deploy to prod, see if renaming fixes it
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaakbanaan committed Nov 29, 2024
1 parent f8b7201 commit 1469a32
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/components/Dashboard/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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/';

Expand Down Expand Up @@ -80,12 +80,12 @@ const Dashboard = () => {

return (
<div className="container mx-auto p-4 md:p-0">
{/* <PngOverviewGenerator
<WrappedGenerator
filterDateRange={filterDateRange}
beerData={filteredData}
fullBeerData={beerData}
userName="sjaakbanaan"
/> */}
/>
{filteredData && filteredData.length > 0 ? (
<div>
<YearFilterButtons
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { formatPngDates } from '../../utils';
import { formatWrappedDates } from '../../utils';

/*
- top 5 beers (highest rating)
Expand All @@ -7,7 +7,7 @@ import { formatPngDates } from '../../utils';
- top 5 venues (exl. home)
*/

const PngOverview = ({
const Wrapped = ({
userName,
captureScreenshot,
stats,
Expand All @@ -32,7 +32,7 @@ const PngOverview = ({
<img src="/logo512.png" style={{ width: '64px' }} alt="" />
<h2 className="mt-6 text-2xl font-bold">Untappd stats for {userName}</h2>
<div className="mb-4 mt-2">
{formatPngDates(filterDateRange.start, filterDateRange.end)}
{formatWrappedDates(filterDateRange.start, filterDateRange.end)}
</div>
<div className="w-full">
<h2 className="mb-2 font-bold">Top 5 beers (by rating)</h2>
Expand Down Expand Up @@ -94,4 +94,4 @@ const PngOverview = ({
);
};

export default PngOverview;
export default Wrapped;
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 () => {
Expand Down Expand Up @@ -56,7 +56,7 @@ const PngOverviewGenerator = ({ userName, beerData, fullBeerData, filterDateRang
const low5Beers = processTopBeers(beerData, 'rating_score', 5, 'desc');

return (
<PngOverview
<Wrapped
userName={userName}
captureScreenshot={captureScreenshot}
stats={stats}
Expand All @@ -68,4 +68,4 @@ const PngOverviewGenerator = ({ userName, beerData, fullBeerData, filterDateRang
);
};

export default PngOverviewGenerator;
export default WrappedGenerator;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const formatPngDates = (start, end) => {
export const formatWrappedDates = (start, end) => {
const startDate = new Date(start);
const endDate = new Date(end);

Expand Down
4 changes: 2 additions & 2 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -44,6 +44,6 @@ export {
statsCountUnique,
statsCountUniqueFriends,
checkFullDateRange,
formatPngDates,
formatWrappedDates,
getOverviewStats,
};

0 comments on commit 1469a32

Please sign in to comment.