mirror of
https://github.com/Xevion/xevion.dev.git
synced 2025-12-07 18:08:57 -06:00
Update Next.js to v15, overhaul ESLint, minor reformat, misc
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { readItems } from "@directus/sdk";
|
||||
import { type NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import React, { useEffect } from "react";
|
||||
import ItemCard from "../components/ItemCard";
|
||||
import { getPlaiceholder } from "plaiceholder";
|
||||
import { useBreakpointValue } from "../utils/helpers";
|
||||
import type { Project } from "../utils/types";
|
||||
import Link from "next/link";
|
||||
import { getPlaiceholder } from "plaiceholder";
|
||||
import { useEffect } from "react";
|
||||
import Balancer from "react-wrap-balancer";
|
||||
import AppWrapper from "../components/AppWrapper";
|
||||
import ItemCard from "../components/ItemCard";
|
||||
import directus from "../utils/directus";
|
||||
import { readItems } from "@directus/sdk";
|
||||
import { useBreakpointValue } from "../utils/helpers";
|
||||
import type { Project } from "../utils/types";
|
||||
|
||||
type ProjectWithBlur = Project & { bannerBlur: string };
|
||||
|
||||
@@ -94,7 +94,7 @@ export async function getStaticProps() {
|
||||
|
||||
return {
|
||||
props: {
|
||||
tagline: metadata.tagline,
|
||||
tagline: metadata[0]!.tagline,
|
||||
projects: await Promise.all(
|
||||
projects.map(async (project) => {
|
||||
const { base64 } = await getPlaiceholder(project.banner, {
|
||||
@@ -126,9 +126,8 @@ const Home: NextPage<HomeStaticProps> = ({
|
||||
|
||||
// use-tailwind-breakpoint
|
||||
useEffect(() => {
|
||||
typeof window !== "undefined"
|
||||
? window.dispatchEvent(new Event("resize"))
|
||||
: null;
|
||||
if (typeof window !== "undefined")
|
||||
window.dispatchEvent(new Event("resize"));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import { type inferAsyncReturnType } from "@trpc/server";
|
||||
import { type CreateNextContextOptions } from "@trpc/server/adapters/next";
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { createDirectus, rest } from "@directus/sdk";
|
||||
|
||||
export type Schema = {
|
||||
export interface Schema {
|
||||
metadata: Metadata[];
|
||||
};
|
||||
}
|
||||
|
||||
export type Metadata = {
|
||||
export interface Metadata {
|
||||
tagline: string;
|
||||
};
|
||||
}
|
||||
|
||||
const directus = createDirectus<Schema>("https://api.xevion.dev").with(rest());
|
||||
|
||||
|
||||
@@ -1,25 +1,28 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import create from "@kodingdotninja/use-tailwind-breakpoint";
|
||||
import resolveConfig from "tailwindcss/resolveConfig";
|
||||
import tailwindConfig from "./../../tailwind.config.cjs";
|
||||
|
||||
export function classNames(...classes: (string | null | undefined)[]) {
|
||||
return classes.filter(Boolean).join(" ");
|
||||
return classes.filter(Boolean).join(" ");
|
||||
}
|
||||
|
||||
const isClient = (): boolean => {
|
||||
return typeof window !== "undefined";
|
||||
}
|
||||
return typeof window !== "undefined";
|
||||
};
|
||||
|
||||
const isServer = (): boolean => {
|
||||
return !isClient();
|
||||
}
|
||||
return !isClient();
|
||||
};
|
||||
|
||||
const hoverableQuery: MediaQueryList | null = isClient() ? window.matchMedia('(hover: hover) and (pointer: fine)') : null;
|
||||
const hoverableQuery: MediaQueryList | null = isClient()
|
||||
? window.matchMedia("(hover: hover) and (pointer: fine)")
|
||||
: null;
|
||||
|
||||
export function isHoverable() {
|
||||
return hoverableQuery?.matches;
|
||||
return hoverableQuery?.matches;
|
||||
}
|
||||
|
||||
|
||||
const config = resolveConfig(tailwindConfig);
|
||||
export const {useBreakpoint, useBreakpointValue, useBreakpointEffect} = create(config.theme!.screens);
|
||||
export const { useBreakpoint, useBreakpointValue, useBreakpointEffect } =
|
||||
create(config.theme!.screens);
|
||||
|
||||
Reference in New Issue
Block a user