Skip to content

Commit 7841b4c

Browse files
committed
cleanup
1 parent bccd46a commit 7841b4c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

frontend/src/components/cfp-form/materials-section.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
MultiplePartsCard,
99
Spacer,
1010
Text,
11-
VerticalStack,
1211
} from "@python-italia/pycon-styleguide";
1312
import { useCallback } from "react";
1413
import { FormattedMessage } from "react-intl";
@@ -26,18 +25,19 @@ type Props = {
2625
submission: SubmissionStructure;
2726
};
2827

28+
const MAX_MATERIALS = 3;
29+
2930
export const MaterialsSection = ({
3031
formState,
3132
getErrors,
32-
formOptions,
3333
submission,
3434
}: Props) => {
3535
const materials = formState.values.materials ?? [];
3636

3737
const onAddFile = useCallback(
38-
(e) => {
38+
(e: React.MouseEvent<HTMLButtonElement>) => {
3939
e.preventDefault();
40-
if (materials.length >= 3) {
40+
if (materials.length >= MAX_MATERIALS) {
4141
return;
4242
}
4343

@@ -53,9 +53,9 @@ export const MaterialsSection = ({
5353
);
5454

5555
const onAddURL = useCallback(
56-
(e) => {
56+
(e: React.MouseEvent<HTMLButtonElement>) => {
5757
e.preventDefault();
58-
if (materials.length >= 3) {
58+
if (materials.length >= MAX_MATERIALS) {
5959
return;
6060
}
6161

@@ -152,14 +152,14 @@ export const MaterialsSection = ({
152152
<Button
153153
size="small"
154154
onClick={onAddFile}
155-
disabled={materials.length >= 3}
155+
disabled={materials.length >= MAX_MATERIALS}
156156
>
157157
<FormattedMessage id="cfp.materials.addFile" />
158158
</Button>
159159
<Button
160160
size="small"
161161
onClick={onAddURL}
162-
disabled={materials.length >= 3}
162+
disabled={materials.length >= MAX_MATERIALS}
163163
>
164164
<FormattedMessage id="cfp.materials.addURL" />
165165
</Button>

0 commit comments

Comments
 (0)