import React from 'react'; import { FormattedMessage } from 'react-intl'; import useVersion from 'hooks/useVersion'; import styles from './UpdateNotice.module.css'; import ButtonLayout from '../layout/ButtonLayout'; import Button from './Button'; import useForceUpdate from '../../hooks/useForceUpdate'; export default function UpdateNotice() { const forceUpdate = useForceUpdate(); const { hasUpdate, checked, latest, updateCheck } = useVersion(true); function handleViewClick() { location.href = 'https://github.com/mikecao/umami/releases'; updateCheck(); forceUpdate(); } function handleDismissClick() { updateCheck(); forceUpdate(); } if (!hasUpdate || checked) { return null; } return (
); }