Skip to content

Commit 0f517f1

Browse files
author
Vlad Lo.
committed
fix tsc lint issues
1 parent 36771fb commit 0f517f1

File tree

13 files changed

+77
-44
lines changed

13 files changed

+77
-44
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"typecheck-staged": "tsc-files --noEmit",
1818
"lint": "npm run lint:js && npm run lint:style",
1919
"lint:js": "eslint . --ext js,jsx,ts,tsx --max-warnings=5",
20-
"lint:style": "stylelint \"src/**/*.css\" --fix",
20+
"lint:style": "stylelint 'src/**/*.css' --fix",
2121
"lint:fix": "npm run lint:js -- --fix",
2222
"format": "prettier --write '{blog,docs,src,static}/**/*.{md,mdx,ts,js,tsx,jsx,json}'"
2323
},

src/components/ParserOpenRPC/AuthBox/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export const AuthBox = ({ handleConnect }: AuthBoxProps) => {
1414
eventName: "Connect wallet",
1515
clickType: "Connect wallet",
1616
userExperience: "B",
17+
responseStatus: null,
18+
responseMsg: null,
19+
timestamp: Date.now(),
1720
});
1821
handleConnect();
1922
}

src/components/ParserOpenRPC/InteractiveBox/fields/ConditionalField.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const ConditionalField = (props: FieldTemplateProps) => {
1616
isComplexTypeView,
1717
setIsComplexTypeView,
1818
} = useContext(ParserOpenRPCContext);
19+
// @ts-ignore
1920
const { formData, schema, name, onChange } = props;
2021
const listItems = schema?.anyOf ? schema?.anyOf : schema?.oneOf;
2122
const checkForNullTypeSchema = (type) => type === "null";
@@ -27,14 +28,17 @@ export const ConditionalField = (props: FieldTemplateProps) => {
2728
};
2829
const onDropdownOptionClick = (e) => {
2930
const selectedSchema = listItems.find(
30-
({ title }) => title === e.target.dataset.value
31+
// @ts-ignore
32+
({ title }) => title === e.target.dataset.value,
3133
);
34+
// @ts-ignore
3235
const isNullTypeSchema = checkForNullTypeSchema(selectedSchema?.type);
3336
if (isNullTypeSchema) {
3437
onChange(null);
3538
} else {
3639
setSelectedTypeSchema(
37-
listItems.find(({ title }) => title === e.target.dataset.value)
40+
// @ts-ignore
41+
listItems.find(({ title }) => title === e.target.dataset.value),
3842
);
3943
showComplexTypeView();
4044
}
@@ -80,7 +84,7 @@ export const ConditionalField = (props: FieldTemplateProps) => {
8084
<span
8185
className={clsx(
8286
styles.tableColumnType,
83-
styles.tableColumnTypeDropdown
87+
styles.tableColumnTypeDropdown,
8488
)}
8589
onClick={() => {
8690
setIsOpened(!isOpened);
@@ -93,30 +97,32 @@ export const ConditionalField = (props: FieldTemplateProps) => {
9397
styles.tableColumnIcon,
9498
styles.chevronIcon,
9599
styles.dropdownChevronIcon,
96-
!isOpened && styles.chevronIconDown
100+
!isOpened && styles.chevronIconDown,
97101
)}
98102
/>
99103
<span
100104
className={clsx(
101105
styles.chevronIcon,
102106
styles.dropdownChevronIcon,
103-
!isOpened && styles.chevronIconDown
107+
!isOpened && styles.chevronIconDown,
104108
)}
105109
/>
106110
</span>
107111
<ul
108112
className={clsx(
109113
styles.dropdownList,
110-
!isOpened && styles.dropdownListClosed
114+
!isOpened && styles.dropdownListClosed,
111115
)}
112116
>
113117
{listItems?.map((listItem, index) => (
114118
<li
115119
className={styles.dropdownItem}
116120
key={index}
117121
onClick={onDropdownOptionClick}
122+
// @ts-ignore
118123
data-value={listItem.title}
119124
>
125+
{/* @ts-ignore */}
120126
{listItem.title}
121127
</li>
122128
))}
@@ -131,8 +137,10 @@ export const ConditionalField = (props: FieldTemplateProps) => {
131137
selectedTypeSchema.type !== "null" ? (
132138
<div className={styles.tableComplexType}>
133139
{selectedTypeSchema?.enum ? (
140+
// @ts-ignore
134141
<SelectWidget {...selectWidgetProps} />
135142
) : (
143+
// @ts-ignore
136144
<BaseInputTemplate {...baseInputProps} />
137145
)}
138146
</div>

src/components/ParserOpenRPC/InteractiveBox/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export default function InteractiveBox({
136136
schemas: components,
137137
},
138138
type: "object",
139+
// @ts-ignore
139140
properties: Object.fromEntries(
140141
params.map(({ name, schema }) => [name, schema])
141142
),
@@ -160,7 +161,9 @@ export default function InteractiveBox({
160161
SelectWidget: SelectWidget,
161162
};
162163
const fields: RegistryFieldsType = {
164+
// @ts-ignore
163165
AnyOfField: ConditionalField,
166+
// @ts-ignore
164167
OneOfField: ConditionalField,
165168
};
166169
const handleResetForm = (e) => {

src/components/ParserOpenRPC/InteractiveBox/templates/ArrayFieldTemplate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const ArrayFieldTemplate = ({
2222
setIsComplexTypeView,
2323
} = useContext(ParserOpenRPCContext);
2424
const { collapsed, toggleCollapsed } = useCollapsible({ initialState: true });
25+
// @ts-ignore
2526
const itemsType = schema?.items?.type;
2627
const isSimpleArray =
2728
itemsType === "string" ||

src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export const BaseInputTemplate = ({
113113
styles.formControlNumberDown
114114
)}
115115
onClick={() => {
116+
// @ts-ignore
116117
inputValue >= 1 &&
117118
onInputNumberChange(Number((+inputValue || 0) - 1));
118119
}}

src/components/ParserOpenRPC/InteractiveBox/templates/WrapIfAdditionalTemplate.tsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useContext, useEffect } from "react";
2-
import { ADDITIONAL_PROPERTY_FLAG } from '@rjsf/utils';
2+
import { ADDITIONAL_PROPERTY_FLAG } from "@rjsf/utils";
33
import { BaseInputTemplate } from "@site/src/components/ParserOpenRPC/InteractiveBox/templates/BaseInputTemplate";
44
import { ParserOpenRPCContext } from "@site/src/components/ParserOpenRPC";
5-
import * as isObject from "lodash.isobject"
5+
import * as isObject from "lodash.isobject";
66

77
export const WrapIfAdditionalTemplate = (props) => {
88
const {
@@ -18,19 +18,24 @@ export const WrapIfAdditionalTemplate = (props) => {
1818
children,
1919
registry,
2020
formContext,
21-
formData
21+
formData,
2222
} = props;
2323
const { templates } = registry;
2424
const { RemoveButton } = templates.ButtonTemplates;
2525
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
26-
const { drawerLabel, isComplexTypeView, setIsComplexTypeView, setDrawerLabel } = useContext(ParserOpenRPCContext);
26+
const {
27+
drawerLabel,
28+
isComplexTypeView,
29+
setIsComplexTypeView,
30+
setDrawerLabel,
31+
} = useContext(ParserOpenRPCContext);
2732
const { currentSchemaId, setCurrentSchemaId } = formContext;
2833
const onRemoveButtonClick = () => {
2934
if (isObject(formData) && Object.keys(formData).length === 0) {
3035
setIsComplexTypeView(false);
3136
setDrawerLabel(null);
3237
}
33-
}
38+
};
3439

3540
if (!additional) {
3641
return (
@@ -50,8 +55,8 @@ export const WrapIfAdditionalTemplate = (props) => {
5055
return null;
5156
}
5257

53-
return (
54-
isComplexTypeView ? <div className={classNames} style={style}>
58+
return isComplexTypeView ? (
59+
<div className={classNames} style={style}>
5560
{drawerLabel === label && (
5661
<div>
5762
<div onClick={onRemoveButtonClick}>
@@ -61,19 +66,20 @@ export const WrapIfAdditionalTemplate = (props) => {
6166
registry={registry}
6267
/>
6368
</div>
69+
{/* @ts-ignore */}
6470
<BaseInputTemplate
65-
name='key'
71+
name="key"
6672
onChange={(target) => {
6773
onKeyChange(target);
6874
setDrawerLabel(target);
6975
}}
70-
schema={{...schema, ...{ type: "string" }}}
76+
schema={{ ...schema, ...{ type: "string" } }}
7177
formContext={formContext}
7278
value={label}
7379
/>
7480
</div>
7581
)}
7682
<div>{children}</div>
77-
</div> : null
78-
);
79-
}
83+
</div>
84+
) : null;
85+
};

src/components/ParserOpenRPC/Tooltip/index.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ interface TooltipProps {
99
disabled?: boolean;
1010
}
1111

12-
export const Tooltip = ({ children, message, disabled }: TooltipProps) => (
13-
<ReactTippy
14-
disabled={disabled}
15-
arrow={true}
16-
html={<div className={styles.tooltipContainer}>{message}</div>}
17-
position="top"
18-
interactive={true}
19-
>
20-
{children}
21-
</ReactTippy>
22-
);
12+
export const Tooltip = ({ children, message, disabled }: TooltipProps) => {
13+
return (
14+
<>
15+
{/* @ts-ignore */}
16+
<ReactTippy
17+
disabled={disabled}
18+
arrow={true}
19+
html={<div className={styles.tooltipContainer}>{message}</div>}
20+
position="top"
21+
interactive={true}
22+
>
23+
{children}
24+
</ReactTippy>
25+
</>
26+
);
27+
};

src/components/ParserOpenRPC/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ export default function ParserOpenRPC({ network, method, extraContent }: ParserP
4646
eventName: "Customize Request",
4747
clickType: "Customize Request",
4848
userExperience: "B",
49+
responseStatus: null,
50+
responseMsg: null,
51+
timestamp: Date.now(),
4952
});
5053
};
5154
const closeModal = () => setModalOpen(false);
@@ -111,6 +114,7 @@ export default function ParserOpenRPC({ network, method, extraContent }: ParserP
111114
trackInputChangeForSegment({
112115
eventName: "Request Configuration Started",
113116
userExperience: "B",
117+
timestamp: Date.now(),
114118
});
115119

116120
if (
@@ -144,6 +148,8 @@ export default function ParserOpenRPC({ network, method, extraContent }: ParserP
144148
clickType: "Request Sent",
145149
userExperience: "B",
146150
...(response?.code && { responseStatus: response.code }),
151+
responseMsg: null,
152+
timestamp: Date.now(),
147153
});
148154
} catch (e) {
149155
setReqResult(e);

src/hooks/useSyncProviders.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)