Skip to content

Commit

Permalink
Bump deps + Next 15
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Nov 18, 2024
1 parent d88f053 commit 79a0193
Show file tree
Hide file tree
Showing 57 changed files with 443 additions and 299 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";
import { use } from "react";

import BadgeImage from "@peated/web/components/badgeImage";
import { Breadcrumbs } from "@peated/web/components/breadcrumbs";
Expand All @@ -11,11 +12,11 @@ import PageHeader from "@peated/web/components/pageHeader";
import Tabs, { TabItem } from "@peated/web/components/tabs";
import { trpc } from "@peated/web/lib/trpc/client";

export default function Page({
params: { badgeId },
}: {
params: { badgeId: string };
}) {
export default function Page(props: { params: Promise<{ badgeId: string }> }) {
const params = use(props.params);

const { badgeId } = params;

const [badge] = trpc.badgeById.useSuspenseQuery(parseInt(badgeId, 10));

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";
import { use } from "react";

import { Breadcrumbs } from "@peated/web/components/breadcrumbs";
import Button from "@peated/web/components/button";
Expand All @@ -11,11 +12,11 @@ import PageHeader from "@peated/web/components/pageHeader";
import Tabs, { TabItem } from "@peated/web/components/tabs";
import { trpc } from "@peated/web/lib/trpc/client";

export default function Page({
params: { eventId },
}: {
params: { eventId: string };
}) {
export default function Page(props: { params: Promise<{ eventId: string }> }) {
const params = use(props.params);

const { eventId } = params;

const [event] = trpc.eventById.useSuspenseQuery(parseInt(eventId, 10));

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ import Link from "@peated/web/components/link";
import PageHeader from "@peated/web/components/pageHeader";
import Tabs, { TabItem } from "@peated/web/components/tabs";
import { trpc } from "@peated/web/lib/trpc/client";
import { type ReactNode } from "react";
import { type ReactNode, use } from "react";

export default function Page({
params: { countrySlug },
children,
}: {
params: { countrySlug: string };
export default function Page(props: {
params: Promise<{ countrySlug: string }>;
children: ReactNode;
}) {
const params = use(props.params);

const { countrySlug } = params;

const { children } = props;

const [country] = trpc.countryBySlug.useSuspenseQuery(countrySlug);

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
"use client";
import { use } from "react";

import Table from "@peated/web/components/table";
import useApiQueryParams from "@peated/web/hooks/useApiQueryParams";
import { trpc } from "@peated/web/lib/trpc/client";

export default function Page({
params: { countrySlug },
}: {
params: { countrySlug: string };
export default function Page(props: {
params: Promise<{ countrySlug: string }>;
}) {
const params = use(props.params);

const { countrySlug } = params;

const queryParams = useApiQueryParams({
defaults: {
sort: "-created",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
"use client";
import { use } from "react";

import { Breadcrumbs } from "@peated/web/components/breadcrumbs";
import Button from "@peated/web/components/button";
import PageHeader from "@peated/web/components/pageHeader";
import { trpc } from "@peated/web/lib/trpc/client";

export default function Page({
params: { countrySlug, regionSlug },
}: {
params: { countrySlug: string; regionSlug: string };
export default function Page(props: {
params: Promise<{ countrySlug: string; regionSlug: string }>;
}) {
const params = use(props.params);

const { countrySlug, regionSlug } = params;

const [country] = trpc.countryBySlug.useSuspenseQuery(countrySlug);
const [region] = trpc.regionBySlug.useSuspenseQuery({
country: countrySlug,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
"use client";
import { use } from "react";

import { type ExternalSiteType } from "@peated/server/types";
import StorePriceTable from "@peated/web/components/admin/storePriceTable";
import EmptyActivity from "@peated/web/components/emptyActivity";
import useApiQueryParams from "@peated/web/hooks/useApiQueryParams";
import { trpc } from "@peated/web/lib/trpc/client";

export default function Page({
params: { siteId },
}: {
params: { siteId: ExternalSiteType };
export default function Page(props: {
params: Promise<{ siteId: ExternalSiteType }>;
}) {
const params = use(props.params);

const { siteId } = params;

const queryParams = useApiQueryParams({
numericFields: ["cursor", "limit"],
overrides: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
"use client";
import { use } from "react";

import { type ExternalSiteType } from "@peated/server/types";
import ReviewTable from "@peated/web/components/admin/reviewTable";
import EmptyActivity from "@peated/web/components/emptyActivity";
import useApiQueryParams from "@peated/web/hooks/useApiQueryParams";
import { trpc } from "@peated/web/lib/trpc/client";

export default function Page({
params: { siteId },
}: {
params: { siteId: ExternalSiteType };
export default function Page(props: {
params: Promise<{ siteId: ExternalSiteType }>;
}) {
const params = use(props.params);

const { siteId } = params;

const queryParams = useApiQueryParams({
overrides: {
site: siteId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Tabs, { TabItem } from "@peated/web/components/tabs";
import TimeSince from "@peated/web/components/timeSince";
import { formatDuration } from "@peated/web/lib/format";
import { trpc } from "@peated/web/lib/trpc/client";
import { useState, type ReactNode } from "react";
import { use, useState, type ReactNode } from "react";
import { type z } from "zod";

type UpdateSiteFn = (data: z.infer<typeof ExternalSiteSchema>) => void;
Expand Down Expand Up @@ -43,13 +43,16 @@ function TriggerJobButton({
);
}

export default function Layout({
params: { siteId },
children,
}: {
params: { siteId: string };
export default function Layout(props: {
params: Promise<{ siteId: string }>;
children: ReactNode;
}) {
const params = use(props.params);

const { siteId } = params;

const { children } = props;

const [initialSite] = trpc.externalSiteByType.useSuspenseQuery(
siteId as ExternalSiteType,
);
Expand Down
11 changes: 6 additions & 5 deletions apps/web/src/app/(admin)/admin/(default)/tags/[tagId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
"use client";
import { use } from "react";

import { toTitleCase } from "@peated/server/lib/strings";
import { Breadcrumbs } from "@peated/web/components/breadcrumbs";
import Button from "@peated/web/components/button";
import { trpc } from "@peated/web/lib/trpc/client";

export default function Page({
params: { tagId },
}: {
params: { tagId: string };
}) {
export default function Page(props: { params: Promise<{ tagId: string }> }) {
const params = use(props.params);

const { tagId } = params;

const [tag] = trpc.tagByName.useSuspenseQuery(tagId);

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";
import { use } from "react";

import BadgeForm from "@peated/web/components/admin/badgeForm";
import { useFlashMessages } from "@peated/web/components/flash";
Expand All @@ -8,11 +9,11 @@ import { logError } from "@peated/web/lib/log";
import { trpc } from "@peated/web/lib/trpc/client";
import { useRouter } from "next/navigation";

export default function Page({
params: { badgeId },
}: {
params: { badgeId: string };
}) {
export default function Page(props: { params: Promise<{ badgeId: string }> }) {
const params = use(props.params);

const { badgeId } = params;

const [badge] = trpc.badgeById.useSuspenseQuery(parseInt(badgeId, 10));

const router = useRouter();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"use client";
import { use } from "react";

import EventForm from "@peated/web/components/admin/eventForm";
import { trpc } from "@peated/web/lib/trpc/client";
import { useRouter } from "next/navigation";

export default function Page({
params: { eventId },
}: {
params: { eventId: string };
}) {
export default function Page(props: { params: Promise<{ eventId: string }> }) {
const params = use(props.params);

const { eventId } = params;

const [event] = trpc.eventById.useSuspenseQuery(parseInt(eventId, 10));

const router = useRouter();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
"use client";
import { use } from "react";

import CountryForm from "@peated/web/components/admin/countryForm";
import { useModRequired } from "@peated/web/hooks/useAuthRequired";
import { trpc } from "@peated/web/lib/trpc/client";
import { useRouter, useSearchParams } from "next/navigation";

export default function Page({
params: { countrySlug },
}: {
params: { countrySlug: string };
export default function Page(props: {
params: Promise<{ countrySlug: string }>;
}) {
const params = use(props.params);

const { countrySlug } = params;

useModRequired();

const [country] = trpc.countryBySlug.useSuspenseQuery(countrySlug);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
"use client";
import { use } from "react";

import RegionForm from "@peated/web/components/admin/regionForm";
import { useModRequired } from "@peated/web/hooks/useAuthRequired";
import { trpc } from "@peated/web/lib/trpc/client";
import { useRouter, useSearchParams } from "next/navigation";

export default function Page({
params: { countrySlug, regionSlug },
}: {
params: { countrySlug: string; regionSlug: string };
export default function Page(props: {
params: Promise<{ countrySlug: string; regionSlug: string }>;
}) {
const params = use(props.params);

const { countrySlug, regionSlug } = params;

useModRequired();

const [region] = trpc.regionBySlug.useSuspenseQuery({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
"use client";
import { use } from "react";

import { type ExternalSiteType } from "@peated/server/types";
import SiteForm from "@peated/web/components/admin/siteForm";
import { trpc } from "@peated/web/lib/trpc/client";
import { useRouter } from "next/navigation";

export default function Page({
params: { siteId },
}: {
params: { siteId: ExternalSiteType };
export default function Page(props: {
params: Promise<{ siteId: ExternalSiteType }>;
}) {
const params = use(props.params);

const { siteId } = params;

const [site] = trpc.externalSiteByType.useSuspenseQuery(siteId);

const router = useRouter();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"use client";
import { use } from "react";

import TagForm from "@peated/web/components/admin/tagForm";
import { trpc } from "@peated/web/lib/trpc/client";
import { useRouter } from "next/navigation";

export default function Page({
params: { tagId },
}: {
params: { tagId: string };
}) {
export default function Page(props: { params: Promise<{ tagId: string }> }) {
const params = use(props.params);

const { tagId } = params;

const [tag] = trpc.tagByName.useSuspenseQuery(tagId);

const router = useRouter();
Expand Down
20 changes: 12 additions & 8 deletions apps/web/src/app/(default)/badges/[badgeId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import { getTrpcClient } from "@peated/web/lib/trpc/client.server";
import { Suspense } from "react";
import Leaderboard from "./leaderboard";

export async function generateMetadata({
params: { badgeId },
}: {
params: { badgeId: string };
export async function generateMetadata(props: {
params: Promise<{ badgeId: string }>;
}) {
const params = await props.params;

const { badgeId } = params;

const trpcClient = await getTrpcClient();
const badge = await trpcClient.badgeById.fetch(parseInt(badgeId, 10));

Expand All @@ -19,11 +21,13 @@ export async function generateMetadata({
};
}

export default async function Page({
params: { badgeId },
}: {
params: { badgeId: string };
export default async function Page(props: {
params: Promise<{ badgeId: string }>;
}) {
const params = await props.params;

const { badgeId } = params;

if (!(await isLoggedIn())) {
return redirectToAuth({ pathname: `/badges/${badgeId}` });
}
Expand Down
Loading

0 comments on commit 79a0193

Please sign in to comment.