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

clean up type definitions

This commit is contained in:
2022-01-30 22:04:25 -05:00
parent f0259dbab5
commit 7a3ea4924c
7 changed files with 13 additions and 23 deletions

View File

@@ -62,8 +62,11 @@
background-color: var(--link); background-color: var(--link);
} }
.btn_submit .send_icon { .send_icon {
margin-right: var(--rounded-edge-radius); width: 1.2em;
height: 1.2em;
vertical-align: -0.2em;
margin-right: 0.4em;
} }
.result_icon { .result_icon {

View File

@@ -9,7 +9,6 @@ import styles from "./Figure.module.css";
type Props = Omit<NextImageProps, "alt"> & type Props = Omit<NextImageProps, "alt"> &
PropsWithChildren<{ PropsWithChildren<{
alt?: string; // becomes optional -- pulled from plaintext-ified caption if missing alt?: string; // becomes optional -- pulled from plaintext-ified caption if missing
className?: string;
}>; }>;
const Figure = ({ children, alt, className, ...imageProps }: Props) => { const Figure = ({ children, alt, className, ...imageProps }: Props) => {

View File

@@ -5,8 +5,6 @@ import styles from "./Heading.module.css";
type Props = HTMLAttributes<HTMLHeadingElement> & { type Props = HTMLAttributes<HTMLHeadingElement> & {
as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
id?: string;
className?: string;
}; };
const Heading = ({ as: Component, id, className, children, ...rest }: Props) => { const Heading = ({ as: Component, id, className, children, ...rest }: Props) => {

View File

@@ -1,10 +1,9 @@
import classNames from "classnames"; import classNames from "classnames";
import type { HTMLAttributes } from "react";
import styles from "./HorizontalRule.module.css"; import styles from "./HorizontalRule.module.css";
type Props = { type Props = HTMLAttributes<HTMLHRElement>;
className?: string;
};
const HorizontalRule = ({ className, ...rest }: Props) => <hr className={classNames(styles.hr, className)} {...rest} />; const HorizontalRule = ({ className, ...rest }: Props) => <hr className={classNames(styles.hr, className)} {...rest} />;

View File

@@ -1,15 +1,13 @@
import classNames from "classnames"; import classNames from "classnames";
import { IframeHTMLAttributes } from "react";
import styles from "./IFrame.module.css"; import styles from "./IFrame.module.css";
type Props = { type Props = IframeHTMLAttributes<HTMLElement> & {
src: string;
title?: string;
height: number; height: number;
width?: number; // defaults to 100% width?: number; // defaults to 100%
allowScripts?: boolean; allowScripts?: boolean;
noScroll?: boolean; noScroll?: boolean;
className?: string;
}; };
const IFrame = ({ src, title, height, width, allowScripts, noScroll, className, ...rest }: Props) => ( const IFrame = ({ src, title, height, width, allowScripts, noScroll, className, ...rest }: Props) => (

View File

@@ -9,10 +9,7 @@ import styles from "./Link.module.css";
export type Props = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & export type Props = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> &
LinkProps & LinkProps &
PropsWithChildren<{ PropsWithChildren<{
target?: string;
rel?: string;
forceNewWindow?: boolean; forceNewWindow?: boolean;
className?: string;
}>; }>;
const CustomLink = ({ const CustomLink = ({

View File

@@ -1,20 +1,16 @@
import classNames from "classnames"; import classNames from "classnames";
import type { PropsWithChildren } from "react"; import type { HTMLAttributes } from "react";
import styles from "./List.module.css"; import styles from "./List.module.css";
type Props = PropsWithChildren<{ export const UnorderedList = ({ className, ...rest }: HTMLAttributes<HTMLUListElement>) => (
className?: string;
}>;
export const UnorderedList = ({ className, ...rest }: Props) => (
<ul className={classNames(styles.unordered, className)} {...rest} /> <ul className={classNames(styles.unordered, className)} {...rest} />
); );
export const OrderedList = ({ className, ...rest }: Props) => ( export const OrderedList = ({ className, ...rest }: HTMLAttributes<HTMLOListElement>) => (
<ol className={classNames(styles.ordered, className)} {...rest} /> <ol className={classNames(styles.ordered, className)} {...rest} />
); );
// TODO: this is based on good faith that the children are all `<li>`s... // TODO: this is based on good faith that the children are all `<li>`s...
export const ListItem = ({ className, ...rest }: Props) => ( export const ListItem = ({ className, ...rest }: HTMLAttributes<HTMLLIElement>) => (
<li className={classNames(styles.item, className)} {...rest} /> <li className={classNames(styles.item, className)} {...rest} />
); );