Skip to content

Commit

Permalink
Reduce ChallengeModalBody parameter type requirements for the parent …
Browse files Browse the repository at this point in the history
…container to just what's needed
  • Loading branch information
anoek committed Oct 14, 2024
1 parent 6f6f682 commit 6fee9dc
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/components/ChallengeModal/ChallengeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,26 @@ export class ChallengeModal extends Modal<Events, ChallengeModalProperties, any>
}

export class ChallengeModalBody extends React.Component<
ChallengeModalProperties & { modal: ChallengeModal },
ChallengeModalProperties & {
modal: {
close: () => void;
on: (event: "open" | "close", callback: () => void) => void;
off: (event: "open" | "close", callback: () => void) => void;
};
},
any
> {
ref: React.RefObject<HTMLDivElement> = React.createRef();

constructor(props: ChallengeModalProperties & { modal: ChallengeModal }) {
constructor(
props: ChallengeModalProperties & {
modal: {
close: () => void;
on: (event: "open" | "close", callback: () => void) => void;
off: (event: "open" | "close", callback: () => void) => void;
};
},
) {
super(props);

const speed = data.get("challenge.speed", "live");
Expand Down

0 comments on commit 6fee9dc

Please sign in to comment.