diff --git a/src/components/buttons/IconButton.tsx b/src/components/buttons/IconButton.tsx index cc1845e..7fbe79a 100644 --- a/src/components/buttons/IconButton.tsx +++ b/src/components/buttons/IconButton.tsx @@ -2,8 +2,8 @@ import Image from 'next/future/image'; import { PropsWithChildren } from 'react'; export interface IconButtonProps { - width: number; - height: number; + width?: number; + height?: number; classes?: string; onClick?: () => void; disabled?: boolean; @@ -13,7 +13,8 @@ export interface IconButtonProps { } export function IconButton(props: PropsWithChildren) { - const { width, height, classes, onClick, imgSrc, disabled, title, passThruProps } = props; + const { width, height, classes, onClick, imgSrc, disabled, title, children, passThruProps } = + props; const base = 'flex items-center justify-center transition-all'; const onHover = 'hover:opacity-70'; @@ -31,6 +32,7 @@ export function IconButton(props: PropsWithChildren) { {...passThruProps} > {title + {children} ); } diff --git a/src/components/icons/BigChevron.tsx b/src/components/icons/BigChevron.tsx new file mode 100644 index 0000000..92399f0 --- /dev/null +++ b/src/components/icons/BigChevron.tsx @@ -0,0 +1,49 @@ +import { memo } from 'react'; + +import { Color } from '../../styles/Color'; + +interface Props { + width?: string | number; + height?: string | number; + direction: 'n' | 'e' | 's' | 'w'; + color?: string; + classes?: string; +} + +function _BigChevron({ width, height, direction, color, classes }: Props) { + let directionClass; + switch (direction) { + case 'n': + directionClass = '-rotate-90'; + break; + case 'e': + directionClass = ''; + break; + case 's': + directionClass = 'rotate-90'; + break; + case 'w': + directionClass = 'rotate-180'; + break; + default: + throw new Error(`Invalid chevron direction ${direction}`); + } + + return ( + + + + ); +} + +export const BigChevron = memo(_BigChevron); diff --git a/src/components/input/SelectField.tsx b/src/components/input/SelectField.tsx index 70ebcd0..a551092 100644 --- a/src/components/input/SelectField.tsx +++ b/src/components/input/SelectField.tsx @@ -19,7 +19,7 @@ export function SelectField(props: Props) { return (