mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-06-30 22:26:38 -04:00
export prop types from component files
This commit is contained in:
@ -2,7 +2,7 @@ import classNames from "classnames";
|
||||
|
||||
import styles from "./Blockquote.module.css";
|
||||
|
||||
type BlockquoteProps = JSX.IntrinsicElements["blockquote"];
|
||||
export type BlockquoteProps = JSX.IntrinsicElements["blockquote"];
|
||||
|
||||
const Blockquote = ({ className, ...rest }: BlockquoteProps) => (
|
||||
<blockquote className={classNames(styles.blockquote, className)} {...rest} />
|
||||
|
@ -3,7 +3,7 @@ import Head from "next/head";
|
||||
import { useTheme } from "next-themes";
|
||||
import HCaptcha from "@hcaptcha/react-hcaptcha";
|
||||
|
||||
type CaptchaProps = {
|
||||
export type CaptchaProps = {
|
||||
size?: "normal" | "compact" | "invisible";
|
||||
theme?: "light" | "dark";
|
||||
id?: string;
|
||||
|
@ -3,7 +3,7 @@ import CopyButton from "../CopyButton/CopyButton";
|
||||
|
||||
import styles from "./CodeBlock.module.css";
|
||||
|
||||
type CodeBlockProps = JSX.IntrinsicElements["code"] & {
|
||||
export type CodeBlockProps = JSX.IntrinsicElements["code"] & {
|
||||
forceBlock?: boolean;
|
||||
};
|
||||
|
||||
|
@ -3,7 +3,7 @@ import css from "styled-jsx/css";
|
||||
import classNames from "classnames";
|
||||
import Link, { CustomLinkProps } from "../Link/Link";
|
||||
|
||||
type ColorfulLinkProps = CustomLinkProps & {
|
||||
export type ColorfulLinkProps = CustomLinkProps & {
|
||||
lightColor: string;
|
||||
darkColor: string;
|
||||
};
|
||||
|
@ -7,7 +7,7 @@ import type { GiscusProps } from "@giscus/react";
|
||||
|
||||
import styles from "./Comments.module.css";
|
||||
|
||||
type CommentsProps = JSX.IntrinsicElements["div"] & {
|
||||
export type CommentsProps = JSX.IntrinsicElements["div"] & {
|
||||
title: string;
|
||||
};
|
||||
|
||||
|
@ -16,7 +16,7 @@ type Values = {
|
||||
"h-captcha-response": string;
|
||||
};
|
||||
|
||||
type ContactFormProps = {
|
||||
export type ContactFormProps = {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,7 @@ import classNames from "classnames";
|
||||
|
||||
import styles from "./Content.module.css";
|
||||
|
||||
type ContentProps = JSX.IntrinsicElements["div"];
|
||||
export type ContentProps = JSX.IntrinsicElements["div"];
|
||||
|
||||
const Content = ({ className, ...rest }: ContentProps) => (
|
||||
<div className={classNames(styles.content, className)} {...rest} />
|
||||
|
@ -7,7 +7,7 @@ import type { ReactNode, Ref } from "react";
|
||||
|
||||
import styles from "./CopyButton.module.css";
|
||||
|
||||
type CopyButtonProps = {
|
||||
export type CopyButtonProps = {
|
||||
source: ReactNode;
|
||||
timeout?: number;
|
||||
className?: string;
|
||||
|
@ -6,7 +6,7 @@ import type { ImageProps as NextImageProps } from "next/image";
|
||||
|
||||
import styles from "./Figure.module.css";
|
||||
|
||||
type FigureProps = Omit<NextImageProps, "alt"> &
|
||||
export type FigureProps = Omit<NextImageProps, "alt"> &
|
||||
PropsWithChildren<{
|
||||
alt?: string; // becomes optional -- pulled from plaintext-ified caption if missing
|
||||
}>;
|
||||
|
@ -6,7 +6,7 @@ import * as config from "../../lib/config";
|
||||
|
||||
import styles from "./Footer.module.css";
|
||||
|
||||
type FooterProps = JSX.IntrinsicElements["footer"];
|
||||
export type FooterProps = JSX.IntrinsicElements["footer"];
|
||||
|
||||
const Footer = ({ className, ...rest }: FooterProps) => (
|
||||
<footer className={classNames(styles.footer, className)} {...rest}>
|
||||
|
@ -5,7 +5,7 @@ import Menu from "../Menu/Menu";
|
||||
|
||||
import styles from "./Header.module.css";
|
||||
|
||||
type HeaderProps = JSX.IntrinsicElements["header"] & {
|
||||
export type HeaderProps = JSX.IntrinsicElements["header"] & {
|
||||
sticky?: boolean;
|
||||
};
|
||||
|
||||
|
@ -4,7 +4,7 @@ import type { HTMLAttributes } from "react";
|
||||
|
||||
import styles from "./Heading.module.css";
|
||||
|
||||
type HeadingProps = HTMLAttributes<HTMLHeadingElement> & {
|
||||
export type HeadingProps = HTMLAttributes<HTMLHeadingElement> & {
|
||||
as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,7 @@ import useSWR from "swr";
|
||||
import Loading from "../Loading/Loading";
|
||||
import { fetcher } from "../../lib/fetcher";
|
||||
|
||||
type HitCounterProps = {
|
||||
export type HitCounterProps = {
|
||||
slug: string;
|
||||
className?: string;
|
||||
};
|
||||
|
@ -2,7 +2,7 @@ import classNames from "classnames";
|
||||
|
||||
import styles from "./HorizontalRule.module.css";
|
||||
|
||||
type HorizontalRuleProps = JSX.IntrinsicElements["hr"];
|
||||
export type HorizontalRuleProps = JSX.IntrinsicElements["hr"];
|
||||
|
||||
const HorizontalRule = ({ className, ...rest }: HorizontalRuleProps) => (
|
||||
<hr className={classNames(styles.hr, className)} {...rest} />
|
||||
|
@ -2,7 +2,7 @@ import classNames from "classnames";
|
||||
|
||||
import styles from "./IFrame.module.css";
|
||||
|
||||
type IFrameProps = JSX.IntrinsicElements["iframe"] & {
|
||||
export type IFrameProps = JSX.IntrinsicElements["iframe"] & {
|
||||
src: string;
|
||||
height: number;
|
||||
width?: number; // defaults to 100%
|
||||
|
@ -8,7 +8,7 @@ import themes, { toCSS } from "../../lib/config/themes";
|
||||
|
||||
import styles from "./Layout.module.css";
|
||||
|
||||
type LayoutProps = JSX.IntrinsicElements["div"] & {
|
||||
export type LayoutProps = JSX.IntrinsicElements["div"] & {
|
||||
container?: boolean; // pass false to disable default `<main>` container styles with padding, etc.
|
||||
stickyHeader?: boolean; // pass false to override default stickiness of header when scrolling
|
||||
};
|
||||
|
@ -3,7 +3,7 @@ import classNames from "classnames";
|
||||
|
||||
import styles from "./Loading.module.css";
|
||||
|
||||
type LoadingProps = {
|
||||
export type LoadingProps = {
|
||||
width: number; // of entire container, in pixels
|
||||
boxes?: number; // total number of boxes (default: 3)
|
||||
timing?: number; // staggered timing between each box's pulse, in seconds (default: 0.1s)
|
||||
|
@ -6,7 +6,7 @@ import { menuLinks } from "../../lib/config/menu";
|
||||
|
||||
import styles from "./Menu.module.css";
|
||||
|
||||
type MenuProps = {
|
||||
export type MenuProps = {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
|
@ -8,7 +8,7 @@ import type { NoteMetaType } from "../../types";
|
||||
import styles from "./NoteMeta.module.css";
|
||||
import Link from "next/link";
|
||||
|
||||
type NoteMetaProps = Pick<NoteMetaType, "slug" | "date" | "title" | "tags">;
|
||||
export type NoteMetaProps = Pick<NoteMetaType, "slug" | "date" | "title" | "tags">;
|
||||
|
||||
const NoteMeta = ({ slug, date, title, tags = [] }: NoteMetaProps) => (
|
||||
<div className={styles.meta}>
|
||||
|
@ -4,7 +4,7 @@ import type { NoteMetaType } from "../../types";
|
||||
|
||||
import styles from "./NoteTitle.module.css";
|
||||
|
||||
type NoteTitleProps = Pick<NoteMetaType, "slug" | "htmlTitle"> & JSX.IntrinsicElements["h1"];
|
||||
export type NoteTitleProps = Pick<NoteMetaType, "slug" | "htmlTitle"> & JSX.IntrinsicElements["h1"];
|
||||
|
||||
const NoteTitle = ({ slug, htmlTitle, className, ...rest }: NoteTitleProps) => (
|
||||
<h1 className={classNames(styles.title, className)} {...rest}>
|
||||
|
@ -4,7 +4,7 @@ import type { NoteMetaType } from "../../types";
|
||||
|
||||
import styles from "./NotesList.module.css";
|
||||
|
||||
type NotesListProps = {
|
||||
export type NotesListProps = {
|
||||
notesByYear: Record<string, NoteMetaType[]>;
|
||||
};
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { OctocatOcticon } from "../Icons";
|
||||
|
||||
import styles from "./OctocatLink.module.css";
|
||||
|
||||
type OctocatLinkProps = JSX.IntrinsicElements["a"] & {
|
||||
export type OctocatLinkProps = JSX.IntrinsicElements["a"] & {
|
||||
repo: string;
|
||||
};
|
||||
|
||||
|
@ -5,7 +5,7 @@ import { baseUrl } from "../../lib/config";
|
||||
|
||||
import styles from "./PageTitle.module.css";
|
||||
|
||||
type PageTitleProps = JSX.IntrinsicElements["h1"];
|
||||
export type PageTitleProps = JSX.IntrinsicElements["h1"];
|
||||
|
||||
const PageTitle = ({ className, children, ...rest }: PageTitleProps) => {
|
||||
const router = useRouter();
|
||||
|
@ -6,7 +6,7 @@ import type { RepoType } from "../../types";
|
||||
|
||||
import styles from "./RepositoryCard.module.css";
|
||||
|
||||
type RepositoryCardProps = RepoType & {
|
||||
export type RepositoryCardProps = RepoType & {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
|
@ -7,7 +7,7 @@ import styles from "./Selfie.module.css";
|
||||
|
||||
import selfieJpg from "../../public/static/images/selfie.jpg";
|
||||
|
||||
type SelfieProps = {
|
||||
export type SelfieProps = {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
|
@ -4,7 +4,7 @@ import type { Ref } from "react";
|
||||
|
||||
import styles from "./Terminal.module.css";
|
||||
|
||||
type TerminalProps = JSX.IntrinsicElements["div"];
|
||||
export type TerminalProps = JSX.IntrinsicElements["div"];
|
||||
|
||||
// a DOS-style terminal box with dynamic text
|
||||
const Terminal = forwardRef(function Terminal({ className, ...rest }: TerminalProps, ref: Ref<HTMLSpanElement>) {
|
||||
|
@ -4,7 +4,7 @@ import { SunIcon, MoonIcon } from "../Icons";
|
||||
|
||||
import styles from "./ThemeToggle.module.css";
|
||||
|
||||
type ThemeToggleProps = {
|
||||
export type ThemeToggleProps = {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Tweet from "react-tweet-embed";
|
||||
|
||||
type TweetEmbedProps = {
|
||||
export type TweetEmbedProps = {
|
||||
id: string;
|
||||
options?: object;
|
||||
className?: string;
|
||||
|
@ -5,7 +5,7 @@ import Terminal from "../Terminal/Terminal";
|
||||
|
||||
import styles from "./VNC.module.css";
|
||||
|
||||
type VNCProps = {
|
||||
export type VNCProps = {
|
||||
server: string;
|
||||
};
|
||||
|
||||
|
@ -4,7 +4,7 @@ import type { FilePlayerProps } from "react-player/file";
|
||||
|
||||
import styles from "./Video.module.css";
|
||||
|
||||
type VideoProps = Partial<FilePlayerProps> & {
|
||||
export type VideoProps = Partial<FilePlayerProps> & {
|
||||
webm?: string;
|
||||
mp4?: string;
|
||||
thumbnail?: string;
|
||||
|
@ -3,7 +3,7 @@ import classNames from "classnames";
|
||||
|
||||
import styles from "./Wallpaper.module.css";
|
||||
|
||||
type WallpaperProps = JSX.IntrinsicElements["main"] & {
|
||||
export type WallpaperProps = JSX.IntrinsicElements["main"] & {
|
||||
image: string;
|
||||
tile?: boolean;
|
||||
};
|
||||
|
@ -4,7 +4,7 @@ import type { YouTubePlayerProps } from "react-player/youtube";
|
||||
|
||||
import styles from "./YouTubeEmbed.module.css";
|
||||
|
||||
type YouTubeEmbedProps = Partial<YouTubePlayerProps> & {
|
||||
export type YouTubeEmbedProps = Partial<YouTubePlayerProps> & {
|
||||
id: string;
|
||||
className?: string;
|
||||
};
|
||||
|
Reference in New Issue
Block a user