Plugin download progress and error handling

Summary: Show progress reporting in sidebar during plugin download. Also handle plugin download errors and show them to user as notifications.

Reviewed By: mweststrate

Differential Revision: D25530385

fbshipit-source-id: 42bf0e65b4434d00c1465705ce9ec5c723df6841
This commit is contained in:
Anton Nikolaev
2020-12-15 09:28:58 -08:00
committed by Facebook GitHub Bot
parent c3d61cc32d
commit efb82e80b5
5 changed files with 100 additions and 87 deletions

View File

@@ -30,6 +30,7 @@ export default function Link(props: {
href: string;
children?: React.ReactNode;
style?: React.CSSProperties;
onClick?: ((event: React.MouseEvent<any>) => void) | undefined;
}) {
const isSandy = useIsSandy();
const onClick = useCallback(
@@ -42,9 +43,9 @@ export default function Link(props: {
);
return isSandy ? (
<AntOriginalLink {...props} onClick={onClick} />
<AntOriginalLink {...props} onClick={props.onClick ?? onClick} />
) : (
<StyledLink onClick={onClick} style={props.style}>
<StyledLink onClick={props.onClick ?? onClick} style={props.style}>
{props.children || props.href}
</StyledLink>
);