Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHORE] use our radix-themes fork + Nextjs 15 upgrade #76

Merged
merged 15 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"plugins": ["eslint-plugin-react-compiler"],
"rules": {
"react-compiler/react-compiler": "error"
}
}
9 changes: 6 additions & 3 deletions app/CustomThemeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ import {
Theme,
Tooltip,
useThemeContext,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";
import React, { FC } from "react";
import { radiusPropDef, themePropDefs } from "@radix-ui/themes/dist/esm/props";
import {
radiusPropDef,
themePropDefs,
} from "@v1s10n_4/radix-ui-themes/dist/esm/props";
import InvertIcon from "pixelarticons/svg/invert.svg";
import ChessIcon from "pixelarticons/svg/chess.svg";
import MoonIcon from "pixelarticons/svg/moon.svg";
import SunIcon from "pixelarticons/svg/sun.svg";
import { getMatchingGrayColor } from "@radix-ui/themes/dist/esm/helpers";
import { getMatchingGrayColor } from "@v1s10n_4/radix-ui-themes/dist/esm/helpers";

export const CustomThemeForm: FC<ThemeContext> = ({
appearance,
Expand Down
2 changes: 1 addition & 1 deletion app/CustomThemePopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
IconButtonProps,
Popover,
useThemeContext,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";
import Fill from "pixelarticons/svg/fill.svg";
import FillHalf from "pixelarticons/svg/fill-half.svg";
import CloseIcon from "pixelarticons/svg/close.svg";
Expand Down
2 changes: 1 addition & 1 deletion app/RootDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
RadioCards,
Text,
useThemeContext,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";
import { usePathname, useRouter } from "next/navigation";
import ChatIcon from "pixelarticons/svg/chat.svg";
import ListIcon from "pixelarticons/svg/list.svg";
Expand Down
2 changes: 1 addition & 1 deletion app/RootNav.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import { Card } from "@/components/Card";
import Icon from "@/components/Icon/Icon";
import { Box, Flex, RadioCards, Tooltip } from "@radix-ui/themes";
import { Box, Flex, RadioCards, Tooltip } from "@v1s10n_4/radix-ui-themes";
import { usePathname, useRouter } from "next/navigation";
import ChatIcon from "pixelarticons/svg/chat.svg";
import ListIcon from "pixelarticons/svg/list.svg";
Expand Down
2 changes: 1 addition & 1 deletion app/account/CardForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import { CardContent, CardFooter } from "@/components/Card";
import SubmitButton from "@/components/SubmitButton";
import { Separator, Text } from "@radix-ui/themes";
import { Separator, Text } from "@v1s10n_4/radix-ui-themes";
import React, { FC, PropsWithChildren, useActionState } from "react";
import { SafeParseSuccess } from "zod";
import { typeToFlattenedError } from "zod/lib/ZodError";
Expand Down
2 changes: 1 addition & 1 deletion app/account/ProfileHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { signOutAction } from "@/app/actions";
import { Card } from "@/components/Card";
import { HitPlaceholder } from "@/components/Placeholder";
import { User } from "@/db";
import { Avatar, Button, Flex, Heading, Text } from "@radix-ui/themes";
import { Avatar, Button, Flex, Heading, Text } from "@v1s10n_4/radix-ui-themes";
import Image from "next/image";
import LogOutIcon from "pixelarticons/svg/logout.svg";
import React, { FC } from "react";
Expand Down
2 changes: 1 addition & 1 deletion app/account/QRCodeDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Spinner,
Tooltip,
VisuallyHidden,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";
import { toString } from "qrcode";
import React, { FC, Suspense } from "react";

Expand Down
8 changes: 7 additions & 1 deletion app/account/ReferralLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import QRCodeDrawer from "@/app/account/QRCodeDrawer";
import CopyButton from "@/components/CopyButton";
import { db, User } from "@/db";
import { referralLinks } from "@/db/schema/referral_links";
import { Card, Flex, IconButton, Spinner, Text } from "@radix-ui/themes";
import {
Card,
Flex,
IconButton,
Spinner,
Text,
} from "@v1s10n_4/radix-ui-themes";
import { and, desc, eq } from "drizzle-orm";
import React, { FC, Suspense } from "react";

Expand Down
8 changes: 7 additions & 1 deletion app/account/ReviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ import {
import { HitPlaceholder } from "@/components/Placeholder";
import { ReviewTask, User } from "@/db";
import { canReviewOwnContribution } from "@/lib/utils";
import { Callout, Flex, Link as RLink, Strong, Text } from "@radix-ui/themes";
import {
Callout,
Flex,
Link as RLink,
Strong,
Text,
} from "@v1s10n_4/radix-ui-themes";
import Image from "next/image";
import Link from "next/link";
import ArrowRight from "pixelarticons/svg/arrow-right.svg";
Expand Down
2 changes: 1 addition & 1 deletion app/account/ReviewsCarousel.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";
import { Carousel, CarouselApi, CarouselContent } from "@/components/Carousel";
import { SliderActions } from "@/components/SliderActions";
import { Badge } from "@radix-ui/themes";
import { Badge } from "@v1s10n_4/radix-ui-themes";
import React, { FC, PropsWithChildren } from "react";

export const ReviewsCarousel: FC<PropsWithChildren> = ({ children }) => {
Expand Down
2 changes: 1 addition & 1 deletion app/account/ReviewsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
Skeleton,
Tabs,
Text,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";
import React, { FC, Suspense } from "react";

type ReviewsSectionProps = { user: User };
Expand Down
2 changes: 1 addition & 1 deletion app/account/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
Section,
Separator,
TextField,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";

import React, { FC, Suspense } from "react";

Expand Down
8 changes: 7 additions & 1 deletion app/account/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ import {
import SubmitButton from "@/components/SubmitButton";
import { Invader, ReviewTask, User } from "@/db";
import { getState } from "@/utils/data";
import { Flex, Inset, Separator, Skeleton, Text } from "@radix-ui/themes";
import {
Flex,
Inset,
Separator,
Skeleton,
Text,
} from "@v1s10n_4/radix-ui-themes";
import React, { FC } from "react";

export const ReferralLinkSkeleton = () => (
Expand Down
1 change: 1 addition & 0 deletions app/api/get-thumbnail/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NextRequest } from "next/server";
import sharp from "sharp";

export const runtime = "nodejs";
export const dynamic = "force-static";
export async function GET(request: NextRequest): Promise<Response> {
const param = request.nextUrl.searchParams.get("url");
if (!param) return Response.json({ error: true, data: null });
Expand Down
1 change: 1 addition & 0 deletions app/api/invaders/[invaderName]/OG/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ImageResponse } from "next/og";
import { NextRequest } from "next/server";

export const runtime = "edge";
export const dynamic = "force-static";

type RouteParams = { params: { invaderName: string } };

Expand Down
1 change: 1 addition & 0 deletions app/api/invaders/[invaderName]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { eq } from "drizzle-orm";
import { NextRequest } from "next/server";

export const runtime = "edge";
export const dynamic = "force-static";

type RouteParams = { params: { invaderName: string } };

Expand Down
1 change: 1 addition & 0 deletions app/api/invaders/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { db } from "@/db";
import { invaders } from "@/db/schema/invaders";

export const runtime = "edge";
export const dynamic = "force-static";

export async function GET(): Promise<Response> {
const list = await db.select().from(invaders);
Expand Down
1 change: 1 addition & 0 deletions app/api/map/invaders/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { invaders } from "@/db/schema/invaders";
import { isNotNull } from "drizzle-orm";

export const runtime = "edge";
export const dynamic = "force-static";

export async function GET(): Promise<Response> {
const list = await db
Expand Down
2 changes: 1 addition & 1 deletion app/auth-error/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from "@radix-ui/themes";
import { Button } from "@v1s10n_4/radix-ui-themes";
import Link from "next/link";

export type ErrorPageParam = "Configuration" | "AccessDenied" | "Verification";
Expand Down
2 changes: 1 addition & 1 deletion app/fesse/InvalidateTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { invalidateTag } from "@/app/fesse/actions";
import SubmitButton from "@/components/SubmitButton";
import { TagName } from "@/utils/revalidation-tags";
import { Text, TextField } from "@radix-ui/themes";
import { Text, TextField } from "@v1s10n_4/radix-ui-themes";
import Repeat from "pixelarticons/svg/repeat.svg";
import { FC, useActionState } from "react";

Expand Down
2 changes: 1 addition & 1 deletion app/globals.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "tailwindcss/base";
@import "@radix-ui/themes/styles.css";
@import "@v1s10n_4/radix-ui-themes/styles.css";

@tailwind components;
@tailwind utilities;
Expand Down
2 changes: 1 addition & 1 deletion app/help/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Separator,
Text,
TextArea,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";
import { Metadata } from "next";
import { redirect } from "next/navigation";

Expand Down
2 changes: 1 addition & 1 deletion app/help/thanks/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Heading,
Section,
Text,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";

export const runtime = "edge";

Expand Down
2 changes: 1 addition & 1 deletion app/highscores/HighscoreItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HighScore } from "@/types/FlashInvadersAPI";
import { Table } from "@radix-ui/themes";
import { Table } from "@v1s10n_4/radix-ui-themes";

export const HighscoreItem = ({
rank,
Expand Down
8 changes: 7 additions & 1 deletion app/highscores/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import SubmitButton from "@/components/SubmitButton";
import { Container, Flex, Heading, Section, TextField } from "@radix-ui/themes";
import {
Container,
Flex,
Heading,
Section,
TextField,
} from "@v1s10n_4/radix-ui-themes";
import { redirect } from "next/navigation";
import Search from "pixelarticons/svg/search.svg";
import { FC, PropsWithChildren } from "react";
Expand Down
2 changes: 1 addition & 1 deletion app/highscores/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getRandomLengthString } from "@/app/highscores/utils";
import { Skeleton, Table } from "@radix-ui/themes";
import { Skeleton, Table } from "@v1s10n_4/radix-ui-themes";

const HighscoresLoading = () => (
<Table.Root variant="surface">
Expand Down
2 changes: 1 addition & 1 deletion app/highscores/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import HighscoreItem from "@/app/highscores/HighscoreItem";
import { FlashInvadersAPI } from "@/app/highscores/utils";
import { HighScoresResponse } from "@/types/FlashInvadersAPI";
import { getRequestConfig } from "@/utils/revalidation-tags";
import { Table } from "@radix-ui/themes";
import { Table } from "@v1s10n_4/radix-ui-themes";

const getHighScores: () => Promise<HighScoresResponse> = async () => {
const { highscores, fetchOptions } = FlashInvadersAPI;
Expand Down
2 changes: 1 addition & 1 deletion app/highscores/search/[userName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import HighscoreItem from "@/app/highscores/HighscoreItem";
import { FlashInvadersAPI } from "@/app/highscores/utils";
import { UserSearchResponse } from "@/types/FlashInvadersAPI";
import { getRequestConfig } from "@/utils/revalidation-tags";
import { Table } from "@radix-ui/themes";
import { Table } from "@v1s10n_4/radix-ui-themes";

type Params = { params: { userName: string } };
export const revalidate = 0;
Expand Down
2 changes: 1 addition & 1 deletion app/highscores/search/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Flex } from "@radix-ui/themes";
import { Button, Flex } from "@v1s10n_4/radix-ui-themes";
import Link from "next/link";
import { FC, PropsWithChildren } from "react";

Expand Down
3 changes: 2 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Skeleton,
Text,
Theme,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { clsx } from "clsx";
Expand All @@ -20,6 +20,7 @@ import localFont from "next/font/local";
import React, { ReactNode, Suspense } from "react";

export const runtime = "edge";
export const fetchCache = "default-cache";

const sixtyfour = localFont({
// src: "../public/assets/fonts/Sixtyfour[BLED,SCAN].woff2",
Expand Down
2 changes: 1 addition & 1 deletion app/list/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
MenuBarSeparator,
MenuBarTrigger,
} from "@/components/MenuBar";
import { Badge, Text } from "@radix-ui/themes";
import { Badge, Text } from "@v1s10n_4/radix-ui-themes";
import { clsx } from "clsx";
import BuildingCommunity from "pixelarticons/svg/building-community.svg";
import Coin from "pixelarticons/svg/coin.svg";
Expand Down
4 changes: 2 additions & 2 deletions app/list/InvaderHit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Text,
Tooltip,
VisuallyHidden,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";
import { Hit } from "instantsearch.js";
import Link from "next/link";
import Image from "next/image";
Expand All @@ -27,7 +27,7 @@ export const InvaderHit = ({
create_date,
}: Hit<Invader>) => {
return (
<Card elevation className="group carousel-item" asChild>
<Card elevation className="carousel-item group" asChild>
<Flex direction="column" gap="2" p="2" asChild>
<Link href={`/map/${name}`} key={name}>
<div className="relative w-full">
Expand Down
2 changes: 1 addition & 1 deletion app/list/InvaderList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import InvaderHit from "@/app/list/InvaderHit";
import { SkeletonHit } from "@/app/list/SkeletonHit";
import { Invader } from "@/db";
import { Grid, ScrollArea } from "@radix-ui/themes";
import { Grid, ScrollArea } from "@v1s10n_4/radix-ui-themes";
import React, { useEffect, useState } from "react";
import useInfiniteScroll from "react-infinite-scroll-hook";
import {
Expand Down
4 changes: 2 additions & 2 deletions app/list/SkeletonHit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Text,
Tooltip,
VisuallyHidden,
} from "@radix-ui/themes";
} from "@v1s10n_4/radix-ui-themes";
import BuildingCommunity from "pixelarticons/svg/building-community.svg";
import ImageFlash from "pixelarticons/svg/image-flash.svg";
import React, { FC, PropsWithChildren } from "react";
Expand All @@ -18,7 +18,7 @@ export const SkeletonHit: FC<{ index: number } & PropsWithChildren> = ({
children,
}) => {
return (
<Card elevation className="group carousel-item" asChild>
<Card elevation className="carousel-item group" asChild>
<Flex direction="column" gap="2" p="2">
<div className="relative w-full">
<Skeleton>
Expand Down
2 changes: 1 addition & 1 deletion app/list/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import FilterMenu from "@/app/list/FilterMenu";
import { SearchInput } from "@/components/SearchInput";
import { createFetchRequester } from "@algolia/requester-fetch";
import { Flex, Separator } from "@radix-ui/themes";
import { Flex, Separator } from "@v1s10n_4/radix-ui-themes";
import algoliasearch from "algoliasearch/lite";
import React, { FC, PropsWithChildren } from "react";
import { InstantSearchNext } from "react-instantsearch-nextjs";
Expand Down
2 changes: 1 addition & 1 deletion app/list/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SkeletonHit } from "@/app/list/SkeletonHit";
import { Grid, ScrollArea } from "@radix-ui/themes";
import { Grid, ScrollArea } from "@v1s10n_4/radix-ui-themes";
import React from "react";

export const runtime = "edge";
Expand Down
2 changes: 1 addition & 1 deletion app/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Flex, Spinner } from "@radix-ui/themes";
import { Flex, Spinner } from "@v1s10n_4/radix-ui-themes";
import React from "react";

export const runtime = "edge";
Expand Down
Loading