mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 01:58:40 -05:00
fix: some react warnings (#418)
This commit is contained in:
committed by
GitHub
parent
444daae812
commit
0e1276a311
@@ -426,7 +426,6 @@ export function IncomeCategoryMonth({
|
||||
name="received"
|
||||
width="flex"
|
||||
borderColor={colors.border}
|
||||
textAlign="right"
|
||||
style={[
|
||||
{ paddingRight: MONTH_RIGHT_PADDING, textAlign: 'right' },
|
||||
isLast && { borderBottomWidth: 0 }
|
||||
|
||||
@@ -111,18 +111,27 @@ export function AnchorLink({
|
||||
);
|
||||
}
|
||||
|
||||
export const ExternalLink = React.forwardRef((props, ref) => {
|
||||
function onClick(e) {
|
||||
e.preventDefault();
|
||||
window.Actual.openURLInBrowser(props.href);
|
||||
}
|
||||
export const ExternalLink = React.forwardRef(
|
||||
({ asAnchor, children, ...props }, ref) => {
|
||||
function onClick(e) {
|
||||
e.preventDefault();
|
||||
window.Actual.openURLInBrowser(props.href);
|
||||
}
|
||||
|
||||
if (props.asAnchor) {
|
||||
// eslint-disable-next-line
|
||||
return <a ref={ref} {...props} onClick={onClick} />;
|
||||
if (asAnchor) {
|
||||
return (
|
||||
<a ref={ref} {...props} onClick={onClick}>
|
||||
{children}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Button ref={ref} bare {...props} onClick={onClick}>
|
||||
{children}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
return <Button ref={ref} bare {...props} onClick={onClick} />;
|
||||
});
|
||||
);
|
||||
|
||||
function ButtonLink_({
|
||||
history,
|
||||
|
||||
Reference in New Issue
Block a user