Skip to content
This repository was archived by the owner on Jun 1, 2020. It is now read-only.

Commit 1bf539d

Browse files
committed
Add types folder to fix types definitions and update PasswordWidget
1 parent 4710407 commit 1bf539d

File tree

5 files changed

+413
-30
lines changed

5 files changed

+413
-30
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"@material-ui/icons": "^4.2.1",
2525
"@material-ui/lab": "^4.0.0-alpha.18",
2626
"@types/jest": "^24.0.15",
27+
"@types/json-schema": "^7.0.3",
2728
"@types/react": "^16.8.22",
2829
"@types/react-dom": "^16.8.4",
29-
"@types/react-jsonschema-form": "^1.6.0",
3030
"husky": "^3.0.0",
3131
"prettier": "^1.18.2",
3232
"pretty-quick": "^1.11.1",

src/PasswordWidget/PasswordWidget.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import InputLabel from '@material-ui/core/InputLabel';
55

66
import { WidgetProps } from 'react-jsonschema-form';
77

8-
type CustomWidgetProps = WidgetProps & {
9-
options: any
10-
};
11-
128
const PasswordWidget = ({
139
id,
1410
required,
@@ -20,8 +16,8 @@ const PasswordWidget = ({
2016
onBlur,
2117
onChange,
2218
options,
23-
autofocus
24-
}: CustomWidgetProps) => {
19+
autofocus,
20+
}: WidgetProps) => {
2521
const _onChange = ({
2622
target: { value },
2723
}: React.ChangeEvent<HTMLInputElement>) =>

src/Theme/Theme.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
import ArrayFieldTemplate from "../ArrayFieldTemplate";
2-
import ErrorList from "../ErrorList";
3-
import Fields from "../Fields";
4-
import FieldTemplate from "../FieldTemplate";
5-
import ObjectFieldTemplate from "../ObjectFieldTemplate";
6-
import Widgets from "../Widgets";
1+
import { ThemeProps } from 'react-jsonschema-form';
72

8-
export default {
9-
ArrayFieldTemplate,
10-
fields: Fields,
11-
FieldTemplate,
12-
ObjectFieldTemplate,
13-
widgets: Widgets,
14-
ErrorList,
15-
};
3+
import ArrayFieldTemplate from '../ArrayFieldTemplate';
4+
import ErrorList from '../ErrorList';
5+
import Fields from '../Fields';
6+
import FieldTemplate from '../FieldTemplate';
7+
import ObjectFieldTemplate from '../ObjectFieldTemplate';
8+
import Widgets from '../Widgets';
9+
10+
const Theme: ThemeProps = {
11+
ArrayFieldTemplate,
12+
fields: Fields,
13+
FieldTemplate,
14+
ObjectFieldTemplate,
15+
widgets: Widgets,
16+
ErrorList,
17+
};
18+
19+
export default Theme;

0 commit comments

Comments
 (0)