Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add generic type support to the fluent-ui theme (#3357)
fixes undefined
- Loading branch information
Showing
31 changed files
with
484 additions
and
242 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,18 +1,27 @@ | ||
import React from "react"; | ||
import { IconButtonProps } from "@rjsf/utils"; | ||
import { | ||
FormContextType, | ||
IconButtonProps, | ||
RJSFSchema, | ||
StrictRJSFSchema, | ||
} from "@rjsf/utils"; | ||
import { IIconProps, CommandBarButton } from "@fluentui/react"; | ||
|
||
const addIcon: IIconProps = { iconName: "Add" }; | ||
|
||
const AddButton = (props: IconButtonProps) => ( | ||
<CommandBarButton | ||
style={{ height: "32px" }} | ||
iconProps={addIcon} | ||
text="Add item" | ||
className={props.className} | ||
onClick={props.onClick} | ||
disabled={props.disabled} | ||
/> | ||
); | ||
|
||
export default AddButton; | ||
export default function AddButton< | ||
T = any, | ||
S extends StrictRJSFSchema = RJSFSchema, | ||
F extends FormContextType = any | ||
>(props: IconButtonProps<T, S, F>) { | ||
return ( | ||
<CommandBarButton | ||
style={{ height: "32px" }} | ||
iconProps={addIcon} | ||
text="Add item" | ||
className={props.className} | ||
onClick={props.onClick} | ||
disabled={props.disabled} | ||
/> | ||
); | ||
} |
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
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.