fixe typescript issues for two files

This commit is contained in:
vaidankarswapnil
2021-07-23 17:18:58 +05:30
parent 401660ae15
commit 8b519b812c
3 changed files with 17 additions and 9 deletions

View File

@@ -1,14 +1,14 @@
import { ChoiceGroup, IButtonProps, IChoiceGroupProps, PrimaryButton, IChoiceGroupOption } from "@fluentui/react";
import { ChoiceGroup, IButtonProps, IChoiceGroupOption, IChoiceGroupProps, PrimaryButton } from "@fluentui/react";
import * as React from "react";
import { ChildrenMargin } from "./GitHubStyleConstants";
export interface AuthorizeAccessComponentProps {
scope: string;
authorizeAccess: (scope: string) => void;
authorizeAccess: (scope: string | undefined) => void;
}
export interface AuthorizeAccessComponentState {
scope: string;
scope: string | undefined;
}
export class AuthorizeAccessComponent extends React.Component<
@@ -34,9 +34,12 @@ export class AuthorizeAccessComponent extends React.Component<
"Complete setup by authorizing Azure Cosmos DB to access the repositories in your GitHub account: ";
private static readonly AuthorizeButtonText = "Authorize access";
private onChoiceGroupChange = (event: React.SyntheticEvent<HTMLElement>, option: IChoiceGroupOption): void =>
private onChoiceGroupChange = (
_: React.FormEvent<HTMLElement | HTMLInputElement> | undefined,
option: IChoiceGroupOption | undefined
): void =>
this.setState({
scope: option.key,
scope: option ? option.key : undefined,
});
private onButtonClick = (): void => this.props.authorizeAccess(this.state.scope);
@@ -64,7 +67,10 @@ export class AuthorizeAccessComponent extends React.Component<
},
],
selectedKey: this.state.scope,
onChange: this.onChoiceGroupChange,
onChange: (
_: React.FormEvent<HTMLElement | HTMLInputElement> | undefined,
options: IChoiceGroupOption | undefined
) => this.onChoiceGroupChange(_, options),
};
const buttonProps: IButtonProps = {

View File

@@ -1,5 +1,5 @@
import { HoverCard, HoverCardType, Icon, Label, Link, Stack } from "@fluentui/react";
import * as React from "react";
import { Icon, Label, Stack, HoverCard, HoverCardType, Link } from "@fluentui/react";
import { CodeOfConductEndpoints } from "../../../../Common/Constants";
import "./InfoComponent.less";
@@ -31,7 +31,7 @@ export class InfoComponent extends React.Component<InfoComponentProps> {
</Stack.Item>
{this.props.onReportAbuseClick && (
<Stack.Item>
{this.getInfoPanel("ReportHacked", "Report Abuse", undefined, () => this.props.onReportAbuseClick())}
{this.getInfoPanel("ReportHacked", "Report Abuse", undefined, this.props.onReportAbuseClick)}
</Stack.Item>
)}
</Stack>