Skip to content

Commit fa9ad67

Browse files
committed
Fix flood of TSC errors
1 parent 33332ee commit fa9ad67

File tree

5 files changed

+20
-22
lines changed

5 files changed

+20
-22
lines changed

resources/scripts/components/dashboard/forms/DisableTOTPDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const DisableTOTPDialog = () => {
4848
type={'password'}
4949
variant={Input.Text.Variants.Loose}
5050
value={password}
51-
onChange={(e) => setPassword(e.currentTarget.value)}
51+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPassword(e.currentTarget.value)}
5252
/>
5353
<Dialog.Footer>
5454
<Button.Text onClick={close}>Cancel</Button.Text>

resources/scripts/components/dashboard/forms/SetupTOTPDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const ConfigureTwoFactorForm = ({ onTokens }: Props) => {
8181
aria-labelledby={'totp-code-description'}
8282
variant={Input.Text.Variants.Loose}
8383
value={value}
84-
onChange={(e) => setValue(e.currentTarget.value)}
84+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setValue(e.currentTarget.value)}
8585
className={'mt-3'}
8686
placeholder={'000000'}
8787
type={'text'}
@@ -97,7 +97,7 @@ const ConfigureTwoFactorForm = ({ onTokens }: Props) => {
9797
className={'mt-1'}
9898
type={'password'}
9999
value={password}
100-
onChange={(e) => setPassword(e.currentTarget.value)}
100+
onChange={(e: React.ChangeEvent<HTMLInputElement>) => setPassword(e.currentTarget.value)}
101101
/>
102102
<Dialog.Footer>
103103
<Button.Text onClick={close}>Cancel</Button.Text>

resources/scripts/components/elements/Translate.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2-
import { Trans, TransProps, useTranslation } from 'react-i18next';
2+
import { Trans, TransSelectorProps, useTranslation } from 'react-i18next';
33

4-
type Props = Omit<TransProps, 't'>;
4+
type Props = Omit<TransSelectorProps<any, any>, 't'>;
55

66
export default ({ ns, children, ...props }: Props) => {
77
const { t } = useTranslation(ns);

resources/scripts/components/elements/inputs/InputField.tsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,20 @@ enum Variant {
88
Loose,
99
}
1010

11-
interface InputFieldProps extends React.ComponentProps<'input'> {
12-
variant?: Variant;
13-
}
14-
15-
const Component = forwardRef<HTMLInputElement, InputFieldProps>(({ className, variant, ...props }, ref) => (
16-
<input
17-
ref={ref}
18-
className={classNames(
19-
'form-input',
20-
styles.text_input,
21-
{ [styles.loose]: variant === Variant.Loose },
22-
className
23-
)}
24-
{...props}
25-
/>
26-
));
11+
const Component = forwardRef<HTMLInputElement, React.ComponentProps<'input'> & { variant?: Variant }>(
12+
({ className, variant, ...props }, ref) => (
13+
<input
14+
ref={ref}
15+
className={classNames(
16+
'form-input',
17+
styles.text_input,
18+
{ [styles.loose]: variant === Variant.Loose },
19+
className
20+
)}
21+
{...props}
22+
/>
23+
)
24+
);
2725

2826
const InputField = Object.assign(Component, { Variants: Variant });
2927

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"target": "es2015",
44
"module": "es2020",
5-
"jsx": "react",
5+
"jsx": "react-jsx",
66
"moduleResolution": "node",
77
"lib": [
88
"es2015",

0 commit comments

Comments
 (0)