fix type error, move xtrends hook location

This commit is contained in:
Kalle (Sendou) 2021-03-09 13:23:12 +02:00
parent ca8c288810
commit 9ab84e754f
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import { Trans } from "@lingui/macro";
import ModeSelector from "components/common/ModeSelector";
import HeaderBanner from "components/layout/HeaderBanner";
import { useMyTheme } from "hooks/common";
import { useXTrends } from "hooks/xtrends";
import { useXTrends } from "../hooks/useXTrends";
import { XTrends } from "../service";
import TrendTier from "./TrendTier";

View File

@ -1,6 +1,6 @@
import { RankedMode } from "@prisma/client";
import { XTrends } from "app/xrank/service";
import { getMonthOptions } from "pages/xsearch/[[...slug]]";
import { GetXTrendsData } from "prisma/queries/getXTrends";
import { Dispatch, useMemo, useReducer } from "react";
interface XTrendsState {
@ -22,7 +22,7 @@ type Action =
export type XTrendsDispatch = Dispatch<Action>;
export function useXTrends(trends: GetXTrendsData) {
export function useXTrends(trends: XTrends) {
const getLatestYear = () =>
parseInt(Object.keys(trends).sort((a, b) => parseInt(b) - parseInt(a))[0]);
const getLatestMonth = () =>