forked from rjsf-team/react-jsonschema-form
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Partially fix rjsf-team#3072 - Extract ChakraIconButton to its own file to abstract away React.memo - Refactor AltDateWidget to extract DateElement component
- Loading branch information
Showing
30 changed files
with
499 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import React from "react"; | ||
import { IconButtonProps } from "@rjsf/utils"; | ||
import { | ||
FormContextType, | ||
IconButtonProps, | ||
RJSFSchema, | ||
StrictRJSFSchema, | ||
} from "@rjsf/utils"; | ||
import { Button } from "@chakra-ui/react"; | ||
import { AddIcon } from "@chakra-ui/icons"; | ||
|
||
const AddButton: React.ComponentType<IconButtonProps> = ({ | ||
uiSchema, | ||
registry, | ||
...props | ||
}) => ( | ||
<Button leftIcon={<AddIcon />} {...props}> | ||
Add Item | ||
</Button> | ||
); | ||
|
||
export default AddButton; | ||
export default function AddButton< | ||
T = any, | ||
S extends StrictRJSFSchema = RJSFSchema, | ||
F extends FormContextType = any | ||
>({ uiSchema, registry, ...props }: IconButtonProps<T, S, F>) { | ||
return ( | ||
<Button leftIcon={<AddIcon />} {...props}> | ||
Add Item | ||
</Button> | ||
); | ||
} |
15 changes: 12 additions & 3 deletions
15
packages/chakra-ui/src/AltDateTimeWidget/AltDateTimeWidget.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.