1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-06-30 22:06:38 -04:00

remove unnecessary PropsWithChildren

This commit is contained in:
2022-02-09 11:05:48 -05:00
parent 3801989a5b
commit 8385e011c5
7 changed files with 79 additions and 86 deletions

View File

@ -3,15 +3,13 @@ import { useTheme } from "next-themes";
import classNames from "classnames";
import { Giscus } from "@giscus/react";
import { giscusConfig } from "../../lib/config";
import type { PropsWithChildren } from "react";
import type { GiscusProps } from "@giscus/react";
import styles from "./Comments.module.css";
type CommentsProps = JSX.IntrinsicElements["div"] &
PropsWithChildren<{
title: string;
}>;
type CommentsProps = JSX.IntrinsicElements["div"] & {
title: string;
};
const Comments = ({ title, className, ...rest }: CommentsProps) => {
const { resolvedTheme } = useTheme();

View File

@ -5,14 +5,12 @@ import classNames from "classnames";
import Header from "../Header/Header";
import Footer from "../Footer/Footer";
import themes, { toCSS } from "../../lib/themes";
import type { PropsWithChildren } from "react";
import styles from "./Layout.module.css";
type LayoutProps = JSX.IntrinsicElements["div"] &
PropsWithChildren<{
noContainer?: boolean; // pass true to disable default `<main>` container styles with padding, etc.
}>;
type LayoutProps = JSX.IntrinsicElements["div"] & {
noContainer?: boolean; // pass true to disable default `<main>` container styles with padding, etc.
};
const Layout = ({ noContainer, className, children, ...rest }: LayoutProps) => {
const { resolvedTheme } = useTheme();

View File

@ -1,16 +1,14 @@
import NextLink from "next/link";
import classNames from "classnames";
import isAbsoluteUrl from "is-absolute-url";
import type { PropsWithChildren } from "react";
import type { LinkProps as NextLinkProps } from "next/link";
import styles from "./Link.module.css";
export type CustomLinkProps = Omit<JSX.IntrinsicElements["a"], "href"> &
NextLinkProps &
PropsWithChildren<{
NextLinkProps & {
forceNewWindow?: boolean;
}>;
};
const CustomLink = ({
href,

View File

@ -1,15 +1,13 @@
import { useEffect, useRef } from "react";
import classNames from "classnames/bind";
import type { PropsWithChildren } from "react";
import styles from "./Wallpaper.module.css";
const cx = classNames.bind(styles);
type WallpaperProps = JSX.IntrinsicElements["div"] &
PropsWithChildren<{
image: string;
tile?: boolean;
}>;
type WallpaperProps = JSX.IntrinsicElements["div"] & {
image: string;
tile?: boolean;
};
const Wallpaper = ({ image, tile, className, ...rest }: WallpaperProps) => {
const bgRef = useRef<HTMLDivElement>(null);