diff --git a/components/PriceGraph/AuctionHousePriceGraph/AuctionHousePriceGraph.tsx b/components/PriceGraph/AuctionHousePriceGraph/AuctionHousePriceGraph.tsx index 5bc7dbc0..9c62e030 100644 --- a/components/PriceGraph/AuctionHousePriceGraph/AuctionHousePriceGraph.tsx +++ b/components/PriceGraph/AuctionHousePriceGraph/AuctionHousePriceGraph.tsx @@ -1,7 +1,7 @@ 'use client' /* eslint-disable react-hooks/exhaustive-deps */ import ReactECharts from 'echarts-for-react' -import { useEffect, useId, useRef, useState } from 'react' +import { useEffect, useRef, useState } from 'react' import useRotatingMessages from '../../../hooks/useRotatingMessages' import api from '../../../api/ApiHelper' import { getLoadingElement } from '../../../utils/LoadingUtils' @@ -27,6 +27,7 @@ import { v4 as generateUUID } from 'uuid' import { useGetApiMayor } from '../../../api/_generated/skyApi' import type { PriceStatistics, CoflnetSkyMayorModelsModelElectionPeriod, AuctionPreview } from '../../../api/_generated/skyApi.schemas' import { hasHighEnoughPremium, PREMIUM_RANK } from '../../../utils/PremiumTypeUtils' +import NitroAdSlot from '../../Ads/NitroAdSlot' const HOUR_IN_MS = 60 * 60 * 1000 @@ -153,7 +154,7 @@ function AuctionHousePriceGraph(props: Props) { updateChart(DateRange.YEAR, itemFilter) } }) - .catch(() => {}) + .catch(() => { }) } const now = new Date() @@ -163,9 +164,9 @@ function AuctionHousePriceGraph(props: Props) { const mayorParams = fetchspan === DateRange.YEAR ? { - from: currentMayorFrom.toISOString(), - to: currentMayorTo.toISOString() - } + from: currentMayorFrom.toISOString(), + to: currentMayorTo.toISOString() + } : undefined const mayorQuery = useGetApiMayor(mayorParams, { query: { enabled: fetchspan === DateRange.YEAR } }) @@ -329,11 +330,11 @@ function AuctionHousePriceGraph(props: Props) { if ( !mounted || currentLoadingString !== - JSON.stringify({ - tag: props.item.tag, - fetchspan, - itemFilter - }) + JSON.stringify({ + tag: props.item.tag, + fetchspan, + itemFilter + }) ) { return } @@ -365,7 +366,7 @@ function AuctionHousePriceGraph(props: Props) { let mayorData = await api.getMayorData(minDate, maxDate) setMayorData(mayorData) applyMayorDataToChart(chartOptions, mayorData, 4) - } catch (e) {} + } catch (e) { } setAvgPrice(Math.round(priceSum / prices.length)) setNoDataFound(prices.length === 0) @@ -514,8 +515,9 @@ function AuctionHousePriceGraph(props: Props) { graphOverlayElement )} -
- +
+
+
Avg Price:{' '} {isLoading ? ( '-' @@ -524,10 +526,17 @@ function AuctionHousePriceGraph(props: Props) { Coins )} - +
+ +
+ + +
- {/* Year Statistics Section */} {fetchspan === DateRange.YEAR && yearStatistics && (
📊 Statistics Summary
@@ -606,17 +615,20 @@ function AuctionHousePriceGraph(props: Props) { )}
)} - -
-
-
- - -
-
+
@@ -631,12 +643,12 @@ function AuctionHousePriceGraph(props: Props) { yearRecentSamples={ fetchspan === DateRange.YEAR && yearStatistics ? (yearStatistics.recentSamples || yearStatistics.recentAuctions || []).map(s => ({ - end: s.end ? new Date(s.end) : new Date(), - price: s.price, - seller: { name: s.seller || '', uuid: '', iconUrl: undefined }, - uuid: s.uuid || '', - playerName: s.playerName || '' - })) + end: s.end ? new Date(s.end) : new Date(), + price: s.price, + seller: { name: s.seller || '', uuid: '', iconUrl: undefined }, + uuid: s.uuid || '', + playerName: s.playerName || '' + })) : undefined } isYearView={fetchspan === DateRange.YEAR} diff --git a/components/PriceGraph/BazaarPriceGraph/BazaarPriceGraph.module.css b/components/PriceGraph/BazaarPriceGraph/BazaarPriceGraph.module.css index 1e3f7a61..68f30cb8 100644 --- a/components/PriceGraph/BazaarPriceGraph/BazaarPriceGraph.module.css +++ b/components/PriceGraph/BazaarPriceGraph/BazaarPriceGraph.module.css @@ -25,14 +25,14 @@ } .chartWrapperSingle { - height: 60vh; + height: 55vh; width: 100%; margin-top: 10px; margin-bottom: 50px; } .chartWrapperSplit { - height: 30vh; + height: 27.5vh; width: 100%; margin-bottom: 50px; } diff --git a/components/PriceGraph/BazaarPriceGraph/BazaarPriceGraph.tsx b/components/PriceGraph/BazaarPriceGraph/BazaarPriceGraph.tsx index e5836596..7e862083 100644 --- a/components/PriceGraph/BazaarPriceGraph/BazaarPriceGraph.tsx +++ b/components/PriceGraph/BazaarPriceGraph/BazaarPriceGraph.tsx @@ -19,8 +19,8 @@ import BazaarSnapshot from './BazaarSnapshot/BazaarSnapshot' import getPriceGraphConfigSingle from './PriceGraphConfigSingle' import getPriceGraphConfigSplit from './PriceGraphConfigSplit' import { applyMayorDataToChart } from '../../../utils/GraphUtils' -import { toast } from 'react-toastify' import SubscribeButton from '../../SubscribeButton/SubscribeButton' +import NitroAdSlot from '../../Ads/NitroAdSlot' interface Props { item: Item @@ -304,11 +304,11 @@ function BazaarPriceGraph(props: Props) { fetchspan === DateRange.HOUR ? item.sellData.price?.toFixed(2) : [ - item.sellData.price?.toFixed(2), - prices[i + 1] ? prices[i + 1].sellData.price?.toFixed(2) : item.sellData.price?.toFixed(2), - item.sellData.min?.toFixed(2), - item.sellData.max?.toFixed(2) - ] + item.sellData.price?.toFixed(2), + prices[i + 1] ? prices[i + 1].sellData.price?.toFixed(2) : item.sellData.price?.toFixed(2), + item.sellData.min?.toFixed(2), + item.sellData.max?.toFixed(2) + ] ) chartOptionsPrimary.series[6].data.push(item.sellData.min?.toFixed(2)) chartOptionsPrimary.series[7].data.push(item.sellData.max?.toFixed(2)) @@ -325,11 +325,11 @@ function BazaarPriceGraph(props: Props) { fetchspan === DateRange.HOUR ? item.sellData.price?.toFixed(2) : [ - item.sellData.price?.toFixed(2), - prices[i + 1] ? prices[i + 1].sellData.price?.toFixed(2) : item.sellData.price?.toFixed(2), - item.sellData.min?.toFixed(2), - item.sellData.max?.toFixed(2) - ] + item.sellData.price?.toFixed(2), + prices[i + 1] ? prices[i + 1].sellData.price?.toFixed(2) : item.sellData.price?.toFixed(2), + item.sellData.min?.toFixed(2), + item.sellData.max?.toFixed(2) + ] ) chartOptionsSecondary.series[1].data.push(item.sellData.min?.toFixed(2)) chartOptionsSecondary.series[2].data.push(item.sellData.max?.toFixed(2)) @@ -459,7 +459,22 @@ function BazaarPriceGraph(props: Props) {
+ +