mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-03 14:21:49 +00:00
Fix warning in AppUpdateBanner
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { faSyncAlt as reloadIcon } from '@fortawesome/free-solid-svg-icons';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { SimpleCard, useToggle } from '@shlinkio/shlink-frontend-kit';
|
||||
import type { FC, MouseEventHandler } from 'react';
|
||||
import type { MouseEventHandler } from 'react';
|
||||
import { forwardRef, useCallback } from 'react';
|
||||
import { Alert, Button } from 'reactstrap';
|
||||
import './AppUpdateBanner.scss';
|
||||
|
||||
@@ -11,15 +12,15 @@ interface AppUpdateBannerProps {
|
||||
forceUpdate: Function;
|
||||
}
|
||||
|
||||
export const AppUpdateBanner: FC<AppUpdateBannerProps> = ({ isOpen, toggle, forceUpdate }) => {
|
||||
export const AppUpdateBanner = forwardRef<HTMLElement, AppUpdateBannerProps>(({ isOpen, toggle, forceUpdate }, ref) => {
|
||||
const [isUpdating,, setUpdating] = useToggle();
|
||||
const update = () => {
|
||||
const update = useCallback(() => {
|
||||
setUpdating();
|
||||
forceUpdate();
|
||||
};
|
||||
}, [forceUpdate, setUpdating]);
|
||||
|
||||
return (
|
||||
<Alert className="app-update-banner" isOpen={isOpen} toggle={toggle} tag={SimpleCard} color="secondary">
|
||||
<Alert className="app-update-banner" isOpen={isOpen} toggle={toggle} tag={SimpleCard} color="secondary" innerRef={ref}>
|
||||
<h4 className="mb-4">This app has just been updated!</h4>
|
||||
<p className="mb-0">
|
||||
Restart it to enjoy the new features.
|
||||
@@ -30,4 +31,4 @@ export const AppUpdateBanner: FC<AppUpdateBannerProps> = ({ isOpen, toggle, forc
|
||||
</p>
|
||||
</Alert>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user