Skip to content

Commit 479bae3

Browse files
author
John Goodliff
committed
Fix type errors
1 parent 66ffca6 commit 479bae3

File tree

16 files changed

+34
-35
lines changed

16 files changed

+34
-35
lines changed

src/components/alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function Alert(props: { statusMsg: StatusMsg }) {
6969
{...animationProps}
7070
>
7171
<div>
72-
<Icon icon={alertTypes[type].icon} tw="mr-2 fa-lg" />
72+
<Icon icon={alertTypes[type].icon} className="mr-2 fa-lg" />
7373
<span>{props.statusMsg.getMsg}</span>
7474
</div>
7575
</motion.div>

src/components/buttons/icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function IconButton(props: {
1414
type="button"
1515
onClick={props.onClick}
1616
>
17-
<Icon icon={props.icon} tw="fa-lg" />
17+
<Icon icon={props.icon} className="fa-lg" />
1818
</button>
1919
);
2020
}

src/components/buttons/primary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Icon } from '../icon.tsx';
33

44
type Props = {
55
icon: IconDefinition;
6-
fake: boolean;
6+
fake?: boolean;
77
onClick?: () => void;
88
children: string;
99
};

src/components/dropzones/large.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function LargeDropzone(props: {
1616
onFilesAdded={props.onFilesAdded}
1717
>
1818
<div className="z-20 flex-col flex-1 gap-8 justify-center p-8 m-8 text-center rounded-lg border-2 border-dashed bg-base-100 hover:bg-base-200">
19-
<Icon icon={faFileCirclePlus} tw="fa-3x" />
19+
<Icon icon={faFileCirclePlus} className="fa-3x" />
2020
<p className="flex-grow-0">
2121
Drag and drop PDF files here, or click to select files
2222
</p>

src/components/dropzones/wrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { ChangeEvent, ReactNode } from 'react';
22
import { ignoreDefault } from '../../common/utilities';
33

44
type Props = {
5-
className: string;
5+
className?: string;
66
children: ReactNode;
77
onFilesAdded: (files: FileList) => void;
88
};

src/components/icon.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
22
import type { IconDefinition } from '@fortawesome/free-solid-svg-icons';
33

4+
type Props = {
5+
className?: string;
6+
icon: IconDefinition;
7+
};
8+
49
/**
510
* A basic icon component
611
*/
7-
export function Icon(props: { tw?: string; icon: IconDefinition }) {
8-
return <FontAwesomeIcon icon={props.icon} className={props.tw} />;
12+
export function Icon({ className = '', icon }: Props) {
13+
return <FontAwesomeIcon icon={icon} className={className} />;
914
}

src/components/layout/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from '../../common/utilities.ts';
99

1010
type Props = {
11-
className: string;
11+
className?: string;
1212
title: string;
1313
children: ReactNode;
1414
};

src/components/layout/page-layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '../../common/utilities.ts';
1212

1313
type Props = {
14-
className: string;
14+
className?: string;
1515
metadata: MetadataInterface;
1616
children: ReactNode;
1717
};

src/components/layout/section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ReactNode } from 'react';
22

33
type Props = {
4-
className: string;
4+
className?: string;
55
visible: boolean;
66
children: ReactNode;
77
};

src/components/links/icon-button.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@ import type { ReactNode } from 'react';
33
import { Icon } from '../icon.tsx';
44
import { LinkWrapper } from './wrapper.tsx';
55

6-
/**
7-
* An icon button link
8-
*/
9-
export function IconButtonLink(props: {
6+
type Props = {
107
to: string;
118
icon: IconDefinition;
129
isInternal?: boolean;
1310
rel?: string;
1411
children: ReactNode;
15-
}) {
12+
};
13+
14+
/**
15+
* An icon button link
16+
*/
17+
export function IconButtonLink({ to, icon, isInternal, rel, children }: Props) {
1618
return (
17-
<LinkWrapper to={props.to} isInternal={props.isInternal} rel={props.rel}>
19+
<LinkWrapper to={to} isInternal={isInternal} rel={rel}>
1820
<div className="flex-nowrap flex-none gap-2 p-0 btn-ghost text-secondary sm:p-4">
19-
<Icon icon={props.icon} />
20-
{props.children}
21+
<Icon icon={icon} />
22+
{children}
2123
</div>
2224
</LinkWrapper>
2325
);

0 commit comments

Comments
 (0)